How do i start in slitaz a service automatically? In this case i'd like to have tor started automatically on boot ...
TIA
How do i start in slitaz a service automatically? In this case i'd like to have tor started automatically on boot ...
TIA
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 .
Thanks a lot!
Please mark as solved, if it does work of course!
@emninger
Please try tord the new tor init script.
Install directions:
wget http://people.slitaz.org/~mojo/stuff/tord
mv tord /etc/init.d
chown root:root /etc/init.d/tord
chmod 755 /etc/init.d/tord
echo "PIDFile /var/run/tor.pid" >> /etc/tor/torrc
Usage:/etc/init.d/tord start|stop|restart
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.
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.
>=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: startd tord
and stopd tord
Yes, this is simply like any other Linux using init.d (not systemd):
/etc/init.d/service restart
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.
@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).
@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 ... (?) )
@mojo
I see i've 2 times tord: Once on / and once in /etc/init.d - is it safe to delete the topmost one?
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 .
@llev
/etc/init.d/tord
=> init shell script that starts /usr/bin/tor
/tord
=> 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.
wget http://people.slitaz.org/~mojo/stuff/tord
mv tord /etc/init.d
Add tord
to RUN_DAEMONS in /etc/rcS.conf
to start tor on boot.
@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 (?) ).
You must log in to post.