source: packages/net/tor/files/tor.init @ 29177

Last change on this file since 29177 was 29177, checked in by nico, 4 years ago

packages/tor{,-alpha}: use a fixed predictable pid-file location (patch from Peter Wagner), remove PidFile config entry

  • Property svn:eol-style set to native
File size: 602 bytes
Line 
1#!/bin/sh /etc/rc.common
2# Copyright (C) 2006-2011 OpenWrt.org
3
4START=50
5STOP=50
6
7SERVICE_USE_PID=1
8
9start() {
10        user_exists tor 52 || user_add tor 52 52 /var/lib/tor
11        group_exists tor 52 || group_add tor 52
12        [ -f /var/run/tor.pid ] || {
13                touch /var/run/tor.pid
14                chown tor:tor /var/run/tor.pid
15        }
16        [ -d /var/lib/tor ] || {
17                mkdir -m 0755 -p /var/lib/tor
18                chmod 0700 /var/lib/tor
19                chown tor:tor /var/lib/tor
20        }
21        [ -d /var/log/tor ] || {
22                mkdir -m 0755 -p /var/log/tor
23                chown tor:tor /var/log/tor
24        }
25        service_start /usr/sbin/tor --PidFile /var/run/tor.pid
26}
27
28stop() {
29        service_stop /usr/sbin/tor
30}
Note: See TracBrowser for help on using the repository browser.