]> arthur.barton.de Git - netatalk.git/blob - distrib/initscripts/rc.atalk.gentoo.tmpl
Fix cnid_metad -l option
[netatalk.git] / distrib / initscripts / rc.atalk.gentoo.tmpl
1 #!/sbin/runscript
2
3 # AppleTalk daemons. Make sure not to start atalkd in the background:
4 # its data structures must have time to stablize before running the
5 # other processes.
6
7 depend() {
8         need net
9         use logger dns
10 }
11
12 atalk_startup () {
13 #       . :ETCDIR:/netatalk.conf
14
15         if [ "${ATALKD_RUN}" != "no" ]; then
16                 ebegin "Starting atalkd"
17                 start-stop-daemon --start --quiet --exec :SBINDIR:/atalkd
18                 eend $?
19
20                 for reg in \
21                         "${ATALK_NAME}:Workstation${ATALK_ZONE}" \
22                         "${ATALK_NAME}:netatalk${ATALK_ZONE}"
23                 do
24                         ebegin "  Registering $reg"
25                         :BINDIR:/nbprgstr "$reg"
26                         eend $?
27                 done
28
29                 if [ "${PAPD_RUN}" = "yes" ]; then
30                         ebegin "  Starting papd"
31                         start-stop-daemon --start --quiet --exec :SBINDIR:/papd
32                         eend $?
33                 fi
34
35         fi
36
37         if [ "${CNID_METAD_RUN}" = "yes" ] ; then
38         ebegin "Starting cnid_metad"
39         if [ "x$CNID_DBD_LOGCONFIG" = "x" ]; then
40                     start-stop-daemon --start --quiet --exec :SBINDIR:/cnid_metad
41         else
42                     start-stop-daemon --start --quiet --exec :SBINDIR:/cnid_metad -l "$CNID_DBD_LOGCONFIG"
43         fi
44                 eend $?
45         fi
46
47
48         if [ "${AFPD_RUN}" = "yes" ]; then
49                 ebegin "Starting afpd"
50                 start-stop-daemon --start --quiet --exec :SBINDIR:/afpd -- \
51                         ${AFPD_UAMLIST} -g ${AFPD_GUEST} -c ${AFPD_MAX_CLIENTS} \
52                         -n "${ATALK_NAME}${ATALK_ZONE}"
53                 eend $?
54         fi
55
56         if [ "${TIMELORD_RUN}" = "yes" ]; then
57                 ebegin "Starting timelord"
58                 start-stop-daemon --start --quiet --exec :SBINDIR:/timelord
59                 eend $?
60         fi
61 }
62
63 start () {
64         . :ETCDIR:/netatalk.conf
65
66         if [ x"${ATALK_BGROUND}" = x"yes" ]; then
67             echo "Starting netatalk in the background ... "
68             atalk_startup >& /dev/null &
69         else
70             atalk_startup
71         fi
72 }
73
74 stop () {
75         . :ETCDIR:/netatalk.conf
76
77         if [ "${AFPD_RUN}" = "yes" ]; then
78                 ebegin "Stopping afpd"
79                 start-stop-daemon --stop --quiet --exec :SBINDIR:/afpd
80                 eend $?
81         fi
82
83         if [ "${TIMELORD_RUN}" = "yes" ]; then
84                 ebegin "Stopping timelord"
85                 start-stop-daemon --stop --quiet --exec :SBINDIR:/timelord
86                 eend $?
87         fi
88
89         if [ "${ATALKD_RUN}" != "no" ]; then
90                 if [ "${PAPD_RUN}" = "yes" ]; then
91                         ebegin "Stopping papd"
92                         start-stop-daemon --stop --quiet --exec :SBINDIR:/papd
93                         eend $?
94                 fi
95
96                 for reg in \
97                         "${ATALK_NAME}:Workstation${ATALK_ZONE}" \
98                         "${ATALK_NAME}:netatalk${ATALK_ZONE}"
99                 do
100                         ebegin "Unregistering $reg"
101                         :BINDIR:/nbpunrgstr "$reg"
102                         eend $?
103                 done
104
105                 ebegin "Stopping atalkd"
106                 start-stop-daemon --stop --quiet --exec :SBINDIR:/atalkd
107                 eend $?
108         fi
109
110         if [ "${CNID_METAD_RUN}" = "yes" ] ; then
111                 ebegin "Stopping cnid_metad"
112                 start-stop-daemon --stop --quiet --exec :SBINDIR:/cnid_metad
113                 eend $?
114         fi
115 }