4 # Required-Start: $remote_fs $syslog
5 # Required-Stop: $remote_fs $syslog
6 # Default-Start: 2 3 4 5
10 # netatalk Netatalk :NETATALK_VERSION: 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"
33 CNID_CONFIG="-l log_note"
42 # old /etc/default/netatalk expected hostname in $HOSTNAME by default
43 HOSTNAME=`/bin/hostname`
45 # Read in netatalk configuration.
46 if [ -f /etc/default/netatalk ]; then
47 . /etc/default/netatalk
50 # Start Netatalk servers.
52 if [ x"$ATALKD_RUN" = x"yes" ]; then
54 # Try to load the AppleTalk kernel module if it was intended.
55 if grep -q '^appletalk$' /etc/modules; then
56 /sbin/modprobe appletalk || echo "[could not load appletalk module]"
59 # Start atalkd server.
62 # register workstation
63 :BINDIR:/nbprgstr -p 4 "$ATALK_NAME:Workstation$ATALK_ZONE"
64 :BINDIR:/nbprgstr -p 4 "$ATALK_NAME:netatalk$ATALK_ZONE"
69 # prepare startup of file services
70 if [ "x$CNID_METAD_RUN" = "xyes" -a -x :SBINDIR:/cnid_metad ] ; then
72 :SBINDIR:/cnid_metad $CNID_CONFIG
75 if [ x"$AFPD_RUN" = x"yes" ]; then
76 :SBINDIR:/afpd $AFPD_UAMLIST -g $AFPD_GUEST -c $AFPD_MAX_CLIENTS \
77 -n "$ATALK_NAME$ATALK_ZONE"
81 if [ "x$ATALKD_RUN" = "xyes" ]; then
82 if [ "x$PAPD_RUN" = "xyes" ]; then
87 if [ x"$TIMELORD_RUN" = x"yes" ]; then
96 if [ "x$ATALK_BGROUND" = "xyes" -a "x$ATALKD_RUN" = "xyes" ]; then
97 echo "Starting Netatalk services in the background."
98 atalk_startup >/dev/null &
100 echo -n "Starting Netatalk services (this will take a while): "
107 echo -n "Stopping Netatalk Daemons:"
109 start-stop-daemon --stop --quiet --oknodo --exec :SBINDIR:/afpd
111 echo -n " cnid_metad"
112 start-stop-daemon --stop --quiet --oknodo --exec :SBINDIR:/cnid_metad
114 if test -x :SBINDIR:/papd; then
116 start-stop-daemon --stop --quiet --oknodo --exec :SBINDIR:/papd
119 if test -x :SBINDIR:/timelord; then
121 start-stop-daemon --stop --quiet --oknodo --exec :SBINDIR:/timelord
124 if test -x :SBINDIR:/atalkd; then
126 start-stop-daemon --stop --quiet --oknodo --exec :SBINDIR:/atalkd
137 echo -n "Restarting Netatalk Daemons (this will take a while)"
148 echo "Usage: $0 {start|stop|restart|force-reload}" >&2