X-Git-Url: https://arthur.barton.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=distrib%2Finitscripts%2Frc.atalk.debian.tmpl;h=ac5d8da0ac6337ef81b0805a8cea0530ca3abd25;hb=0a4aa3e38163c846905221edac32651867a68474;hp=e408819c4039709e4c0ee80b1229ce46b7c87dad;hpb=f483d27d5249bd052cb7e34f92fd3a94735c343c;p=netatalk.git diff --git a/distrib/initscripts/rc.atalk.debian.tmpl b/distrib/initscripts/rc.atalk.debian.tmpl index e408819c..ac5d8da0 100644 --- a/distrib/initscripts/rc.atalk.debian.tmpl +++ b/distrib/initscripts/rc.atalk.debian.tmpl @@ -1,32 +1,60 @@ #!/bin/sh +### BEGIN INIT INFO +# Provides: netatalk +# Required-Start: $remote_fs $syslog +# Required-Stop: $remote_fs $syslog +# Default-Start: 2 3 4 5 +# Default-Stop: 1 +### END INIT INFO # -# atalk Netatalk 2.x initscript -# +# netatalk Netatalk :NETATALK_VERSION: initscript # Author: Thomas Kaiser -# -# Version: $Id: rc.atalk.debian.tmpl,v 1.4 2009-04-30 10:48:38 franklahm Exp $ set -e PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin DESC="Netatalk" -NAME=atalk +NAME=netatalk SCRIPTNAME=/etc/init.d/$NAME # Guard to prevent execution if netatalk was removed. -test -x :SBINDIR:/atalkd || exit 0 +test -x :SBINDIR:/afpd || exit 0 + +# Set defaults. Please change these options in /etc/default/netatalk +ATALK_NAME=`/bin/hostname --short` +ATALK_UNIX_CHARSET='LOCALE' +ATALK_MAC_CHARSET='MAC_ROMAN' + +CNID_METAD_RUN=yes +AFPD_RUN=yes +AFPD_MAX_CLIENTS=50 +AFPD_UAMLIST="-U 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 + +# old /etc/default/netatalk expected hostname in $HOSTNAME by default +HOSTNAME=`/bin/hostname` # Read in netatalk configuration. -if [ -f :ETCDIR:/netatalk.conf ]; then - . :ETCDIR:/netatalk.conf +if [ -f /etc/default/netatalk ]; then + . /etc/default/netatalk fi # Start Netatalk servers. atalk_startup() { if [ x"$ATALKD_RUN" = x"yes" ]; then - # Try to load the AppleTalk kernel module - /sbin/modprobe appletalk || echo "[could not load appletalk module]" + # Try to load the AppleTalk kernel module if it was intended. + if grep -q '^appletalk$' /etc/modules; then + /sbin/modprobe appletalk || echo "[could not load appletalk module]" + fi # Start atalkd server. :SBINDIR:/atalkd @@ -39,10 +67,10 @@ atalk_startup() { fi # prepare startup of file services - if [ x"${CNID_METAD_RUN}" = x"yes" -a -x :SBINDIR:/cnid_metad ] ; then + if [ "x$CNID_METAD_RUN" = "xyes" -a -x :SBINDIR:/cnid_metad ] ; then echo -n " cnid_metad" - :SBINDIR:/cnid_metad "$CNID_DBD_LOGCONFIG" - fi + :SBINDIR:/cnid_metad $CNID_CONFIG + fi if [ x"$AFPD_RUN" = x"yes" ]; then :SBINDIR:/afpd $AFPD_UAMLIST -g $AFPD_GUEST -c $AFPD_MAX_CLIENTS \ @@ -50,20 +78,22 @@ atalk_startup() { echo -n " afpd" fi - if [ x"$ATALKD_RUN" = x"yes" -a x"$PAPD_RUN" = x"yes" ]; then - :SBINDIR:/papd - echo -n " papd" - fi - - if [ x"$TIMELORD_RUN" = x"yes" ]; then - :SBINDIR:/timelord - echo -n " timelord" - fi + if [ "x$ATALKD_RUN" = "xyes" ]; then + if [ "x$PAPD_RUN" = "xyes" ]; then + :SBINDIR:/papd + echo -n " papd" + fi + + if [ x"$TIMELORD_RUN" = x"yes" ]; then + :SBINDIR:/timelord + echo -n " timelord" + fi + fi } case "$1" in start) - if test x"${ATALK_BGROUND}" = x"yes"; then + if [ "x$ATALK_BGROUND" = "xyes" -a "x$ATALKD_RUN" = "xyes" ]; then echo "Starting Netatalk services in the background." atalk_startup >/dev/null & else @@ -81,16 +111,20 @@ case "$1" in echo -n " cnid_metad" start-stop-daemon --stop --quiet --oknodo --exec :SBINDIR:/cnid_metad - echo -n " papd" - start-stop-daemon --stop --quiet --oknodo --exec :SBINDIR:/papd + if test -x :SBINDIR:/papd; then + echo -n " papd" + start-stop-daemon --stop --quiet --oknodo --exec :SBINDIR:/papd + fi if test -x :SBINDIR:/timelord; then echo -n " timelord" start-stop-daemon --stop --quiet --oknodo --exec :SBINDIR:/timelord fi - echo -n " atalkd" - start-stop-daemon --stop --quiet --oknodo --exec :SBINDIR:/atalkd + if test -x :SBINDIR:/atalkd; then + echo -n " atalkd" + start-stop-daemon --stop --quiet --oknodo --exec :SBINDIR:/atalkd + fi echo "." ;;