#
### BEGIN INIT INFO
# Provides: netatalk
- # Required-Start: $network $named $remote_fs $syslog
- # Required-Stop:
+ # Required-Start: $local_fs
+ # Required-Stop: $local_fs
+ # Should-Start: $network $named $remote_fs $syslog slpd
+ # Should-Stop: $remote_fs $network $syslog
# Default-Start: 3 5
# Default-Stop:
- # Description: AFP over TCP and legacy Appletalk daemons
+ # Description: AFP over TCP and legacy AppleTalk daemons
### END INIT INFO
- test -f /etc/rc.config && {
- . /etc/rc.config
-
- # Determine the base and follow a runlevel link name.
- base=${0##*/}
- link=${base#*[SK][0-9][0-9]}
-
- # Force execution if not called by a runlevel directory.
- test $link = $base && START_ATALK=yes
- test "$START_ATALK" = "yes" || exit 0
-
- test -f /etc/rc.status && . /etc/rc.status
- # The echo return value for success (defined in /etc/rc.config).
- return=$rc_done
- }
-
+ATALK_NAME=`hostname|sed 's/\..*$//'`
+ATALK_UNIX_CHARSET='LOCALE'
+ATALK_MAC_CHARSET='MAC_ROMAN'
+
+CNID_METAD_RUN=yes
+AFPD_RUN=yes
+AFPD_MAX_CLIENTS=20
+AFPD_UAMLIST="-U uams_dhx.so,uams_dhx2.so"
+AFPD_GUEST=nobody
+CNID_CONFIG="-l log_note"
+
+ATALKD_RUN=no
+PAPD_RUN=no
+TIMELORD_RUN=no
+#A2BOOT_RUN=no
+ATALK_ZONE=
+ATALK_BGROUND=no
+
-
+ . /etc/rc.status
. :ETCDIR:/netatalk.conf
# startup code for everything
atalk_startup() {
if [ x"${ATALKD_RUN}" != x"no" ]; then
- echo -n " Starting atalkd:"
- :SBINDIR:/atalkd
+ echo -n " Starting atalkd ... "
+ :SBINDIR:/atalkd ; my_ec=$?
- if [ -x :BINDIR:/nbprgstr ]; then
+ if [ -x :BINDIR:/nbprgstr -a "$my_ec" = "0" ]; then
+ echo -n ".. "
- :BINDIR:/nbprgstr -p 4 `hostname|sed 's/\..*$//'`:Workstation
+ :BINDIR:/nbprgstr -p 4 ${ATALK_NAME}:Workstation
+ echo -n ". "
- :BINDIR:/nbprgstr -p 4 `hostname|sed 's/\..*$//'`:netatalk
+ :BINDIR:/nbprgstr -p 4 ${ATALK_NAME}:netatalk
-
fi
+ if [ "$my_ec" != "0" ] ; then false ; fi
+ rc_status -v
+
+ rc_reset
if [ x"${PAPD_RUN}" = x"yes" -a -x :SBINDIR:/papd ]; then
- echo -n " Starting papd:"
+ echo -n " Starting papd"
:SBINDIR:/papd
+ rc_status -v
fi
+ rc_reset
+
if [ x"${TIMELORD_RUN}" = x"yes" -a -x :SBINDIR:/timelord ]; then
echo -n " Starting timelord"
:SBINDIR:/timelord
case "$1" in
start)
- if [ x"${ATALK_BGROUND}" = x"yes" ]; then
+ if test ! -z "$UID" -a "$UID" != 0 ; then
+ echo "you have to be root to start netatalk daemons"
+ rc_failed
+ else
- echo "Starting netatalk in the background ... "
+ if [ x"${ATALK_BGROUND}" = x"yes" -a x"${ATALKD_RUN}" != x"no" ]; then
+ echo -n "Starting netatalk in the background ..."
atalk_startup >& /dev/null &
+ rc_status -v
else
echo "Starting netatalk (this may take a while) ..."
atalk_startup