You are not logged in.
How do i start in slitaz a service automatically? In this case i'd like to have tor started automatically on boot ...
TIA
Offline
Add it to the RUN_DAEMONS variable in /etc/rcS.conf, if it is a standard init script. Or you can add custom commands in /etc/init.d/local.sh .
Offline
Thanks a lot!
Offline
Please mark as solved, if it does work of course!
Offline
@emninger
Please try tord the new tor init script.
Install directions:
[c]wget http://people.slitaz.org/~mojo/stuff/tord[/c]
[c]mv tord /etc/init.d[/c]
[c]chown root:root /etc/init.d/tord[/c]
[c]chmod 755 /etc/init.d/tord[/c]
[c]echo "PIDFile /var/run/tor.pid" >> /etc/tor/torrc[/c]
Usage:[c]/etc/init.d/tord start|stop|restart[/c]
Tord init script /dev/nulls tor terminal output.
Start tor at the command line to verify it is configured and running properly by observing terminal output before using tord init script.
Offline
Hi mojo! Thanks that's something i was looking for.
Generally, is there something equivalent in Slitaz to slackware/debian/... service start|stop|restart or sv start|stop|restart (for openrc or runit distros)?
Actually, i'm killing via htop and restart than manually - that's not really very elegant.
Offline
>=slitaz-5.0 has stopd|startd abbreviation for init scripts in /etc/init.d
Enables leaving off path /etc/init.d to script command.
Example: [c]startd tord[/c] and [c]stopd tord[/c]
Offline
Yes, this is simply like any other Linux using init.d (not systemd):
[c]/etc/init.d/service restart[/c]
Offline
slitaz-tools owns /usr/bin/startd
Startd - Small wrapper to start daemons on SliTaz
It's simple to copy rename edit to make a /usr/bin/restartd.
Offline
@mojo:
Just to control/check tor i'd suggest tor-arm, which is a nice ncurses program to control tor (also suggested by the tor people). I used since a long time on slackware and i'm happy with. You only have to activate the control port (and to create a password, obviously).
Offline
@ilev
>Add it to the RUN_DAEMONS variable in /etc/rcS.conf, if it is a standard init script. Or you can add >custom commands in /etc/init.d/local.sh .
So i could simply put in local.sh, just as an example:
tord &
polipo &
(Seems easier to me than to probably mess up rcS ... (?) )
Offline
@mojo
I see i've 2 times tord: Once on / and once in /etc/init.d - is it safe to delete the topmost one?
Offline
Why do you want to delete something, if all is working? If the topmost one is the binary, and the other one is a symlink, you'll have a (bad) surprise!
As for local.sh/rcS.conf, it's equivalent as far as running services is concerned. Note I told you to edit /etc/rcS.conf, NOT /etc/init.d/rcS .
Offline
@llev
[c]/etc/init.d/tord[/c] => init shell script that starts [c]/usr/bin/tor[/c]
[c]/tord[/c] => copy of init shell script can be deleted
@emninger
tord belongs in /etc/init.d
You were in / when you downloaded tord with wget
I changed cp to mv in directions above so there is not a duplicate copy of tord.
[c]wget http://people.slitaz.org/~mojo/stuff/tord[/c]
[c]mv tord /etc/init.d[/c]
Add [c]tord[/c] to RUN_DAEMONS in [c]/etc/rcS.conf[/c] to start tor on boot.
Offline
@ilev
Yes, i'm aware of that 
@mojo
Would it be sufficient to simply add tord in there. Actually my line would look like this:
RUN_DAEMONS="firewall httpd tord" Is that ok? Or does tord need a start command?
Then a systematic (or systemic
) question: Since local.sh is included, tor would also be started if put in local.sh (for example in this way: "tor -d &")? But with a different owner? In the first case owned by root in the second owned by <user> (as far as i know the tor people do not recommend to run tor as root (?) ).
Offline
1) No start command. Check /etc/init.d/rcS: it simply runs "daemon start" where "daemon" is given each value in RUN_DAEMONS in turn.
2) Both ways are run by root. If you really need another user, you could put the following in local.sh:
[c]su -c "tor -d &" - username &[/c]
3) Maybe does tord automatically run the service as another user? You can check, after starting it, who is the owner by:
[c]ps | grep tor[/c]
Offline
I did it this way: In local.sh i defined:
> su -c "/etc/init.d/tord start &" - myusername &
That seems to work and allows me to control tor locally via tor-arm (since in slitaz there is no sudo, that's the most convenient way). Obviously, the access to the control port is password protected.
Generally, i'm not so sure about how tor has to be run; in slackware tor runs as user tor. In any case, the tor manual says it's not a good idea to run it as root.
Anyway, thanks for the lesson in busybox 
Offline
[c]# tazpkg -gi sudo[/c]

(please mark topic as solved)
Offline
[ Generated in 0.017 seconds, 7 queries executed - Memory usage: 1.56 MiB (Peak: 1.77 MiB) ]