xcoder
Posts: 10
Joined: Wed Sep 19, 2012 5:14 pm

Slow shutdown / reboot

Wed Sep 19, 2012 5:25 pm

I have been running my R Pi successfully for a month and am very happy. But, I wanted to get rid of the very long ethernet cable snaking across the floor.
I installed an Edimax EW-7811Un wireless dongle and got it working as wlan0. I then unplugged the cat-5 cable.
Now when I reboot or shutdown the R Pi hangs for several minutes during the shutdown phase ( after the message indicating it was unable to find a hardware clock ). I assume this has to do with the ethernet cable not being attached because this did not happen when it was connected. But, I am unable to find any indictions as to the problem in any log files.
I commented out the 'iface eth0 inet dhcp' line in the /etc/network/interfaces file but this made no difference.
How can I prevent the long wait during shutdown?
Thanks.

thogue
Posts: 131
Joined: Wed Sep 19, 2012 2:16 am

Re: Slow shutdown / reboot

Thu Sep 20, 2012 12:54 am

Do you have a powered usb hub around? This could be a sign your device is having a power issue.

edit: going to reboot my rpi and see where you are getting stuck, as you thought you could be getting stuck on dhcp.. but I would figure that would be pretty clear.

second edit:

Looks like you are getting stuck before the filesystems if fully mounted.

And to clarify you have this problem since installing the adapter and regardless of whether the cable is plugged in or not?
Last edited by thogue on Thu Sep 20, 2012 1:08 am, edited 1 time in total.

thogue
Posts: 131
Joined: Wed Sep 19, 2012 2:16 am

Re: Slow shutdown / reboot

Thu Sep 20, 2012 1:06 am

Have you checked all the items on the verified page ( http://elinux.org/RPi_VerifiedPeripherals )?
could be power/driver related

Also for safe measure I would try to put some heavy load on your rpi w/ the dongle attached. Ive witnessed powering multiple devices, mouse,keyboard etc being fine until you load the cpu @ 100 percent for 5/10 seconds then my rPi will just turn off.

xcoder
Posts: 10
Joined: Wed Sep 19, 2012 5:14 pm

Re: Slow shutdown / reboot

Thu Sep 20, 2012 2:48 am

Thanks for the replies. The situation only occurs when shutting down the system. It boots up fine and as quickly as before I added the wifi dongle. The Edimax is an approved dongle per the R Pi spec pages. Also, the other usb port is occupied with a keyboard dongle from Logitech. The keyboard dongle has been there since the beginning and has caused no problems.

I have placed large loads on the cpu. I run an app that I can configure and it can use up to 100% cpu. It runs fine when set to max usage. The R Pi does the work and goes back to a normal state when the app is finished. The app can cycle several times with no issues.

I am using the Debian squeeze image updated and rpi_configured. All was fine until I added the wifi. Is it possible that Debian is looking to shut down the eth0 device but can't because there is no connection?

thogue
Posts: 131
Joined: Wed Sep 19, 2012 2:16 am

Re: Slow shutdown / reboot

Thu Sep 20, 2012 11:59 am

How about trying with the wifi adapter removed but the configs left the same?

If you plug the cable back in does this problem go away?


my *nix knowledge is pretty good however my pi knowledge is still very minimal, I dont see why having your interface unconfigured/misconfigured would cause shutdown problems unless its interfering with another application somehow

Have you checked /var/log/messages for any messages that might of occurred during shutdown? ( I know you said you checked logs, sorry if you already did this)

xcoder
Posts: 10
Joined: Wed Sep 19, 2012 5:14 pm

Re: Slow shutdown / reboot

Thu Sep 20, 2012 3:29 pm

After doing further research I may have a clue :-)
I added a script that uses smb to connect to two NAS boxes containing required data when logging in as the pi user. Before adding the wifi dongle I assume Debian would close these connections on the eth0 device since there was no issue with shutting down on the pi.
Is it possible that Debian is not closing the connections on the wlan0 device and this is the cause for the delay? What mechanism disconnects attached devices? Is the mechanism tied to devices like eth0 and wlan0?

thogue
Posts: 131
Joined: Wed Sep 19, 2012 2:16 am

Re: Slow shutdown / reboot

Thu Sep 20, 2012 5:40 pm

It joint bind to a device, it should use whatever device has the default route, in the case of eth0 not brin active it would have to be wlan0 if it's active.

Try this though, manually disconnect the SMB mounts and try to shutdown after that.

Something else to try, run ping against the interface's ip from your workstation, see when the device actually shuts off, maybe it will coincide with the "slow"or "pause" you are seeing

T

xcoder
Posts: 10
Joined: Wed Sep 19, 2012 5:14 pm

Re: Slow shutdown / reboot

Thu Sep 20, 2012 7:39 pm

That is the problem. When I manually unmount the NAS drives it shuts down as expected. No delay.
So, the question now is what is the difference? Why do smb connections via eth0 get terminated during shutdown / reboot before eth0 is itself shutdown but smb connections via wlan0 do not?
Does this have something to do with the rcX.d routines? Can I find the answer in the run level startup / shutdown scripts? Where is the best place to look / start?
Thanks.

xcoder
Posts: 10
Joined: Wed Sep 19, 2012 5:14 pm

Re: Slow shutdown / reboot

Thu Sep 20, 2012 11:34 pm

Here is where I am so far:
The wifi uses wpa_supplicant to start and stop. My wpa_supplicant.conf file has a pre-up line but no down or post-down.
All smb connections were closed when I used eth0.
I am looking for a way to have wpa_supplicant do whatever the shutdown scripts do for the eth0 device or smb connections.

thogue
Posts: 131
Joined: Wed Sep 19, 2012 2:16 am

Re: Slow shutdown / reboot

Fri Sep 21, 2012 12:32 am

I am assuming WPA_Supplicant / other networking scripts are at totally different runlevels.

Guess this could be tackled two ways, going to poke around in my rPi and chime in. (either by moving wpa_supplicant or moving /creating script to unmount properly... really wish my wifi adapter was here already... would make solving your problem easy I could just reproduce it.

Im not sure whether we should try to find the root of the cause, Obviously a simple script should solve this quick.


Could you pastebin the results of

Code: Select all

ls -lh /etc/rc*

looking at my scripts looks like you are getting stuck on EDIT4: looks like its not the K06hwclock.sh not the fake one. which networking is second. The unmountnfs.sh script appears to be called before hwclock/networking(should be umount all network shares). Perhaps the linking of your scripts will shed some light.

installing samba-client real quick to see what the deal is with its shutdown script. If anything we can create a script to unmount your shares and just link it at the right spot so it happens before anything else. edit: What script/app/daemon are you using to mount the SMB shares (looks like there are more than a few options available)

edit2: looks like K04umountnfs.sh should already handle disconnect your samba shares for you.

tl;dr run that command and it should shed some light on the issue.

xcoder
Posts: 10
Joined: Wed Sep 19, 2012 5:14 pm

Re: Slow shutdown / reboot

Fri Sep 21, 2012 1:45 am

I ran the K04umountnfs.sh and it worked OK. The shares were unmounted and there was very little delay.

I mount the shares using a .profile script under the pi user. When that user logs in it mounts two smb shares via the mount command.

With your info I would say the issue is in /init.d/networking
When the machines hangs I see the hardware clock issue and the networking script is the next one in the rc6.d order. Maybe eth0 being disabled in /etc/network/interfaces is causing the issue and not the smb shares. The eth0 interface still appears but has no IP address.



The result of ls -lh rc*


root@raspberrypi:/home/pi# ls -lh /etc/rc*
-rwxr-xr-x 1 root root 1.6K Apr 19 00:53 /etc/rc.local
-rw-r--r-- 1 root root 1.6K Apr 19 00:53 /etc/rc.local~

/etc/rc0.d:
total 4.0K
lrwxrwxrwx 1 root root 14 Aug 25 2011 K01fuse -> ../init.d/fuse
lrwxrwxrwx 1 root root 13 Aug 25 2011 K01gdm -> ../init.d/gdm
lrwxrwxrwx 1 root root 17 Apr 17 03:31 K01ifplugd -> ../init.d/ifplugd
lrwxrwxrwx 1 root root 18 Aug 26 08:43 K01lighttpd -> ../init.d/lighttpd
lrwxrwxrwx 1 root root 15 Aug 24 04:51 K01samba -> ../init.d/samba
lrwxrwxrwx 1 root root 17 Aug 30 11:05 K01urandom -> ../init.d/urandom
lrwxrwxrwx 1 root root 18 Nov 18 2010 K02sendsigs -> ../init.d/sendsigs
lrwxrwxrwx 1 root root 17 Nov 18 2010 K03rsyslog -> ../init.d/rsyslog
lrwxrwxrwx 1 root root 22 Nov 18 2010 K04umountnfs.sh -> ../init.d/umountnfs.sh
lrwxrwxrwx 1 root root 20 Jan 17 2012 K06hwclock.sh -> ../init.d/hwclock.sh
lrwxrwxrwx 1 root root 20 Nov 18 2010 K06networking -> ../init.d/networking
lrwxrwxrwx 1 root root 18 Nov 18 2010 K07ifupdown -> ../init.d/ifupdown
lrwxrwxrwx 1 root root 18 Nov 18 2010 K08umountfs -> ../init.d/umountfs
lrwxrwxrwx 1 root root 20 Nov 18 2010 K09umountroot -> ../init.d/umountroot
lrwxrwxrwx 1 root root 14 Nov 18 2010 K10halt -> ../init.d/halt
-rw-r--r-- 1 root root 353 Mar 24 13:09 README

/etc/rc1.d:
total 4.0K
lrwxrwxrwx 1 root root 13 Aug 25 2011 K01gdm -> ../init.d/gdm
lrwxrwxrwx 1 root root 13 Aug 25 2011 K01hal -> ../init.d/hal
lrwxrwxrwx 1 root root 17 Apr 17 03:31 K01ifplugd -> ../init.d/ifplugd
lrwxrwxrwx 1 root root 18 Aug 26 08:43 K01lighttpd -> ../init.d/lighttpd
lrwxrwxrwx 1 root root 15 Aug 24 04:51 K01samba -> ../init.d/samba
lrwxrwxrwx 1 root root 17 Nov 18 2010 K03rsyslog -> ../init.d/rsyslog
-rw-r--r-- 1 root root 369 Mar 24 13:09 README
lrwxrwxrwx 1 root root 19 Nov 18 2010 S01killprocs -> ../init.d/killprocs
lrwxrwxrwx 1 root root 18 Dec 31 1969 S21bootlogs -> ../init.d/bootlogs
lrwxrwxrwx 1 root root 16 Dec 31 1969 S22single -> ../init.d/single

/etc/rc2.d:
total 4.0K
-rw-r--r-- 1 root root 677 Mar 26 18:50 README
lrwxrwxrwx 1 root root 24 Aug 24 13:58 S17binfmt-support -> ../init.d/binfmt-support
lrwxrwxrwx 1 root root 17 Dec 31 1969 S17ifplugd -> ../init.d/ifplugd
lrwxrwxrwx 1 root root 17 Dec 31 1969 S17rsyslog -> ../init.d/rsyslog
lrwxrwxrwx 1 root root 15 Aug 24 04:51 S17samba -> ../init.d/samba
lrwxrwxrwx 1 root root 14 Dec 31 1969 S17sudo -> ../init.d/sudo
lrwxrwxrwx 1 root root 14 Dec 31 1969 S18cron -> ../init.d/cron
lrwxrwxrwx 1 root root 14 Dec 31 1969 S18dbus -> ../init.d/dbus
lrwxrwxrwx 1 root root 18 Aug 26 08:43 S18lighttpd -> ../init.d/lighttpd
lrwxrwxrwx 1 root root 13 Dec 31 1969 S18ntp -> ../init.d/ntp
lrwxrwxrwx 1 root root 15 Sep 1 11:51 S18rsync -> ../init.d/rsync
lrwxrwxrwx 1 root root 13 Aug 30 09:19 S18ssh -> ../init.d/ssh
lrwxrwxrwx 1 root root 13 Dec 31 1969 S19hal -> ../init.d/hal
lrwxrwxrwx 1 root root 18 Dec 31 1969 S21bootlogs -> ../init.d/bootlogs
lrwxrwxrwx 1 root root 18 Dec 31 1969 S22rc.local -> ../init.d/rc.local
lrwxrwxrwx 1 root root 19 Dec 31 1969 S22rmnologin -> ../init.d/rmnologin
lrwxrwxrwx 1 root root 23 Dec 31 1969 S22stop-bootlogd -> ../init.d/stop-bootlogd

/etc/rc3.d:
total 4.0K
-rw-r--r-- 1 root root 677 Mar 26 18:50 README
lrwxrwxrwx 1 root root 24 Aug 24 13:58 S17binfmt-support -> ../init.d/binfmt-support
lrwxrwxrwx 1 root root 17 Dec 31 1969 S17ifplugd -> ../init.d/ifplugd
lrwxrwxrwx 1 root root 17 Dec 31 1969 S17rsyslog -> ../init.d/rsyslog
lrwxrwxrwx 1 root root 15 Aug 24 04:51 S17samba -> ../init.d/samba
lrwxrwxrwx 1 root root 14 Dec 31 1969 S17sudo -> ../init.d/sudo
lrwxrwxrwx 1 root root 14 Dec 31 1969 S18cron -> ../init.d/cron
lrwxrwxrwx 1 root root 14 Dec 31 1969 S18dbus -> ../init.d/dbus
lrwxrwxrwx 1 root root 18 Aug 26 08:43 S18lighttpd -> ../init.d/lighttpd
lrwxrwxrwx 1 root root 13 Dec 31 1969 S18ntp -> ../init.d/ntp
lrwxrwxrwx 1 root root 15 Sep 1 11:51 S18rsync -> ../init.d/rsync
lrwxrwxrwx 1 root root 13 Aug 30 09:19 S18ssh -> ../init.d/ssh
lrwxrwxrwx 1 root root 13 Dec 31 1969 S19hal -> ../init.d/hal
lrwxrwxrwx 1 root root 18 Dec 31 1969 S21bootlogs -> ../init.d/bootlogs
lrwxrwxrwx 1 root root 18 Dec 31 1969 S22rc.local -> ../init.d/rc.local
lrwxrwxrwx 1 root root 19 Dec 31 1969 S22rmnologin -> ../init.d/rmnologin
lrwxrwxrwx 1 root root 23 Dec 31 1969 S22stop-bootlogd -> ../init.d/stop-bootlogd

/etc/rc4.d:
total 4.0K
-rw-r--r-- 1 root root 677 Mar 26 18:50 README
lrwxrwxrwx 1 root root 24 Aug 24 13:58 S17binfmt-support -> ../init.d/binfmt-support
lrwxrwxrwx 1 root root 17 Dec 31 1969 S17ifplugd -> ../init.d/ifplugd
lrwxrwxrwx 1 root root 17 Dec 31 1969 S17rsyslog -> ../init.d/rsyslog
lrwxrwxrwx 1 root root 15 Aug 24 04:51 S17samba -> ../init.d/samba
lrwxrwxrwx 1 root root 14 Dec 31 1969 S17sudo -> ../init.d/sudo
lrwxrwxrwx 1 root root 14 Dec 31 1969 S18cron -> ../init.d/cron
lrwxrwxrwx 1 root root 14 Dec 31 1969 S18dbus -> ../init.d/dbus
lrwxrwxrwx 1 root root 18 Aug 26 08:43 S18lighttpd -> ../init.d/lighttpd
lrwxrwxrwx 1 root root 13 Dec 31 1969 S18ntp -> ../init.d/ntp
lrwxrwxrwx 1 root root 15 Sep 1 11:51 S18rsync -> ../init.d/rsync
lrwxrwxrwx 1 root root 13 Aug 30 09:19 S18ssh -> ../init.d/ssh
lrwxrwxrwx 1 root root 13 Dec 31 1969 S19hal -> ../init.d/hal
lrwxrwxrwx 1 root root 18 Dec 31 1969 S21bootlogs -> ../init.d/bootlogs
lrwxrwxrwx 1 root root 18 Dec 31 1969 S22rc.local -> ../init.d/rc.local
lrwxrwxrwx 1 root root 19 Dec 31 1969 S22rmnologin -> ../init.d/rmnologin
lrwxrwxrwx 1 root root 23 Dec 31 1969 S22stop-bootlogd -> ../init.d/stop-bootlogd

/etc/rc5.d:
total 4.0K
-rw-r--r-- 1 root root 677 Mar 26 18:50 README
lrwxrwxrwx 1 root root 24 Aug 24 13:58 S17binfmt-support -> ../init.d/binfmt-support
lrwxrwxrwx 1 root root 17 Dec 31 1969 S17ifplugd -> ../init.d/ifplugd
lrwxrwxrwx 1 root root 17 Dec 31 1969 S17rsyslog -> ../init.d/rsyslog
lrwxrwxrwx 1 root root 15 Aug 24 04:51 S17samba -> ../init.d/samba
lrwxrwxrwx 1 root root 14 Dec 31 1969 S17sudo -> ../init.d/sudo
lrwxrwxrwx 1 root root 14 Dec 31 1969 S18cron -> ../init.d/cron
lrwxrwxrwx 1 root root 14 Dec 31 1969 S18dbus -> ../init.d/dbus
lrwxrwxrwx 1 root root 18 Aug 26 08:43 S18lighttpd -> ../init.d/lighttpd
lrwxrwxrwx 1 root root 13 Dec 31 1969 S18ntp -> ../init.d/ntp
lrwxrwxrwx 1 root root 15 Sep 1 11:51 S18rsync -> ../init.d/rsync
lrwxrwxrwx 1 root root 13 Aug 30 09:19 S18ssh -> ../init.d/ssh
lrwxrwxrwx 1 root root 13 Dec 31 1969 S19hal -> ../init.d/hal
lrwxrwxrwx 1 root root 13 Dec 31 1969 S20gdm -> ../init.d/gdm
lrwxrwxrwx 1 root root 18 Dec 31 1969 S21bootlogs -> ../init.d/bootlogs
lrwxrwxrwx 1 root root 18 Dec 31 1969 S22rc.local -> ../init.d/rc.local
lrwxrwxrwx 1 root root 19 Dec 31 1969 S22rmnologin -> ../init.d/rmnologin
lrwxrwxrwx 1 root root 23 Dec 31 1969 S22stop-bootlogd -> ../init.d/stop-bootlogd

/etc/rc6.d:
total 4.0K
lrwxrwxrwx 1 root root 14 Aug 25 2011 K01fuse -> ../init.d/fuse
lrwxrwxrwx 1 root root 13 Aug 25 2011 K01gdm -> ../init.d/gdm
lrwxrwxrwx 1 root root 17 Apr 17 03:31 K01ifplugd -> ../init.d/ifplugd
lrwxrwxrwx 1 root root 18 Aug 26 08:43 K01lighttpd -> ../init.d/lighttpd
lrwxrwxrwx 1 root root 15 Aug 24 04:51 K01samba -> ../init.d/samba
lrwxrwxrwx 1 root root 17 Aug 30 11:05 K01urandom -> ../init.d/urandom
lrwxrwxrwx 1 root root 18 Nov 18 2010 K02sendsigs -> ../init.d/sendsigs
lrwxrwxrwx 1 root root 17 Nov 18 2010 K03rsyslog -> ../init.d/rsyslog
lrwxrwxrwx 1 root root 22 Nov 18 2010 K04umountnfs.sh -> ../init.d/umountnfs.sh
lrwxrwxrwx 1 root root 20 Jan 17 2012 K06hwclock.sh -> ../init.d/hwclock.sh
lrwxrwxrwx 1 root root 20 Nov 18 2010 K06networking -> ../init.d/networking
lrwxrwxrwx 1 root root 18 Nov 18 2010 K07ifupdown -> ../init.d/ifupdown
lrwxrwxrwx 1 root root 18 Nov 18 2010 K08umountfs -> ../init.d/umountfs
lrwxrwxrwx 1 root root 20 Nov 18 2010 K09umountroot -> ../init.d/umountroot
lrwxrwxrwx 1 root root 16 Nov 18 2010 K10reboot -> ../init.d/reboot
-rw-r--r-- 1 root root 351 Mar 24 13:09 README

/etc/rcS.d:
total 4.0K
lrwxrwxrwx 1 root root 20 Aug 25 2011 noS13x11-common -> ../init.d/x11-common
-rw-r--r-- 1 root root 447 Mar 24 13:09 README
lrwxrwxrwx 1 root root 24 Nov 18 2010 S01mountkernfs.sh -> ../init.d/mountkernfs.sh
lrwxrwxrwx 1 root root 14 Nov 18 2010 S02udev -> ../init.d/udev
lrwxrwxrwx 1 root root 26 Nov 18 2010 S03mountdevsubfs.sh -> ../init.d/mountdevsubfs.sh
lrwxrwxrwx 1 root root 18 Nov 18 2010 S04bootlogd -> ../init.d/bootlogd
lrwxrwxrwx 1 root root 24 Aug 25 2011 S05keyboard-setup -> ../init.d/keyboard-setup
lrwxrwxrwx 1 root root 16 Aug 25 2011 S06hdparm -> ../init.d/hdparm
lrwxrwxrwx 1 root root 21 Aug 25 2011 S06hostname.sh -> ../init.d/hostname.sh
lrwxrwxrwx 1 root root 25 Jan 17 2012 S06hwclockfirst.sh -> ../init.d/hwclockfirst.sh
lrwxrwxrwx 1 root root 22 Aug 25 2011 S07checkroot.sh -> ../init.d/checkroot.sh
lrwxrwxrwx 1 root root 20 Jan 17 2012 S08hwclock.sh -> ../init.d/hwclock.sh
lrwxrwxrwx 1 root root 24 Aug 25 2011 S08ifupdown-clean -> ../init.d/ifupdown-clean
lrwxrwxrwx 1 root root 27 Aug 25 2011 S08module-init-tools -> ../init.d/module-init-tools
lrwxrwxrwx 1 root root 17 Aug 25 2011 S08mtab.sh -> ../init.d/mtab.sh
lrwxrwxrwx 1 root root 20 Aug 25 2011 S09checkfs.sh -> ../init.d/checkfs.sh
lrwxrwxrwx 1 root root 18 Aug 25 2011 S10ifupdown -> ../init.d/ifupdown
lrwxrwxrwx 1 root root 21 Aug 25 2011 S10mountall.sh -> ../init.d/mountall.sh
lrwxrwxrwx 1 root root 31 Aug 25 2011 S11mountall-bootclean.sh -> ../init.d/mountall-bootclean.sh
lrwxrwxrwx 1 root root 26 Aug 25 2011 S12mountoverflowtmp -> ../init.d/mountoverflowtmp
lrwxrwxrwx 1 root root 20 Aug 25 2011 S13networking -> ../init.d/networking
lrwxrwxrwx 1 root root 16 Aug 25 2011 S13procps -> ../init.d/procps
lrwxrwxrwx 1 root root 19 Aug 25 2011 S13udev-mtab -> ../init.d/udev-mtab
lrwxrwxrwx 1 root root 17 Aug 25 2011 S13urandom -> ../init.d/urandom
lrwxrwxrwx 1 root root 15 Aug 25 2011 S13vchiq -> ../init.d/vchiq
lrwxrwxrwx 1 root root 21 Dec 31 1969 S16mountnfs.sh -> ../init.d/mountnfs.sh
lrwxrwxrwx 1 root root 31 Dec 31 1969 S17mountnfs-bootclean.sh -> ../init.d/mountnfs-bootclean.sh
lrwxrwxrwx 1 root root 13 Dec 31 1969 S18kbd -> ../init.d/kbd
lrwxrwxrwx 1 root root 23 Dec 31 1969 S19console-setup -> ../init.d/console-setup
lrwxrwxrwx 1 root root 21 Dec 31 1969 S20bootmisc.sh -> ../init.d/bootmisc.sh
lrwxrwxrwx 1 root root 14 Dec 31 1969 S20fuse -> ../init.d/fuse
lrwxrwxrwx 1 root root 30 Dec 31 1969 S21stop-bootlogd-single -> ../init.d/stop-bootlogd-single
root@raspberrypi:/home/pi#

thogue
Posts: 131
Joined: Wed Sep 19, 2012 2:16 am

Re: Slow shutdown / reboot

Fri Sep 21, 2012 2:14 am

hmmm strange....

So if you call the unmount script with a stop it unmount.sh the shares and solves the issue. Correct? If this is correct I would seriously doubt the fix will be in network script, seems like its related to the way the os is handling the mounts.


Strange that this isnt happening at shutdown..... especially since the unmount.sh seems to be called before the networking script.

Leaves me kinda puzzled..... but looking online seems like a common problem

maybe try moving the unmount script to a higher priority.

sudo ln -s /etc/init.d/umountnfs.sh /etc/rc0.d/K01umountnfs.sh

try halt after that and see how it goes? (not reboot as this is runlevel6 not 0, you will have to change this link in the /etc/rc6.d/ directory of this fixes your problem)

http://whereofwecannotspeak.wordpress.c ... or-reboot/ <-- similar issue.

xcoder
Posts: 10
Joined: Wed Sep 19, 2012 5:14 pm

Re: Slow shutdown / reboot

Sat Sep 22, 2012 12:03 am

I tried the K01umountnfs.sh and halt you suggested. Same problem.

So, I decided to try a different solution.
I removed the pi .profile file (that mounts the NAS ) and added the script below to /etc/init.d
Using the update-rc.d command specified in the script I installed the script into the startup/shutdown sequence. This works great!
Except when I rebooted the second time I no longer had keyboard input.
(edit) That is, the usb dongle from Logitech no longer seems to work!! I had to run the remove command to reverse the mountNAS install and reboot to get the keyboard working again.

AARRRRGGHHH!!!! (vent a little frustration)

I noticed that dmesg now contains a warning message on every boot:
EXT4-fs (mmcblk0p2): warning: maximal mount count reached, running e2fsck is recommended

here is the /etc/fstab file
proc /proc proc defaults 0 0
/dev/mmcblk0p1 /boot vfat defaults 0 0
/dev/mmcblk0p2 / ext4 defaults,noatime 0 0
/var/swapfile none swap sw 0 0

Here is the script:

#! /bin/sh

### BEGIN INIT INFO
# Provides: mountNAS
# Required-Start: $local_fs $remote_fs $network $syslog samba
# Required-Stop: $local_fs $remote_fs $network $syslog samba
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Mount NAS drives
# Description: Mount two NAS drives to support symbolic links in the lighttpd web server
### END INIT INFO

# To install this script run:
# update-rc.d mountNAS start 30 2 3 4 5 . stop 01 0 1 6 .
# To uninstall this script run:
# update-rc.d -f mountNAS remove

case "$1" in
start)
echo Mounting M1
mount -t smbfs //server1/Public -o user=guest,password= /home/pi/Volumes/M1
echo Mounting M2
mount -t smbfs //server2/Public -o user=guest,password= /home/pi/Volumes/M2
;;
stop)
echo unmounting M1
umount /home/pi/Volumes/M1
echo unmounting M2
umount /home/pi/Volumes/M2
;;
esac

thogue
Posts: 131
Joined: Wed Sep 19, 2012 2:16 am

Re: Slow shutdown / reboot

Sat Sep 22, 2012 2:42 am

So this basic mount script breaks your keyboard dongle? im kinda confused and would be equally frustrated...strange that it started happening on a second reboot.


are you fully updated os/firmware? and tried a different psu.


I killed my root partition either with an overclock or possibly forgetting to halt the system this morning. Wasnt too happy.


maybe try your script at different priorities?

xcoder
Posts: 10
Joined: Wed Sep 19, 2012 5:14 pm

SOLVED Slow shutdown / reboot

Sat Sep 22, 2012 11:26 pm

Change script header to:

### BEGIN INIT INFO
# Provides: mountNAS
# Required-Start: $all
# Required-Stop: $all
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Mount NAS drives
# Description: Mount two NAS drives to support symbolic links in the lighttpd web server
### END INIT INFO

run insserv mountNAS and all works as expected!!

Not sure why update-rc.d does not work but insserv does and solved the problem.

BTW, the "EXT4-fs (mmcblk0p2): warning: maximal mount count reached, running e2fsck is recommended error" is fixed by changing this line in /etc/fstab:

/dev/mmcblk0p2 / ext4 defaults,noatime 0 0

to

/dev/mmcblk0p2 / ext4 defaults,noatime 1 0

The 1 tells the system to run fsck and fix the issue at boot time.

thogue
Posts: 131
Joined: Wed Sep 19, 2012 2:16 am

Re: SOLVED Slow shutdown / reboot

Sun Sep 23, 2012 12:22 am

xcoder wrote:
/dev/mmcblk0p2 / ext4 defaults,noatime 1 0

The 1 tells the system to run fsck and fix the issue at boot time.


nice work! ive actually corrupted the sd card 4 more times to test where the harmony is between the overclock and my particular SD card . (the 1gb card seems to play nice at 1ghz running the minimal)
I think flipping the bit is a grand idea, but I'm pretty sure you are supposed to flip the bit on the 6th column.

xcoder
Posts: 10
Joined: Wed Sep 19, 2012 5:14 pm

Re: Slow shutdown / reboot

Sun Sep 23, 2012 12:30 am

Yes, it should be:

/dev/mmcblk0p2 / ext4 defaults,noatime 0 1

to run fsck at boot time.

Not sure how to mark this as solved.

thogue
Posts: 131
Joined: Wed Sep 19, 2012 2:16 am

Re: Slow shutdown / reboot

Sun Sep 23, 2012 2:37 am

you might be edit the first post and change the subject.

Return to “Beginners”