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:/atalkd || exit 0
23 # Set defaults. Please change these options in /etc/default/netatalk
24 AFPD_UAMLIST="-U uams_dhx2.so"
28 ATALK_NAME=`/bin/hostname --short`
31 ATALK_MAC_CHARSET='MAC_ROMAN'
32 ATALK_UNIX_CHARSET='LOCALE'
34 # /etc/default/netatalk expects hostname in $HOSTNAME by default
35 HOSTNAME=`/bin/hostname`
36 # next netatalk 2.2 will not expect $HOSTNAME.
38 # Read in netatalk configuration.
39 if [ -f /etc/default/netatalk ]; then
40 . /etc/default/netatalk
43 # Start Netatalk servers.
45 if [ x"$ATALKD_RUN" = x"yes" ]; then
47 # Try to load the AppleTalk kernel module if it was intended.
48 if grep -q '^appletalk$' /etc/modules; then
49 /sbin/modprobe appletalk || echo "[could not load appletalk module]"
52 # Start atalkd server.
55 # register workstation
56 :BINDIR:/nbprgstr -p 4 "$ATALK_NAME:Workstation$ATALK_ZONE"
57 :BINDIR:/nbprgstr -p 4 "$ATALK_NAME:netatalk$ATALK_ZONE"
62 # prepare startup of file services
63 if [ "x$CNID_METAD_RUN" = "xyes" -a -x :SBINDIR:/cnid_metad ] ; then
65 :SBINDIR:/cnid_metad $CNID_CONFIG
68 if [ x"$AFPD_RUN" = x"yes" ]; then
69 :SBINDIR:/afpd $AFPD_UAMLIST -g $AFPD_GUEST -c $AFPD_MAX_CLIENTS \
70 -n "$ATALK_NAME$ATALK_ZONE"
74 if [ "x$ATALKD_RUN" = "xyes" ]; then
75 if [ "x$PAPD_RUN" = "xyes" ]; then
80 if [ x"$TIMELORD_RUN" = x"yes" ]; then
89 if test "x$ATALK_BGROUND" = "xyes"; then
90 echo "Starting Netatalk services in the background."
91 atalk_startup >/dev/null &
93 echo -n "Starting Netatalk services (this will take a while): "
100 echo -n "Stopping Netatalk Daemons:"
102 start-stop-daemon --stop --quiet --oknodo --exec :SBINDIR:/afpd
104 echo -n " cnid_metad"
105 start-stop-daemon --stop --quiet --oknodo --exec :SBINDIR:/cnid_metad
108 start-stop-daemon --stop --quiet --oknodo --exec :SBINDIR:/papd
110 if test -x :SBINDIR:/timelord; then
112 start-stop-daemon --stop --quiet --oknodo --exec :SBINDIR:/timelord
116 start-stop-daemon --stop --quiet --oknodo --exec :SBINDIR:/atalkd
126 echo -n "Restarting Netatalk Daemons (this will take a while)"
137 echo "Usage: $0 {start|stop|restart|force-reload}" >&2