I see this bug in Ubuntu 16.04.1 LTS with autofs version 5.1.1-1ubuntu3 when I try to access cifs shares from my NAS.
When I try to access the shares with 'cd' or 'ls' after boot with network on both sides up and running I got the error message: "File or Directory not found." After running `sudo systemctl restart autofs.service` it works like a charme.
Here is my '''/etc/auto.master.d/diskstation.autofs''':
~~~
/home/tronde/diskstation /etc/auto.diskstation
~~~
And my '''/etc/auto.diskstation''':
~~~
music -fstype=cifs,uid=1000,credentials=/home/tronde/.smbcredentials ://IP-ADRESSE/music
photo -fstype=cifs,uid=1000,credentials=/home/tronde/.smbcredentials ://IP-ADRESSE/photo
share -fstype=cifs,uid=1000,credentials=/home/tronde/.smbcredentials ://IP-ADRESSE/share
video -fstype=cifs,uid=1000,credentials=/home/tronde/.smbcredentials ://IP-ADRESSE/video
home -fstype=cifs,uid=1000,gid=1000,credentials=/home/tronde/.smbcredentials ://IP-ADRESSE/home
~~~
The service configuration looks like:
~~~
cat /run/systemd/generator.late/graphical.target.wants/autofs.service
# Automatically generated by systemd-sysv-generator
Good evening,
I see this bug in Ubuntu 16.04.1 LTS with autofs version 5.1.1-1ubuntu3 when I try to access cifs shares from my NAS.
When I try to access the shares with 'cd' or 'ls' after boot with network on both sides up and running I got the error message: "File or Directory not found." After running `sudo systemctl restart autofs.service` it works like a charme.
Here is my '''/etc/ auto.master. d/diskstation. autofs' '': diskstation /etc/auto. diskstation
~~~
/home/tronde/
~~~
And my '''/etc/ auto.diskstatio n''': cifs,uid= 1000,credential s=/home/ tronde/ .smbcredentials ://IP-ADRESSE/music cifs,uid= 1000,credential s=/home/ tronde/ .smbcredentials ://IP-ADRESSE/photo cifs,uid= 1000,credential s=/home/ tronde/ .smbcredentials ://IP-ADRESSE/share cifs,uid= 1000,credential s=/home/ tronde/ .smbcredentials ://IP-ADRESSE/video cifs,uid= 1000,gid= 1000,credential s=/home/ tronde/ .smbcredentials ://IP-ADRESSE/home
~~~
music -fstype=
photo -fstype=
share -fstype=
video -fstype=
home -fstype=
~~~
The service configuration looks like: generator. late/graphical. target. wants/autofs. service sysv-generator
~~~
cat /run/systemd/
# Automatically generated by systemd-
[Unit] man:systemd- sysv-generator( 8) /etc/init. d/autofs multi-user. target multi-user. target multi-user. target graphical. target shutdown. target online. target fs.target journald- dev-log. socket service online. target shutdown. target
Documentation=
SourcePath=
Description=LSB: Automounts filesystems on demand
Before=
Before=
Before=
Before=
Before=
After=network-
After=remote-
After=systemd-
After=ypbind.
After=nslcd.service
After=slapd.service
Wants=network-
Conflicts=
[Service] /etc/init. d/autofs start /etc/init. d/autofs stop /etc/init. d/autofs reload
Type=forking
Restart=no
TimeoutSec=5min
IgnoreSIGPIPE=no
KillMode=process
GuessMainPID=no
RemainAfterExit=yes
ExecStart=
ExecStop=
ExecReload=
~~~
The source of this configuration from '''/etc/ init.d/ autofs' '':
~~~
cat /etc/init.d/autofs
#! /bin/sh
#
### BEGIN INIT INFO
# Provides: autofs
# Required-Start: $network $remote_fs $syslog
# Required-Stop: $network $remote_fs $syslog
# Should-Start: ypbind nslcd slapd
# Should-Stop: ypbind nslcd slapd
# 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 /usr/sbin/ $PROG "/var/run/ $NAME.pid"
#
PROG=automount
DAEMON=
NAME=autofs
PIDFILE=
test -e $DAEMON || exit 0
PATH=/sbin: /usr/sbin: /bin:/usr/ bin
export PATH
. /lib/lsb/ init-functions
#
# load customized configuation settings
#
if [ -r /etc/default/autofs ]; then
. /etc/default/autofs
fi
start_stop_autofs() {
start-stop-daemon "$@" --pidfile $PIDFILE --exec $DAEMON -- \
$OPTIONS --pid-file $PIDFILE
}
start() { begin_msg "Starting $PROG"
log_action_
if ! grep -qw autofs /proc/filesystems action_ end_msg 1 "failed to load autofs4 module" end_msg 1 "autofs kernel module is loaded, autofs4 required"
then
if ! modprobe autofs4 >/dev/null 2>&1
then
log_
return 1
fi
elif [ -f /proc/modules ] && grep -q "^autofs[^4]" /proc/modules
then
log_action_
return 1
fi
if ! start_stop_autofs --start --oknodo --quiet ; then end_msg 1 "no valid automount entries defined."
log_action_
return 1
fi
log_end_msg 0
return 0
}
stop() { begin_msg "Stopping $PROG" end_msg 1
log_action_
if ! start_stop_autofs --stop --retry 5 --oknodo --quiet ; then
log_action_
return 1
fi
log_end_msg 0
return 0
}
reload() { begin_msg "Reloading $PROG maps" end_msg 1 "$PROG not running"
log_action_
if ! start_stop_autofs --stop --signal=HUP --quiet
then
log_action_
return 1
fi
log_action_end_msg 0
return 0
}
forcestart() {
OPTIONS="$OPTIONS --force"
start
}
case "$1" in forcestart| stop|reload) force-reload) forcestart| stop|restart| forcerestart| reload| force-reload| status} "
start|
$1
;;
restart|
stop
start
;;
forcerestart)
stop
forcestart
;;
status)
status_of_proc -p $PIDFILE $DAEMON $PROG
;;
*)
echo "Usage: $0 {start|
exit 1
;;
esac
~~~
This way autofs has no advantage over the manual mount with mount.cifs. Open this bug and fix ist, please.
Best regards,
Tronde