2 # Copyright (c) 1996-2001 SuSE GmbH Nuernberg, Germany. All rights reserved.
5 # Reinhold Sojer, <reinhold@suse.de>
6 # Olaf Hering, <olh@suse.de>
10 # Required-Start: $network $named $remote_fs $syslog
14 # Description: AFP over TCP and legacy Appletalk daemons
17 test -f /etc/rc.config && {
20 # Determine the base and follow a runlevel link name.
22 link=${base#*[SK][0-9][0-9]}
24 # Force execution if not called by a runlevel directory.
25 test $link = $base && START_ATALK=yes
26 test "$START_ATALK" = "yes" || exit 0
28 test -f /etc/rc.status && . /etc/rc.status
29 # The echo return value for success (defined in /etc/rc.config).
33 . :ETCDIR:/netatalk.conf
35 # startup code for everything
37 if [ x"${ATALKD_RUN}" != x"no" ]; then
38 echo -n " Starting atalkd:"
41 if [ -x :BINDIR:/nbprgstr ]; then
42 :BINDIR:/nbprgstr -p 4 `hostname|sed 's/\..*$//'`:Workstation
43 :BINDIR:/nbprgstr -p 4 `hostname|sed 's/\..*$//'`:netatalk
47 if [ x"${PAPD_RUN}" = x"yes" -a -x :SBINDIR:/papd ]; then
48 echo -n " Starting papd:"
52 if [ x"${TIMELORD_RUN}" = x"yes" -a -x :SBINDIR:/timelord ]; then
53 echo -n " Starting timelord"
59 if [ x"${CNID_METAD_RUN}" = x"yes" -a -x :SBINDIR:/cnid_metad ] ; then
60 echo -n " Starting cnid_metad:"
61 startproc :SBINDIR:/cnid_metad $CNID_CONFIG
64 if [ x"${AFPD_RUN}" = x"yes" -a -x :SBINDIR:/afpd ] ; then
65 echo -n " Starting afpd:"
66 echo ${AFPD_UAMLIST} -g ${AFPD_GUEST} \
67 -c ${AFPD_MAX_CLIENTS} -n ${ATALK_NAME}${ATALK_ZONE}
68 startproc :SBINDIR:/afpd ${AFPD_UAMLIST} -g ${AFPD_GUEST} \
69 -c ${AFPD_MAX_CLIENTS} -n ${ATALK_NAME}${ATALK_ZONE}
72 touch /var/lock/subsys/atalk
77 if [ x"${ATALK_BGROUND}" = x"yes" ]; then
78 echo "Starting netatalk in the background ... "
79 atalk_startup >& /dev/null &
81 echo "Starting netatalk (this may take a while) ..."
86 echo -n "Shutting down netatalk:"
87 killproc -TERM :SBINDIR:/papd
88 if test -x :SBINDIR:/timelord ; then
89 killproc -TERM :SBINDIR:/timelord
91 killproc -TERM :SBINDIR:/atalkd
92 killproc -TERM :SBINDIR:/afpd
93 if test -x :SBINDIR:/cnid_metad ; then
94 killproc -TERM :SBINDIR:/cnid_metad
99 $0 stop && $0 start || return=$rc_failed
102 echo -n "Checking for service atalk:"
103 checkproc :SBINDIR:/papd && echo -n "OK" || echo -n "No process"
104 checkproc :SBINDIR:/afpd && echo -n "OK" || echo "No process"
105 if test -x :SBINDIR:/timelord ; then
106 checkproc :SBINDIR:/timelord || return=$rc_failed
108 if test -x :SBINDIR:/cnid_metad ; then
109 checkproc :SBINDIR:/cnid_metad || return=$rc_failed
111 checkproc :SBINDIR:/atalkd && echo "OK" || echo "No process"
114 echo "Usage: $0 {start|stop|restart|status}"
119 # Inform the caller not only verbosely and set an exit status.
120 test "$return" = "$rc_done" || exit 1