Bon, je mets ici mon rc0.d, mes deux scripts et un log de tout ca en espérant que ca puisse aider quelqu’un (à m’aider )
Mon /etc/rc0.d:
lrwxrwxrwx 1 root root 13 févr. 9 17:08 K01atd -> ../init.d/atd
lrwxrwxrwx 1 root root 22 mars 2 11:51 K01avahi-daemon -> ../init.d/avahi-daemon
lrwxrwxrwx 1 root root 22 févr. 9 17:36 K01cups-browsed -> ../init.d/cups-browsed
lrwxrwxrwx 1 root root 18 févr. 26 17:06 K01ebtables -> ../init.d/ebtables
lrwxrwxrwx 1 root root 15 févr. 9 17:08 K01exim4 -> ../init.d/exim4
lrwxrwxrwx 1 root root 17 févr. 9 17:37 K01hddtemp -> ../init.d/hddtemp
lrwxrwxrwx 1 root root 20 févr. 9 17:18 K01irqbalance -> ../init.d/irqbalance
lrwxrwxrwx 1 root root 24 févr. 26 17:06 K01libvirt-guests -> ../init.d/libvirt-guests
lrwxrwxrwx 1 root root 17 févr. 9 17:37 K01lightdm -> ../init.d/lightdm
lrwxrwxrwx 1 root root 19 mars 2 11:51 K01mountcifs -> ../init.d/mountcifs
lrwxrwxrwx 1 root root 25 févr. 9 17:37 K01network-manager -> ../init.d/network-manager
lrwxrwxrwx 1 root root 14 févr. 9 17:36 K01nmbd -> ../init.d/nmbd
lrwxrwxrwx 1 root root 21 févr. 9 17:36 K01samba-ad-dc -> ../init.d/samba-ad-dc
lrwxrwxrwx 1 root root 15 févr. 9 17:36 K01saned -> ../init.d/saned
lrwxrwxrwx 1 root root 14 févr. 9 17:36 K01smbd -> ../init.d/smbd
lrwxrwxrwx 1 root root 17 févr. 9 16:52 K01urandom -> ../init.d/urandom
lrwxrwxrwx 1 root root 17 févr. 9 17:36 K01winbind -> ../init.d/winbind
lrwxrwxrwx 1 root root 18 févr. 26 17:06 K02libvirtd -> ../init.d/libvirtd
lrwxrwxrwx 1 root root 18 mars 2 11:51 K03sendsigs -> ../init.d/sendsigs
lrwxrwxrwx 1 root root 17 mars 2 11:51 K04rsyslog -> ../init.d/rsyslog
lrwxrwxrwx 1 root root 22 mars 2 11:51 K05umountnfs.sh -> ../init.d/umountnfs.sh
lrwxrwxrwx 1 root root 20 mars 2 11:51 K06nfs-common -> ../init.d/nfs-common
lrwxrwxrwx 1 root root 17 mars 2 11:51 K06rpcbind -> ../init.d/rpcbind
lrwxrwxrwx 1 root root 20 mars 2 11:51 K07hwclock.sh -> ../init.d/hwclock.sh
lrwxrwxrwx 1 root root 20 mars 2 11:51 K07networking -> ../init.d/networking
lrwxrwxrwx 1 root root 18 mars 2 11:51 K08umountfs -> ../init.d/umountfs
lrwxrwxrwx 1 root root 20 mars 2 11:51 K09umountroot -> ../init.d/umountroot
lrwxrwxrwx 1 root root 14 mars 2 11:51 K10halt -> ../init.d/halt
-rw-r--r-- 1 root root 353 janv. 27 2014 README
Mon script mountcifs:
[code]#! /bin/sh
BEGIN INIT INFO
Provides: mountcifs
Required-Start: $syslog $time
Required-Stop:
Default-Start: 2 3 4 5
Default-Stop: 0 1 6
Short-Description: umount cifs systems
Description: Permet de umount les systemes CIFS avant que networkmanager ne desactive tout
END INIT INFO
start() {
echo “mountcifs: nothing to do!”
}
stop() {
echo date
“********* debut umount cifs *************” >> /var/log/testgui
echo date
"mount avant: " mount | grep Commun
>> /var/log/testgui
echo date
"ifconfig avant: " ifconfig wlan0 | grep "inet adr"
>> /var/log/testgui
echo date
"ping avant: " ping -c 1 xx.xx.xx.202
>> /var/log/testgui
echo date
"route avant: " route | grep "*"
>> /var/log/testgui
echo date
"lsof avant: " lsof /media/Commun
>> /var/log/testgui
echo date
"Umount: " >> /var/log/testgui
umount -f /media/Commun
2>> /var/log/testgui
echo date
"lsof apres: " lsof /media/Commun
>> /var/log/testgui
echo date
"mount apres: " mount | grep Commun
>> /var/log/testgui
echo date
"ifconfig apres: " ifconfig wlan0 | grep "inet adr"
>> /var/log/testgui
echo date
"route apres: " route | grep "*"
>> /var/log/testgui
echo date
"ping apres: " ping -c 1 xx.xx.xx.202
>> /var/log/testgui
echo date
“****************** fin umount cifs **************” >> /var/log/testgui
}
status() {
echo "Mounted samba-cifs filesystems…"
mount -t cifs| cut -d\ -f3
}
restart() {
echo "restart …"
start
}
reload() {
echo "start …"
start
}
force_reload() {
echo "force-reload …"
start
}
case $1 in
start)
start
;;
stop)
stop
;;
status)
status
;;
restart)
restart
;;
reload)
reload
;;
force-reload)
force_reload
;;
*)
echo “Usage: mountcifs {start|stop|restart|reload|force-reload|status}”
;;
esac
exit 0
[/code]
Mon network-manager:
[code]#! /bin/sh
BEGIN INIT INFO
Provides: network-manager
Required-Start: $remote_fs dbus udev
Required-Stop: $remote_fs dbus udev mountcifs
Should-Start: $syslog
Should-Stop: $syslog
Default-Start: 2 3 4 5
Default-Stop: 0 1 6
Short-Description: network connection manager
Description: Daemon for automatically switching network
connections to the best available connection.
END INIT INFO
echo date
“**************** DEBUT NETWORKMANAGER ***********” >> /var/log/testgui
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
DESC="network connection manager"
NAME=“NetworkManager”
DAEMON=/usr/sbin/$NAME
PIDFILE=/var/run/$NAME/$NAME.pid
SCRIPTNAME=/etc/init.d/network-manager
Gracefully exit if the package has been removed.
test -x $DAEMON || exit 0
. /lib/lsb/init-functions
test -f /etc/default/NetworkManager && . /etc/default/NetworkManager
Function that starts the daemon/service.
d_start() {
start-stop-daemon --start --quiet --pidfile $PIDFILE
–exec $DAEMON – $DAEMON_OPTS
}
Function that stops the daemon/service.
d_stop() {
echo date
“**************** D_STOP NETWORKMANAGER ***********” >> /var/log/testgui
start-stop-daemon --stop --retry 5 --quiet --pidfile $PIDFILE
–exec $DAEMON
}
case “$1” in
start)
log_daemon_msg “Starting $DESC” "$NAME"
d_start
case “$?” in
0) log_end_msg 0 ;;
1) log_progress_msg “already started"
log_end_msg 0 ;;
) log_end_msg 1 ;;
esac
;;
stop)
echo date
"*************** STOP NETWORKMANAGER ***********” >> /var/log/testgui
log_daemon_msg “Stopping $DESC” "$NAME"
d_stop
case “$?” in
0) log_end_msg 0 ;;
1) log_progress_msg "already stopped"
log_end_msg 0 ;;
*) log_end_msg 1 ;;
esac
;;
restart|force-reload)
$0 stop
$0 start
;;
status)
status_of_proc -p $PIDFILE $DAEMON $NAME && exit 0 || exit $?
;;
*)
echo “Usage: $SCRIPTNAME {start|stop|restart|force-reload|status}” >&2
exit 1
;;
esac
exit 0[/code]
J’ai essayé de mettre 2 ou 3 “echo” vers un log pour voir si il passait bien par ce script.
Mon “log” testgui:
lundi 2 mars 2015, 17:52:27 (UTC+0100) ********* debut umount cifs *************
lundi 2 mars 2015, 17:52:27 (UTC+0100) mount avant: //xx.xx.xx.200/commun on /media/Commun type cifs (rw,nosuid,..........
lundi 2 mars 2015, 17:52:27 (UTC+0100) ifconfig avant: inet adr:xx.xx.xx.25 Bcast:xx.xx.xx.255 Masque:255.255.255.0
lundi 2 mars 2015, 17:52:27 (UTC+0100) ping avant: PING xx.xx.xx.200 (xx.xx.xx.200) 56(84) bytes of data. --- xx.xx.xx.200 ping statistics --- 1 packets transmitted, 0 received, 100% packet loss, time 0ms
lundi 2 mars 2015, 17:52:37 (UTC+0100) route avant:
lundi 2 mars 2015, 17:52:37 (UTC+0100) lsof avant:
lundi 2 mars 2015, 17:54:46 (UTC+0100) Umount:
lundi 2 mars 2015, 17:54:46 (UTC+0100) lsof apres:
lundi 2 mars 2015, 17:54:46 (UTC+0100) mount apres:
lundi 2 mars 2015, 17:54:46 (UTC+0100) ifconfig apres:
lundi 2 mars 2015, 17:54:46 (UTC+0100) route apres:
lundi 2 mars 2015, 17:54:46 (UTC+0100) ping apres:
lundi 2 mars 2015, 17:54:46 (UTC+0100) ****************** fin umount cifs **************
Donc en gros:
- Il ne lance pas le script K01network-manager
- Avant de tenter le démontage il a toujours une IP mais plus de route (donc forcement tous les paquets se perdent!)
- Il met plus de 2 minutes à démonter mon partage.