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>
15 PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
18 SCRIPTNAME=/etc/init.d/$NAME
20 # Guard to prevent execution if netatalk was removed.
21 test -x :SBINDIR:/afpd || exit 0
23 # Set defaults. Please change these options in /etc/default/netatalk
24 ATALK_NAME=`/bin/hostname --short`
25 ATALK_UNIX_CHARSET='LOCALE'
26 ATALK_MAC_CHARSET='MAC_ROMAN'
31 AFPD_UAMLIST="-U uams_dhx2.so"
34 CNID_CONFIG="-l log_note"
43 # Read in netatalk configuration.
44 if [ -f /etc/default/netatalk ]; then
45 . /etc/default/netatalk
48 # Start Netatalk servers.
50 if [ x"$ATALKD_RUN" = x"yes" ]; then
52 # Try to load the AppleTalk kernel module if it was intended.
53 if grep -q '^appletalk$' /etc/modules; then
54 /sbin/modprobe appletalk || echo "[could not load appletalk module]"
57 # Start atalkd server.
60 # register workstation
61 :BINDIR:/nbprgstr -p 4 "$ATALK_NAME:Workstation$ATALK_ZONE"
62 :BINDIR:/nbprgstr -p 4 "$ATALK_NAME:netatalk$ATALK_ZONE"
67 # prepare startup of file services
68 if [ "x$CNID_METAD_RUN" = "xyes" -a -x :SBINDIR:/cnid_metad ] ; then
70 :SBINDIR:/cnid_metad $CNID_CONFIG
73 if [ x"$AFPD_RUN" = x"yes" ]; then
74 :SBINDIR:/afpd $AFPD_UAMLIST -g $AFPD_GUEST -c $AFPD_MAX_CLIENTS \
75 -n "$ATALK_NAME$ATALK_ZONE"
79 if [ "x$ATALKD_RUN" = "xyes" ]; then
80 if [ "x$PAPD_RUN" = "xyes" ]; then
85 if [ x"$TIMELORD_RUN" = x"yes" ]; then
94 if [ "x$ATALK_BGROUND" = "xyes" -a "x$ATALKD_RUN" = "xyes" ]; then
95 echo "Starting Netatalk services in the background."
96 atalk_startup >/dev/null &
98 echo -n "Starting Netatalk services (this will take a while): "
105 echo -n "Stopping Netatalk Daemons:"
107 start-stop-daemon --stop --quiet --oknodo --exec :SBINDIR:/afpd
109 echo -n " cnid_metad"
110 start-stop-daemon --stop --quiet --oknodo --exec :SBINDIR:/cnid_metad
112 if test -x :SBINDIR:/papd; then
114 start-stop-daemon --stop --quiet --oknodo --exec :SBINDIR:/papd
117 if test -x :SBINDIR:/timelord; then
119 start-stop-daemon --stop --quiet --oknodo --exec :SBINDIR:/timelord
122 if test -x :SBINDIR:/atalkd; then
124 start-stop-daemon --stop --quiet --oknodo --exec :SBINDIR:/atalkd
135 echo -n "Restarting Netatalk Daemons (this will take a while)"
146 echo "Usage: $0 {start|stop|restart|force-reload}" >&2