#! /bin/sh
# chkconfig: - 91 35
-# description: This package enables Linux to talk to Macintosh
-# computers via the AppleTalk networking protocol and
-# provides printer, file sharing, and AppleTalk routing
-# services.
+# description: This package is an implementation of "AFP over TCP"
+# and provides printer, file sharing, and routing
+# services via legacy AppleTalk networking protocol.
#
-# AppleTalk daemons. Make sure not to start atalkd in the background:
+# Netatalk daemons.
+# If you use AppleTalk, Make sure not to start atalkd in the background:
# its data structures must have time to stablize before running the
# other processes.
# Source networking configuration.
. /etc/sysconfig/network
-if [ ! -x ${ATALK_SBIN}/atalkd ]; then
- # Quickly probe for appletalk and warn if we can't find it
- #/sbin/modprobe appletalk || echo "[could not load appletalk module]"
- # Check for IP Encapsulation support
- #/sbin/modprobe ipddp || echo "[could not load IP encapsulation]"
- echo "[${ATALK_SBIN}/atalkd not found. Did it compile?]";
- exit 0;
-fi
-
-if [ ! -f ${ATALK_CONF_DIR}/netatalk.conf ]; then
- echo "[${ATALK_CONF_DIR}/netatalk.conf not found]";
- exit 0;
-fi
+# default
+ATALK_NAME=`echo ${HOSTNAME}|cut -d. -f1`
+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
# read in netatalk configuration
-. ${ATALK_CONF_DIR}/netatalk.conf
-
-# Check that networking is up.
-if [ ${NETWORKING} = "no" ]; then
- echo "[Network isn't started]";
- exit 0;
+if [ -f ${ATALK_CONF_DIR}/netatalk.conf ]; then
+ . ${ATALK_CONF_DIR}/netatalk.conf
fi
# initialize return values
# startup code for everything
atalk_startup() {
- if [ x"${ATALKD_RUN}" != x"no" ]; then
+ # Check that networking is up.
+ if [ ${NETWORKING} = "no" ]; then
+ echo "[Network isn't started]";
+ exit 1;
+ fi
+
+ if [ ! -f ${ATALK_CONF_DIR}/netatalk.conf ]; then
+ echo "[${ATALK_CONF_DIR}/netatalk.conf not found]";
+ exit 6;
+ fi
+
+ if [ x"${ATALKD_RUN}" != x"no" -a -x ${ATALK_SBIN}/atalkd ]; then
+ # Quickly probe for appletalk and warn if we can't find it
+ #/sbin/modprobe appletalk || echo "[could not load appletalk module]"
+ # Check for IP Encapsulation support
+ #/sbin/modprobe ipddp || echo "[could not load IP encapsulation]"
echo -n " Starting atalkd:"
daemon ${ATALK_SBIN}/atalkd
RETVAL_ATALKD=$?
case "$1" in
'start')
- echo -n 'Starting AppleTalk services: '
- if [ x"${ATALK_BGROUND}" = x"yes" ]; then
+ echo -n 'Starting Netatalk services: '
+ if [ x"${ATALK_BGROUND}" = x"yes" -a x"${ATALKD_RUN}" != x"no" ]; then
echo -n "(backgrounded)"
atalk_startup >& /dev/null &
else
echo
;;
'stop')
- echo 'Shutting down AppleTalk services: '
+ echo 'Shutting down Netatalk services: '
if [ x"${ATALKD_RUN}" != x"no" ]; then
if [ x"${PAPD_RUN}" = x"yes" -a -x ${ATALK_SBIN}/papd ]; then
echo -n " Stopping papd:"
;;
'status')
status atalkd
+ status papd
+ status timelord
+ status a2boot
+ status cnid_metad
+ status afpd
RETVAL=$?
;;
*)
- echo "Usage: atalk {start|stop|restart|status}"
- exit 1
+ echo "Usage: $0 {start|stop|restart|reload|status}"
+ exit 2
esac
exit $RETVAL