4 # Required-Start: $remote_fs $syslog
5 # Required-Stop: $remote_fs $syslog
6 # Default-Start: 2 3 4 5
10 # netatalk Netatalk 2.x initscript
11 # Author: Thomas Kaiser <Thomas.Kaiser@phg-online.de>
12 # Version: $Id: rc.atalk.debian.tmpl,v 1.6 2009-06-09 11:58:49 franklahm Exp $
16 PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
19 SCRIPTNAME=/etc/init.d/$NAME
21 # Guard to prevent execution if netatalk was removed.
22 test -x :SBINDIR:/atalkd || exit 0
24 # Set defaults. Please change these options in /etc/default/netatalk
25 AFPD_UAMLIST="-U uams_dhx2.so"
29 ATALK_NAME=`/bin/hostname --short`
32 ATALK_MAC_CHARSET='MAC_ROMAN'
33 ATALK_UNIX_CHARSET='LOCALE'
35 # Read in netatalk configuration.
36 if [ -f /etc/default/netatalk ]; then
37 . /etc/default/netatalk
40 # Start Netatalk servers.
42 if [ x"$ATALKD_RUN" = x"yes" ]; then
44 # Try to load the AppleTalk kernel module if it was intended.
45 if grep -q '^appletalk$' /etc/modules; then
46 /sbin/modprobe appletalk || echo "[could not load appletalk module]"
49 # Start atalkd server.
52 # register workstation
53 :BINDIR:/nbprgstr -p 4 "$ATALK_NAME:Workstation$ATALK_ZONE"
54 :BINDIR:/nbprgstr -p 4 "$ATALK_NAME:netatalk$ATALK_ZONE"
59 # prepare startup of file services
60 if [ "x$CNID_METAD_RUN" = "xyes" -a -x :SBINDIR:/cnid_metad ] ; then
62 :SBINDIR:/cnid_metad $CNID_CONFIG
65 if [ x"$AFPD_RUN" = x"yes" ]; then
66 :SBINDIR:/afpd $AFPD_UAMLIST -g $AFPD_GUEST -c $AFPD_MAX_CLIENTS \
67 -n "$ATALK_NAME$ATALK_ZONE"
71 if [ "x$ATALKD_RUN" = "xyes" ]; then
72 if [ "x$PAPD_RUN" = "xyes" ]; then
77 if [ x"$TIMELORD_RUN" = x"yes" ]; then
86 if test "x$ATALK_BGROUND" = "xyes"; then
87 echo "Starting Netatalk services in the background."
88 atalk_startup >/dev/null &
90 echo -n "Starting Netatalk services (this will take a while): "
97 echo -n "Stopping Netatalk Daemons:"
99 start-stop-daemon --stop --quiet --oknodo --exec :SBINDIR:/afpd
101 echo -n " cnid_metad"
102 start-stop-daemon --stop --quiet --oknodo --exec :SBINDIR:/cnid_metad
105 start-stop-daemon --stop --quiet --oknodo --exec :SBINDIR:/papd
107 if test -x :SBINDIR:/timelord; then
109 start-stop-daemon --stop --quiet --oknodo --exec :SBINDIR:/timelord
113 start-stop-daemon --stop --quiet --oknodo --exec :SBINDIR:/atalkd
123 echo -n "Restarting Netatalk Daemons (this will take a while)"
134 echo "Usage: $0 {start|stop|restart|force-reload}" >&2