tor: use new procd init script style
authorPeter Wagner <​tripolar@gmx.at>
Mon, 23 Sep 2013 10:14:15 +0000 (10:14 +0000)
committerPeter Wagner <​tripolar@gmx.at>
Mon, 23 Sep 2013 10:14:15 +0000 (10:14 +0000)
Signed-off-by: Peter Wagner <tripolar@gmx.at>
SVN-Revision: 38135

net/tor/files/tor.init

index 8d11089ec261b52c54d39cb30fb4711ab9dcfa12..7c548b40b8183dc47487cf1c4e0460a219d030ce 100644 (file)
@@ -4,9 +4,9 @@
 START=50
 STOP=50
 
-SERVICE_USE_PID=1
+USE_PROCD=1
 
-start() {
+start_service() {
        user_exists tor 52 || user_add tor 52 52 /var/lib/tor
        group_exists tor 52 || group_add tor 52
        [ -f /var/run/tor.pid ] || {
@@ -22,9 +22,7 @@ start() {
                mkdir -m 0755 -p /var/log/tor
                chown tor:tor /var/log/tor
        }
-       service_start /usr/sbin/tor --PidFile /var/run/tor.pid
-}
-
-stop() {
-       service_stop /usr/sbin/tor
+       procd_open_instance
+       procd_set_param command /usr/sbin/tor --runasdaemon 0
+       procd_close_instance
 }