3 # atalk Netatalk 2.x initscript
5 # Author: Thomas Kaiser <Thomas.Kaiser@phg-online.de>
7 # Version: $Id: rc.atalk.debian.tmpl,v 1.3 2009-03-31 14:08:35 franklahm Exp $
11 PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
14 SCRIPTNAME=/etc/init.d/$NAME
16 # Guard to prevent execution if netatalk was removed.
17 test -x :SBINDIR:/atalkd || exit 0
19 # Read in netatalk configuration.
20 if [ -f :ETCDIR:/netatalk.conf ]; then
21 . :ETCDIR:/netatalk.conf
24 # Start Netatalk servers.
26 if [ x"$ATALKD_RUN" = x"yes" ]; then
28 # Try to load the AppleTalk kernel module
29 /sbin/modprobe appletalk || echo "[could not load appletalk module]"
31 # Start atalkd server.
34 # register workstation
35 :BINDIR:/nbprgstr -p 4 "$ATALK_NAME:Workstation$ATALK_ZONE"
36 :BINDIR:/nbprgstr -p 4 "$ATALK_NAME:netatalk$ATALK_ZONE"
41 # prepare startup of file services
42 if [ x"${CNID_METAD_RUN}" = x"yes" -a -x :SBINDIR:/cnid_metad ] ; then
44 :SBINDIR:/cnid_metad "$CNID_DBD_LOGCONFIG"
47 if [ x"$AFPD_RUN" = x"yes" ]; then
48 :SBINDIR:/afpd $AFPD_UAMLIST -g $AFPD_GUEST -c $AFPD_MAX_CLIENTS \
49 -n "$ATALK_NAME$ATALK_ZONE"
53 if [ x"$ATALKD_RUN" = x"yes" -a x"$PAPD_RUN" = x"yes" ]; then
58 if [ x"$TIMELORD_RUN" = x"yes" ]; then
66 if test x"${ATALK_BGROUND}" = x"yes"; then
67 echo "Starting Netatalk services in the background."
68 atalk_startup >/dev/null &
70 echo -n "Starting Netatalk services (this will take a while): "
77 echo -n "Stopping Netatalk Daemons:"
79 start-stop-daemon --stop --quiet --oknodo --exec :SBINDIR:/afpd
82 start-stop-daemon --stop --quiet --oknodo --exec :SBINDIR:/cnid_metad
85 start-stop-daemon --stop --quiet --oknodo --exec :SBINDIR:/papd
87 if test -x :SBINDIR:/timelord; then
89 start-stop-daemon --stop --quiet --oknodo --exec :SBINDIR:/timelord
93 start-stop-daemon --stop --quiet --oknodo --exec :SBINDIR:/atalkd
103 echo -n "Restarting Netatalk Daemons (this will take a while)"
114 echo "Usage: $0 {start|stop|restart|force-reload}" >&2