]> arthur.barton.de Git - netatalk.git/blobdiff - distrib/initscripts/rc.atalk.redhat.tmpl
Output of service atalk status was wrong
[netatalk.git] / distrib / initscripts / rc.atalk.redhat.tmpl
index 873391ee6555bff9d1b5a88fb371706c0ee761b8..66d8197178f6b8d0d84e5434f4396b3d7d8ba488 100644 (file)
@@ -1,11 +1,11 @@
 #! /bin/sh
-# chkconfig: 345 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.   
+# chkconfig: - 91 35
+# 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,26 +19,34 @@ ATALK_SBIN=:SBINDIR:
 # Source networking configuration.
 . /etc/sysconfig/network
 
-# Quickly probe for appletalk and warn if we can't find it
-/sbin/modprobe appletalk || echo "[could not load appletalk module]"
+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
 
-# Check for IP Encapsulation support
-#/sbin/modprobe ipddp || echo "[could not load IP encapsulation]"
-
-test -x ${ATALK_SBIN}/atalkd || exit 0
-
-test -f ${ATALK_CONF_DIR}/netatalk.conf || exit 0
+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.
-[ ${NETWORKING} = "no" ] && exit 0
+if [ ${NETWORKING} = "no" ]; then
+     echo "[Network isn't started]"; 
+     exit 0;
+fi
 
 # initialize return values
 RETVAL=1
 RETVAL_ATALKD=0
 RETVAL_PAPD=0
+RETVAL_CNID_METAD=0
 RETVAL_AFPD=0
 
 # startup code for everything
@@ -75,6 +83,27 @@ atalk_startup() {
            echo
        fi
 
+       # check for a2boot in bin directory
+       if [ x"${A2BOOT_RUN}" = x"yes"  -a -x ${ATALK_BIN}/a2boot ]; then
+           echo -n "  Starting a2boot"
+           daemon ${ATALK_BIN}/a2boot
+           echo
+       fi
+
+       # check for a2boot in sbin directory
+       if [ x"${A2BOOT_RUN}" = x"yes"  -a -x ${ATALK_SBIN}/a2boot ]; then
+           echo -n "  Starting a2boot"
+           daemon ${ATALK_SBIN}/a2boot
+           echo
+       fi
+
+    fi
+
+    if [ x"${CNID_METAD_RUN}" = x"yes" -a -x ${ATALK_SBIN}/cnid_metad ] ; then
+           echo -n "  Starting cnid_metad:"
+        daemon ${ATALK_SBIN}/cnid_metad $CNID_CONFIG
+           RETVAL_CNID_METAD=$?
+           echo
     fi
 
     if [ x"${AFPD_RUN}" = x"yes" -a -x ${ATALK_SBIN}/afpd ] ; then
@@ -85,7 +114,7 @@ atalk_startup() {
            echo
     fi
 
-    if [ $RETVAL_ATALKD -eq 0 -a $RETVAL_PAPD -eq 0 -a $RETVAL_AFPD -eq 0 ]; then
+    if [ $RETVAL_ATALKD -eq 0 -a $RETVAL_PAPD -eq 0 -a $RETVAL_CNID_METAD -eq 0 -a $RETVAL_AFPD -eq 0 ]; then
         RETVAL=0
        touch /var/lock/subsys/atalk || RETVAL=1
     fi
@@ -93,7 +122,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 &
@@ -104,7 +133,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:"
@@ -127,6 +156,20 @@ case "$1" in
                echo
            fi
 
+            # checking for a2boot in bin directory
+           if [ x"${A2BOOT_RUN}" = x"yes" -a -x ${ATALK_BIN}/a2boot ]; then
+               echo -n "  Stopping a2boot:"
+               killproc a2boot
+               echo
+           fi
+
+            # checking for a2boot in sbin directory
+           if [ x"${A2BOOT_RUN}" = x"yes" -a -x ${ATALK_SBIN}/a2boot ]; then
+               echo -n "  Stopping a2boot:"
+               killproc a2boot
+               echo
+           fi
+
            action "  Unregistering ${ATALK_NAME}:Workstation${ATALK_ZONE}:" ${ATALK_BIN}/nbpunrgstr \"${ATALK_NAME}:Workstation${ATALK_ZONE}\"
            action "  Unregistering ${ATALK_NAME}:netatalk${ATALK_ZONE}:" ${ATALK_BIN}/nbpunrgstr \"${ATALK_NAME}:netatalk${ATALK_ZONE}\"
 
@@ -147,6 +190,13 @@ case "$1" in
            echo
        fi
 
+       if [ x"${CNID_METAD_RUN}" = x"yes" -a -x ${ATALK_SBIN}/cnid_metad ]; then
+           echo -n "  Stopping cnid_metad:"
+           killproc cnid_metad
+           RETVAL_CNID_METAD=$?
+           echo
+       fi
+
        if [ $RETVAL_ATALKD -eq 0 -a $RETVAL_PAPD -eq 0 -a $RETVAL_AFPD -eq 0 ] ; then
            RETVAL=0
            rm -f /var/lock/subsys/atalk || RETVAL=1
@@ -160,6 +210,11 @@ case "$1" in
        ;;
   'status')
        status atalkd
+    status papd
+    status timelord
+    status a2boot
+    status cnid_metad
+    status afpd
        RETVAL=$?
        ;;
   *)