Newsgroup: it.comp.os.linux.debian
Titolo: autofs non parte

Se provo a lanciare il servizio ottengo un laconico:
autofs 41 Syntax error "(" unexpected
a questa linea 41 vedo:
function start() {
...
}
non capisco dove possa essere l'errore.
-- 
                     Dona i tuoi cicli di clock alla ricerca!
 
http://boinc.berkeley.edu/
                          --------------------
"Io sono la madre di tutte le cose, e tutte le cose dovrebbero mettersi una
giacchetta di lana..."

 non capisco dove possa essere l'errore.
Potrebbe essere prima. Metti *tutto* lo script (e magari se dicessi
anche il linguaggio... ché *presumo* sia bash, ma chi ci dice che non
sia awk o altro??).
-- 
Massimo Bacilieri AKA Crononauta

 sia awk o altro??).
Qui a seguire lo script. Aggiungo che uso autofs sul portatile, che usa
uno script identico e lì non ho alcun problema, mah.
--8<---------------cut here---------------start------------->8---
#!/bin/bash
#
# rc file for automount using a Sun-style "master map".
#
# On most distributions, this file should be called:
# /etc/rc.d/init.d/autofs or /etc/init.d/autofs or /etc/rc.d/rc.autofs
#
#
### BEGIN INIT INFO
# Provides: autofs
# Required-Start: $network $remote_fs $syslog
# Required-Stop: $network $remote_fs $syslog
# Should-Start: ypbind nslcd
# Should-Stop: ypbind nslcd
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Automounts filesystems on demand
# Description: Automounts filesystems on demand
### END INIT INFO
#
# Location of the automount daemon and the init directory
#
DAEMON=/usr/sbin/automount
prog=`basename $DAEMON`
MODULE="autofs4"
DEVICE="autofs"
confdir=/etc/default
test -e $DAEMON || exit 0
PATH=/sbin:/usr/sbin:/bin:/usr/bin
export PATH
#
# load customized configuation settings
#
if [ -r $confdir/autofs ]; then
	. $confdir/autofs
fi
function start() {
	echo -n "Starting $prog: "
	# Make sure autofs4 module is loaded
	if ! grep -q autofs /proc/filesystems
	then
		# Try load the autofs4 module fail if we can't
		modprobe $MODULE >/dev/null 2>&1
		if [ $? -eq 1 ]
		then
			echo "Error: failed to load autofs4 module."
			return 1
		fi
	elif ([ -f /proc/modules ] && lsmod) | grep -q autofs[^4]
	then
		# wrong autofs filesystem module loaded
		echo
		echo "Error: autofs kernel module is loaded, autofs4 required"
		return 1
	fi
	# Check misc device
	if [ -n "$USE_MISC_DEVICE" -a "x$USE_MISC_DEVICE" = "xyes" ]; then
		sleep 1
		if [ -e "/proc/misc" ]; then
			MINOR=`awk "/$DEVICE/ {print \\$1}" /proc/misc`
			if [ -n "$MINOR" -a ! -c "/dev/$DEVICE" ]; then
				mknod -m 0600 /dev/$DEVICE c 10 $MINOR
			fi
		fi
		if [ -x /sbin/restorecon -a -c /dev/$DEVICE ]; then
			/sbin/restorecon /dev/$DEVICE
		fi
	else
		if [ -c /dev/$DEVICE ]; then
			rm /dev/$DEVICE
		fi
	fi
	start-stop-daemon --start --exec $DAEMON --oknodo -- $OPTIONS 
	RETVAL=$?
	if [ $RETVAL -eq 0 ] ; then
		echo "done."
	else
		echo "no valid automount entries defined."
	fi
	return 0
}
function stop() {
	echo -n $"Stopping $prog: "
	count=0
	while [ -n "`pidof $DAEMON`" -a $count -lt 15 ] ; do
		start-stop-daemon --stop --exec $DAEMON --oknodo
		[ -z "`pidof $DAEMON`" ] || sleep 3
		count=`expr $count + 1`
	done
	if [ -z "`pidof $DAEMON`" ] ; then
		RETVAL=0
		echo "done."
	else
		RETVAL=1
		echo "failed."
	fi
	return $RETVAL
}
function restart() {
	stop
	start
}
function reload() {
	pid=`pidof $DAEMON`
	if [ -z $pid ]; then
		echo $"$prog not running"
		RETVAL=1
	else
		kill -HUP $pid 2> /dev/null
		echo $"Reloading maps"
		RETVAL=0
	fi
	return $RETVAL
}
RETVAL=0
case "$1" in
	start)
		start
		;;
	forcestart)
		OPTIONS="$OPTIONS --force"
		start
		;;
	stop)
		stop
		;;
	restart|force-reload)
		restart
		;;
	forcerestart)
		OPTIONS="$OPTIONS --force"
		restart
		;;
	reload)
		reload
		;;
	*)
		echo $"Usage: $0 {start|forcestart|stop|restart|forcerestart|reload|force-reload}"
		exit 1;
		;;
esac
exit $?
--8<---------------cut here---------------end--------------->8---
-- 
                     Dona i tuoi cicli di clock alla ricerca!
 
http://boinc.berkeley.edu/
                          --------------------
           "Questa tragedia e' stata fatta in sei giorni".
           D'Alambert rispose:
           "L'autore non avrebbe dovuto riposare il settimo".

Cosa c'e' in "/etc/default/autofs"  ?
-- 
Stefano L.

 Cosa c'e' in "/etc/default/autofs"  ?
questo
--8<---------------cut here---------------start------------->8---
#
# Define default options for autofs.
#
# MASTER_MAP_NAME - default map name for the master map.
#
MASTER_MAP_NAME="/etc/auto.master"
#
# TIMEOUT - set the default mount timeout (default 600).
#
TIMEOUT=300
#
# NEGATIVE_TIMEOUT - set the default negative timeout for
# 		     failed mount attempts (default 60).
#
#NEGATIVE_TIMEOUT=60
#
# UMOUNT_WAIT - time to wait for a response from umount(8).
#
#UMOUNT_WAIT=12
#
# BROWSE_MODE - maps are browsable by default.
#
BROWSE_MODE="no"
#
# MOUNT_NFS_DEFAULT_PROTOCOL - specify the default protocol used by
# 			       mount.nfs(8). Since we can't identify
# 			       the default automatically we need to
# 			       set it in our configuration. This will
# 			       only make a difference for replicated
# 			       map entries as availability probing isn't
# 			       used for single host map entries.
#
#MOUNT_NFS_DEFAULT_PROTOCOL=3
#
# APPEND_OPTIONS - append to global options instead of replace.
#
#APPEND_OPTIONS="yes"
#
# LOGGING - set default log level "none", "verbose" or "debug"
#
#LOGGING="none"
#
# Define server URIs
#
# LDAP_URI - space seperated list of server uris of the form
# 	     <proto>://<server>[/] where <proto> can be ldap
# 	     or ldaps. The option can be given multiple times.
# 	     Map entries that include a server name override
# 	     this option.
#
#	     This configuration option can also be used to
#	     request autofs lookup SRV RRs for a domain of
#	     the form <proto>:///[<domain dn>]. Note that a
#	     trailing "/" is not allowed when using this form.
#	     If the domain dn is not specified the dns domain
#	     name (if any) is used to construct the domain dn
#	     for the SRV RR lookup. The server list returned
#	     from an SRV RR lookup is refreshed according to
#	     the minimum ttl found in the SRV RR records or
#	     after one hour, whichever is less.
#
#LDAP_URI=""
#
# LDAP__TIMEOUT - timeout value for the synchronous API  calls
#		  (default is LDAP library default).
#
#LDAP_TIMEOUT=-1
#
# LDAP_NETWORK_TIMEOUT - set the network response timeout (default 8).
#
#LDAP_NETWORK_TIMEOUT=8
#
# Define base dn for map dn lookup.
#
# SEARCH_BASE - base dn to use for searching for map search dn.
# 		Multiple entries can be given and they are checked
# 		in the order they occur here.
#
#SEARCH_BASE=""
#
# Define the LDAP schema to used for lookups
#
# If no schema is set autofs will check each of the schemas
# below in the order given to try and locate an appropriate
# basdn for lookups. If you want to minimize the number of
# queries to the server set the values here.
#
#MAP_OBJECT_CLASS="nisMap"
#ENTRY_OBJECT_CLASS="nisObject"
#MAP_ATTRIBUTE="nisMapName"
#ENTRY_ATTRIBUTE="cn"
#VALUE_ATTRIBUTE="nisMapEntry"
#
# Other common LDAP nameing
#
#MAP_OBJECT_CLASS="automountMap"
#ENTRY_OBJECT_CLASS="automount"
#MAP_ATTRIBUTE="ou"
#ENTRY_ATTRIBUTE="cn"
#VALUE_ATTRIBUTE="automountInformation"
#
#MAP_OBJECT_CLASS="automountMap"
#ENTRY_OBJECT_CLASS="automount"
#MAP_ATTRIBUTE="automountMapName"
#ENTRY_ATTRIBUTE="automountKey"
#VALUE_ATTRIBUTE="automountInformation"
#
# AUTH_CONF_FILE - set the default location for the SASL
#			   authentication configuration file.
#
#AUTH_CONF_FILE="/etc/autofs_ldap_auth.conf"
#
# MAP_HASH_TABLE_SIZE - set the map cache hash table size.
# 			Should be a power of 2 with a ratio roughly
# 			between 1:10 and 1:20 for each map.
#
#MAP_HASH_TABLE_SIZE=1024
#
# General global options
#
# If the kernel supports using the autofs miscellanous device
# and you wish to use it you must set this configuration option
# to "yes" otherwise it will not be used.
USE_MISC_DEVICE="yes"
#
#OPTIONS=""
#
--8<---------------cut here---------------end--------------->8---
-- 
                     Dona i tuoi cicli di clock alla ricerca!
 
http://boinc.berkeley.edu/
                          --------------------
              1.  - Io sono ragioniere.
              2.  - Io sono perito.
              1.  - Azz...  pensavo tu fossi ancora vivo.

 non capisco dove possa essere l'errore.
A me sembra un problema dell'interprete.
Sei sicuro di aver bash installato e funzionante?

 Sei sicuro di aver bash installato e funzionante?
Beh, sì, se levo bash vien via mezzo sistema...
-- 
            Viva viva la galera che ti fa bel rozzo e nero
            viva viva la galera che non ti fa mancar la pera
            verso sera
            		-- Enzo Jannacci e Beppe Viola, "Quelli che"