From: HAT Date: Sat, 8 Jan 2011 17:25:09 +0000 (+0900) Subject: maintenance of initscripts and netatalk.conf. X-Git-Url: https://arthur.barton.de/cgi-bin/gitweb.cgi?p=netatalk.git;a=commitdiff_plain;h=7f9fdfa28c00b0d5fa37f81af35fd0a8110dcbdf maintenance of initscripts and netatalk.conf. ATALK_BGROUND is not important any longer. Ubuntu's ATALK_NAME was empty. --- diff --git a/config/netatalk.conf b/config/netatalk.conf index f1fa38dd..b8c1e67b 100644 --- a/config/netatalk.conf +++ b/config/netatalk.conf @@ -4,57 +4,57 @@ # Global configuration ######################################################################### -# machine's AFPserver/AppleTalk name. -ATALK_NAME=`echo ${HOSTNAME}|cut -d. -f1` +#### machine's AFPserver/AppleTalk name. +#ATALK_NAME=machinename -# server (unix) and legacy client (<= Mac OS 9) charsets +#### server (unix) and legacy client (<= Mac OS 9) charsets ATALK_UNIX_CHARSET='LOCALE' ATALK_MAC_CHARSET='MAC_ROMAN' -# Don't Edit. export the charsets, read form ENV by apps +#### Don't Edit. export the charsets, read form ENV by apps export ATALK_UNIX_CHARSET export ATALK_MAC_CHARSET -# Control whether the daemons are started in the background. -# If it is dissatisfied that legacy atalkd starts slowly, set "yes". -ATALK_BGROUND=no - ######################################################################### # AFP specific configuration ######################################################################### -# Set which daemons to run. -# If you use AFP file server, run both cnid_metad and afpd. +#### Set which daemons to run. +#### If you use AFP file server, run both cnid_metad and afpd. CNID_METAD_RUN=yes AFPD_RUN=yes -# maximum number of clients that can connect: -AFPD_MAX_CLIENTS=20 +#### maximum number of clients that can connect: +#AFPD_MAX_CLIENTS=20 -# UAMs (User Authentication Modules) -# available options: uams_dhx.so, uams_dhx2.so, uams_guest.so, -# uams_clrtxt.so(legacy), uams_randnum.so(legacy) -# AFPD_UAMLIST="-U uams_dhx.so,uams_dhx2.so" +#### UAMs (User Authentication Modules) +#### available options: uams_dhx.so, uams_dhx2.so, uams_guest.so, +#### uams_clrtxt.so(legacy), uams_randnum.so(legacy) +#AFPD_UAMLIST="-U uams_dhx.so,uams_dhx2.so" -# Set the id of the guest user when using uams_guest.so -AFPD_GUEST=nobody +#### Set the id of the guest user when using uams_guest.so +#AFPD_GUEST=nobody -# config for cnid_metad. Default log config: -# CNID_CONFIG="-l log_note" +#### config for cnid_metad. Default log config: +#CNID_CONFIG="-l log_note" ######################################################################### # AppleTalk specific configuration (legacy) ######################################################################### -# Set which legacy daemons to run. -# If you need AppleTalk, run atalkd. -# papd, timelord and a2boot are dependent upon atalkd. -ATALKD_RUN=no -PAPD_RUN=no -TIMELORD_RUN=no -A2BOOT_RUN=no - -# Set the AppleTalk Zone name. -# NOTE: if your zone has spaces in it, you're better off specifying -# it in afpd.conf +#### Set which legacy daemons to run. +#### If you need AppleTalk, run atalkd. +#### papd, timelord and a2boot are dependent upon atalkd. +#ATALKD_RUN=no +#PAPD_RUN=no +#TIMELORD_RUN=no +#A2BOOT_RUN=no + +#### Control whether the daemons are started in the background. +#### If it is dissatisfied that legacy atalkd starts slowly, set "yes". +#ATALK_BGROUND=no + +#### Set the AppleTalk Zone name. +#### NOTE: if your zone has spaces in it, you're better off specifying +#### it in afpd.conf #ATALK_ZONE=@zone diff --git a/distrib/initscripts/rc.atalk.bsd.tmpl b/distrib/initscripts/rc.atalk.bsd.tmpl index 05010b7b..6a0f489a 100755 --- a/distrib/initscripts/rc.atalk.bsd.tmpl +++ b/distrib/initscripts/rc.atalk.bsd.tmpl @@ -15,6 +15,24 @@ ## /usr/etc/modload -sym :ETCDIR:/netatalk.o; ##fi +ATALK_NAME=`hostname|sed 's/\..*$//'` +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 + netatalk_conf=":ETCDIR:/netatalk.conf" [ -f ${netatalk_conf} ] && . ${netatalk_conf} @@ -26,8 +44,8 @@ if [ -x :SBINDIR:/atalkd ]; then fi if [ -x :BINDIR:/nbprgstr ]; then - :BINDIR:/nbprgstr -p 4 `hostname|sed 's/\..*$//'`:Workstation - :BINDIR:/nbprgstr -p 4 `hostname|sed 's/\..*$//'`:netatalk + :BINDIR:/nbprgstr -p 4 ${ATALK_NAME}:Workstation + :BINDIR:/nbprgstr -p 4 ${ATALK_NAME}:netatalk echo -n ' nbprgstr' fi fi @@ -37,12 +55,14 @@ if [ -x :SBINDIR:/papd -a X"${PAPD_RUN}" != X"no" ]; then fi if [ -x :SBINDIR:/cnid_metad -a X"${CNID_METAD_RUN}" != X"no" ]; then - :SBINDIR:/cnid_metad $CNID_CONFIG - echo -n ' cnid_metad' + :SBINDIR:/cnid_metad $CNID_CONFIG + echo -n ' cnid_metad' fi if [ -x :SBINDIR:/afpd -a X"${AFPD_RUN}" != X"no" ]; then - :SBINDIR:/afpd; echo -n ' afpd' + :SBINDIR:/afpd ${AFPD_UAMLIST} -g ${AFPD_GUEST} \ + -c ${AFPD_MAX_CLIENTS} -n ${ATALK_NAME}${ATALK_ZONE} + echo -n ' afpd' fi if [ -x :SBINDIR:/timelord -a X"${TIMELORD_RUN}" != X"no" ]; then diff --git a/distrib/initscripts/rc.atalk.debian.tmpl b/distrib/initscripts/rc.atalk.debian.tmpl index 6f5d9f0b..e3e7f568 100644 --- a/distrib/initscripts/rc.atalk.debian.tmpl +++ b/distrib/initscripts/rc.atalk.debian.tmpl @@ -9,7 +9,6 @@ # # netatalk Netatalk 2.x initscript # Author: Thomas Kaiser -# Version: $Id: rc.atalk.debian.tmpl,v 1.6 2009-06-09 11:58:49 franklahm Exp $ set -e @@ -22,15 +21,24 @@ SCRIPTNAME=/etc/init.d/$NAME 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 -AFPD_MAX_CLIENTS=50 ATALK_ZONE= -ATALK_NAME=`/bin/hostname --short` +CNID_CONFIG="-l log_note" + +ATALKD_RUN=no +PAPD_RUN=no +TIMELORD_RUN=no +#A2BOOT_RUN=no +ATALK_ZONE= ATALK_BGROUND=no -CNID_METAD_RUN=yes -ATALK_MAC_CHARSET='MAC_ROMAN' -ATALK_UNIX_CHARSET='LOCALE' # Read in netatalk configuration. if [ -f /etc/default/netatalk ]; then @@ -43,7 +51,7 @@ atalk_startup() { # 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]" + /sbin/modprobe appletalk || echo "[could not load appletalk module]" fi # Start atalkd server. @@ -83,7 +91,7 @@ atalk_startup() { case "$1" in start) - if test "x$ATALK_BGROUND" = "xyes"; then + if [ "x$ATALK_BGROUND" = "xyes" -a "x$ATALKD_RUN" = "xyes" ]; then echo "Starting Netatalk services in the background." atalk_startup >/dev/null & else diff --git a/distrib/initscripts/rc.atalk.gentoo.tmpl b/distrib/initscripts/rc.atalk.gentoo.tmpl index c75ed74b..206e01ca 100644 --- a/distrib/initscripts/rc.atalk.gentoo.tmpl +++ b/distrib/initscripts/rc.atalk.gentoo.tmpl @@ -5,6 +5,24 @@ # its data structures must have time to stablize before running the # other processes. +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 + depend() { need net use logger dns @@ -60,7 +78,7 @@ atalk_startup () { start () { . :ETCDIR:/netatalk.conf - if [ x"${ATALK_BGROUND}" = x"yes" ]; then + if [ x"${ATALK_BGROUND}" = x"yes" -a "${ATALKD_RUN}" != "no" ]; then echo "Starting netatalk in the background ... " atalk_startup >& /dev/null & else diff --git a/distrib/initscripts/rc.atalk.redhat.tmpl b/distrib/initscripts/rc.atalk.redhat.tmpl index bdcd9f0f..79b613bd 100644 --- a/distrib/initscripts/rc.atalk.redhat.tmpl +++ b/distrib/initscripts/rc.atalk.redhat.tmpl @@ -19,6 +19,25 @@ ATALK_SBIN=:SBINDIR: # Source networking configuration. . /etc/sysconfig/network +# 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 if [ -f ${ATALK_CONF_DIR}/netatalk.conf ]; then . ${ATALK_CONF_DIR}/netatalk.conf @@ -120,7 +139,7 @@ atalk_startup() { case "$1" in 'start') echo -n 'Starting Netatalk services: ' - if [ x"${ATALK_BGROUND}" = x"yes" ]; then + if [ x"${ATALK_BGROUND}" = x"yes" -a x"${ATALKD_RUN}" != x"no" ]; then echo -n "(backgrounded)" atalk_startup >& /dev/null & else diff --git a/distrib/initscripts/rc.atalk.suse.tmpl b/distrib/initscripts/rc.atalk.suse.tmpl index c9a0bec3..886591bc 100755 --- a/distrib/initscripts/rc.atalk.suse.tmpl +++ b/distrib/initscripts/rc.atalk.suse.tmpl @@ -30,6 +30,25 @@ test -f /etc/rc.status && . /etc/rc.status return=$rc_done } +ATALK_NAME=`hostname|sed 's/\..*$//'` +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 + + . :ETCDIR:/netatalk.conf # startup code for everything @@ -39,8 +58,8 @@ atalk_startup() { :SBINDIR:/atalkd if [ -x :BINDIR:/nbprgstr ]; then - :BINDIR:/nbprgstr -p 4 `hostname|sed 's/\..*$//'`:Workstation - :BINDIR:/nbprgstr -p 4 `hostname|sed 's/\..*$//'`:netatalk + :BINDIR:/nbprgstr -p 4 ${ATALK_NAME}:Workstation + :BINDIR:/nbprgstr -p 4 ${ATALK_NAME}:netatalk fi @@ -74,7 +93,7 @@ atalk_startup() { case "$1" in start) - if [ x"${ATALK_BGROUND}" = x"yes" ]; then + if [ x"${ATALK_BGROUND}" = x"yes" -a x"${ATALKD_RUN}" != x"no" ]; then echo "Starting netatalk in the background ... " atalk_startup >& /dev/null & else diff --git a/distrib/initscripts/rc.atalk.sysv.tmpl b/distrib/initscripts/rc.atalk.sysv.tmpl index f21c7ec9..a4b9a69e 100755 --- a/distrib/initscripts/rc.atalk.sysv.tmpl +++ b/distrib/initscripts/rc.atalk.sysv.tmpl @@ -18,8 +18,24 @@ killproc() { [ "$pid" != "" ] && kill $pid } -# netatalk.conf expects hostname in $HOSTNAME by default -HOSTNAME=`hostname` +# default +ATALK_NAME=`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 . :ETCDIR:/netatalk.conf @@ -67,7 +83,7 @@ atalk_startup() { case "$1" in 'start') - if [ x"${ATALK_BGROUND}" = x"yes" ]; then + if [ x"${ATALK_BGROUND}" = x"yes" -a x"${ATALKD_RUN}" != x"no" ]; then echo "Starting netatalk in the background ... " atalk_startup > /dev/null & else