]> arthur.barton.de Git - netatalk.git/blobdiff - distrib/initscripts/rc.atalk.redhat.tmpl
suse initscript: merge from netatalk-2.1.5-200603231979.2.src.rpm
[netatalk.git] / distrib / initscripts / rc.atalk.redhat.tmpl
index a6cfeea5759a54cfe96cebb9970815270d4da6dc..dfeed4cae5150eb2a2104fb797b5a1c0a331cc1a 100644 (file)
@@ -1,11 +1,11 @@
 #! /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.
 
@@ -19,27 +19,9 @@ ATALK_SBIN=:SBINDIR:
 # 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
-
 # 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
@@ -51,6 +33,26 @@ RETVAL_AFPD=0
 
 # startup code for everything
 atalk_startup() {
+    # Check that networking is up.
+    if [ ${NETWORKING} = "no" ]; then
+         echo "[Network isn't started]"; 
+         exit 1;
+    fi
+
+    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. Check for permissions]";
+         exit 4;
+    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" ]; then 
        echo -n "  Starting atalkd:"
        daemon ${ATALK_SBIN}/atalkd
@@ -122,7 +124,7 @@ atalk_startup() {
 
 case "$1" in
 'start')
-       echo -n 'Starting AppleTalk services: '
+       echo -n 'Starting Netatalk services: '
        if [ x"${ATALK_BGROUND}" = x"yes" ]; then 
            echo -n "(backgrounded)"
            atalk_startup >& /dev/null &
@@ -133,7 +135,7 @@ case "$1" in
        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:"
@@ -210,11 +212,16 @@ case "$1" in
        ;;
   '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