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 ATALK_NAME=`hostname|sed 's/\..*$//'`
34 ATALK_UNIX_CHARSET='LOCALE'
35 ATALK_MAC_CHARSET='MAC_ROMAN'
40 AFPD_UAMLIST="-U uams_dhx.so,uams_dhx2.so"
42 CNID_CONFIG="-l log_note"
52 . :ETCDIR:/netatalk.conf
54 # startup code for everything
56 if [ x"${ATALKD_RUN}" != x"no" ]; then
57 echo -n " Starting atalkd:"
60 if [ -x :BINDIR:/nbprgstr ]; then
61 :BINDIR:/nbprgstr -p 4 ${ATALK_NAME}:Workstation
62 :BINDIR:/nbprgstr -p 4 ${ATALK_NAME}:netatalk
66 if [ x"${PAPD_RUN}" = x"yes" -a -x :SBINDIR:/papd ]; then
67 echo -n " Starting papd:"
71 if [ x"${TIMELORD_RUN}" = x"yes" -a -x :SBINDIR:/timelord ]; then
72 echo -n " Starting timelord"
78 if [ x"${CNID_METAD_RUN}" = x"yes" -a -x :SBINDIR:/cnid_metad ] ; then
79 echo -n " Starting cnid_metad:"
80 startproc :SBINDIR:/cnid_metad $CNID_CONFIG
83 if [ x"${AFPD_RUN}" = x"yes" -a -x :SBINDIR:/afpd ] ; then
84 echo -n " Starting afpd:"
85 echo ${AFPD_UAMLIST} -g ${AFPD_GUEST} \
86 -c ${AFPD_MAX_CLIENTS} -n ${ATALK_NAME}${ATALK_ZONE}
87 startproc :SBINDIR:/afpd ${AFPD_UAMLIST} -g ${AFPD_GUEST} \
88 -c ${AFPD_MAX_CLIENTS} -n ${ATALK_NAME}${ATALK_ZONE}
91 touch /var/lock/subsys/atalk
96 if [ x"${ATALK_BGROUND}" = x"yes" -a x"${ATALKD_RUN}" != x"no" ]; then
97 echo "Starting netatalk in the background ... "
98 atalk_startup >& /dev/null &
100 echo "Starting netatalk (this may take a while) ..."
105 echo -n "Shutting down netatalk:"
106 killproc -TERM :SBINDIR:/papd
107 if test -x :SBINDIR:/timelord ; then
108 killproc -TERM :SBINDIR:/timelord
110 killproc -TERM :SBINDIR:/atalkd
111 killproc -TERM :SBINDIR:/afpd
112 if test -x :SBINDIR:/cnid_metad ; then
113 killproc -TERM :SBINDIR:/cnid_metad
118 $0 stop && $0 start || return=$rc_failed
121 echo -n "Checking for service atalk:"
122 checkproc :SBINDIR:/papd && echo -n "OK" || echo -n "No process"
123 checkproc :SBINDIR:/afpd && echo -n "OK" || echo "No process"
124 if test -x :SBINDIR:/timelord ; then
125 checkproc :SBINDIR:/timelord || return=$rc_failed
127 if test -x :SBINDIR:/cnid_metad ; then
128 checkproc :SBINDIR:/cnid_metad || return=$rc_failed
130 checkproc :SBINDIR:/atalkd && echo "OK" || echo "No process"
133 echo "Usage: $0 {start|stop|restart|status}"
138 # Inform the caller not only verbosely and set an exit status.
139 test "$return" = "$rc_done" || exit 1