#!/bin/sh # # netatalk AppleTalk services # description: This package enables Linux to talk to Macintosh # computers via the AppleTalk networking protocol and # provides printer, file sharing, and AppleTalk routing # services. # # AppleTalk services. Make sure not to start atalkd in the background: # its data structures must have time to stablize before running the # other processes. # # chkconfig: - 91 35 # processname: atalkd # config: /etc/netatalk/netatalk.conf # pidfile: /var/run/atalkd.pid # Do not load RH compatibility interface. WITHOUT_RC_COMPAT=1 # Source function library. . /etc/init.d/functions RETVAL=0 # Source networking configuration. SourceIfNotEmpty /etc/sysconfig/network # Check that networking is up. [ $NETWORKING = "no" ] && exit 0 ATALK_CONF=/etc/netatalk/netatalk.conf # test for and read in netatalk configuration [ -f $ATALK_CONF ] || exit 0 . $ATALK_CONF ATALKD=/usr/sbin/atalkd AFPD=/usr/sbin/afpd PAPD=/usr/sbin/papd NBPREG=/usr/bin/nbprgstr NBPUNREG=/usr/bin/nbpunrgstr LOCKFILE=/var/lock/subsys/atalk # not sure about pidfile PIDFILE=/var/run/atalkd.pid [ -x $ATALKD -a -x $AFPD -a -x $PAPD -a -x $NBPREG -a -x $NBPUNREG ] || exit 0 # Quickly probe for appletalk and warn if we can't find it if [ ! -f /proc/net/appletalk ]; then /sbin/modprobe appletalk || echo "[could not load appletalk module]" fi start() { # merge atalk_startup() from atalk.init here start_daemon --pidfile "$PIDFILE" --lockfile "$LOCKFILE" --expect-user root -- atalkd RETVAL=$? return $RETVAL } stop() { stop_daemon --pidfile "$PIDFILE" --lockfile "$LOCKFILE" --expect-user root -- atalkd RETVAL=$? return $RETVAL } restart() { stop start } reload() { msg_reloading atalkd stop_daemon --pidfile "$PIDFILE" --expect-user root -HUP -- atalkd RETVAL=$? return $RETVAL } # See how we were called. case "$1" in start) start ;; stop) stop ;; reload) reload ;; restart) restart ;; condstop) if [ -e "$LOCKFILE" ]; then stop fi ;; condrestart) if [ -e "$LOCKFILE" ]; then restart fi ;; condreload) if [ -e "$LOCKFILE" ]; then reload fi ;; status) status --pidfile "$PIDFILE" --expect-user root -- atalkd RETVAL=$? ;; *) msg_usage "${0##*/} {start|stop|reload|restart|condstop|condrestart|condreload|status}" RETVAL=1 esac exit $RETVAL