LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Ubuntu (https://www.linuxquestions.org/questions/ubuntu-63/)
-   -   11.04 hangs on reboot/shutdown (https://www.linuxquestions.org/questions/ubuntu-63/11-04-hangs-on-reboot-shutdown-880309/)

darkduck 05-12-2011 08:45 AM

11.04 hangs on reboot/shutdown
 
I have Kubuntu 11.04 as a result of upgrade from 10.04 -> 10.10 -> 11.04.
I also have clean install of Ubuntu 11.04. Following text is about my Kubuntu installation, but issue is the same for Ubuntu.

Since I made an upgrade, it takes 5 munutes (300 seconds) for laptop to shutdown/reboot. Or I can use Power button of course.
I have network drive mounted with CIFS and I suppose my issue is like this: https://bugs.launchpad.net/ubuntu/+s...ba/+bug/211631
I also found /etc/init.d/umountnfs.sh script with links to it in /etc/rc0.d and /etc/rc6.d. This script intended to do exactly what required - force unmounting of network drives during reboot/shutdown.
I added couple of lines in that script (create a file in /tmp and put a string in this file) to check if it actually works. Looks like it does not. Can't understand why, because there are definitely links to this file (/etc/rc0.d/K15umountnfs.sh and /etc/rc6.d/K15umountnfs.sh)

Has anybody had similar experience? Any solutions or suggestions?

rylan76 05-12-2011 10:30 AM

Have you taken a look at /var/log/messages ?

E. g. if something is crashing or waiting for some operation to complete, it might post a notification in there.

You might then be able to trace any error reports or messages logged in /var/log/messages around shutdown time to whatever is causing the delay.

It does sound like some form of timeout or wait state, and it might be in your samba shares not disconnecting. You might want to try a

Code:

umount -l /mnt/mnt_name
on the mountpoint of the samba connection you have. Then try shutting down or rebooting, and see if the delay is still there.

Might be completely OT, but is your system connected to the internet? If I, for example, on my Fedora 11 system, loose my connection, whole segments of my normal set of applications behave in exactly this way. Apparently there are many more connections made than I thought, e. g. emacs takes 5 minutes to start, mysqlcc takes 5 minutes, etc. I'm not sure if maybe you close or loose your connection, BEFORE the shutdown proceeds. Some processes or applications might then wait the entire connection timeout time to try and send or receive over the network connection, causing the long delay you are experiencing. (This one is a long shot, though...)

darkduck 05-12-2011 10:37 AM

Stefan,
I checked /var/log/messages and many other logs in /var/log
Nothing conspicuous.
If I watch 5 minutes at my screen, I see couple of lines flying on it just before it actually goes into reboot. But I could not catch these lines anywhere in /var/log.

I forgot to mention that if I do umount /my/share, then reboot takes just couple of seconds. That's why I think the issue IS in samba share connection. This could be cured by script mentioned in my first post. If I run the script manually just before reboot, it helps. But for whatever reason script is not executed automatically.

fellow2w 05-13-2011 06:09 AM

I seem to have the same/similar issue.

Recently I upgraded from 10.10 to 11.04 (downloaded and installed over pre-existing 10.10 HD install) and now on boot I only get a blank screen. I've left it sit for a good 5-10 minutes and nothing happens. Presumably I need to call up a terminal and try the umount -1 command mentioned above? How to I get terminal running when there is no icon for terminal or anything else for that matter on the screen?

darkduck 05-13-2011 06:24 AM

Quote:

Originally Posted by fellow2w (Post 4355201)
I seem to have the same/similar issue.

Recently I upgraded from 10.10 to 11.04 (downloaded and installed over pre-existing 10.10 HD install) and now on boot I only get a blank screen. I've left it sit for a good 5-10 minutes and nothing happens. Presumably I need to call up a terminal and try the umount -1 command mentioned above? How to I get terminal running when there is no icon for terminal or anything else for that matter on the screen?

You have different issue. I have system stuck during shutdown while you can't boot it.

fellow2w 05-13-2011 06:42 AM

cheers I guess I'll have to start a new thread!

rylan76 05-16-2011 01:54 PM

Quote:

Originally Posted by darkduck (Post 4354406)
Stefan,
I checked /var/log/messages and many other logs in /var/log
Nothing conspicuous.
If I watch 5 minutes at my screen, I see couple of lines flying on it just before it actually goes into reboot. But I could not catch these lines anywhere in /var/log.

I forgot to mention that if I do umount /my/share, then reboot takes just couple of seconds. That's why I think the issue IS in samba share connection. This could be cured by script mentioned in my first post. If I run the script manually just before reboot, it helps. But for whatever reason script is not executed automatically.

I think you can make that script execute automatically before the rest of your shutdown scripts run. I don't know where exactly (I'm not a 'buntu-ite) but see if you post a specific question, something like "adding custom script to master ubuntu shutdown script" (probably in the Ubuntu forum) if you get any takers.

I suspect it might be as easy as editing a certain file in the Ubuntu config file tree and simply adding one line that does something like

Code:

sh -f my_umount_script.sh
.
.
.

at the very top of the script file that does the shutdown / reboot steps for your system. E. g. that way, if you reboot or shutdown, your unmount script will always run first...

Hope this helps!

darkduck 05-19-2011 11:12 AM

Quote:

Originally Posted by rylan76 (Post 4358097)
I think you can make that script execute automatically before the rest of your shutdown scripts run. I don't know where exactly (I'm not a 'buntu-ite) but see if you post a specific question, something like "adding custom script to master ubuntu shutdown script" (probably in the Ubuntu forum) if you get any takers.

I think scripts in /etc/rc0.d and /etc/rc6.d are exactly for this purpose. But for whatever reason unmounting script is not executed, even though it has a link from there. 8-(

rylan76 05-20-2011 08:50 AM

Hmm... maybe it is getting executed concurrently?

Though that doesn't make sense, I'd think a shutdown script gets executed sequentially...

darkduck 05-20-2011 09:03 AM

Stefan, the point is that script is not executed at all. If you read my first post, it states
Quote:

I added couple of lines in that script (create a file in /tmp and put a string in this file) to check if it actually works. Looks like it does not.
File is not generated/updated when I shutdown the machine.

jqturnipseed 07-24-2011 02:48 AM

After months of attempts to fix this, I've finally found one that works for Kubuntu 11.04 (Natty). The problem is that Kubuntu (and I believe KDE more generally) starts the shutdown process in a way different than Gnome/Ubuntu, so even the dbus / netbase fixes and using autofs that I've seen proposed in different forums all didn't work. I think KDE begins shutting down userspace functions like network manager first before the /etc/init scripts or /home/user/.kde/shutdown scripts are called upon. Just speculation on my part, but that'd be my guess.

But I apparently found the place where Kubuntu actually starts the shutdown process, or close to it - it's in the /usr/bin/starkde script. Immediately after the line saying "echo 'startkde: Shutting down...' 1>&2", I inserted a line saying "sudo umount -t cifs -a -f -l". Then, using visudo as root ("sudo visudo"), I edited the sudoers file to allow the sudo command to execute umount without a password by adding the line (at the bottom of the file) "username ALL=(root) NOPASSWD:/bin/umount". Worked like a charm.

nathanboyd 08-04-2011 08:21 PM

THANK YOU! This solution, editing starkde and sudoers, worked splendidly. I am kind of OCD when it comes to things running smoothly on my machine and this was driving me crazy. You have made my evening.

jqturnipseed 08-07-2011 12:33 PM

You're welcome! I searched high and low for the answer. By the way, I'm the same way about my machine - I like it to work.


All times are GMT -5. The time now is 05:23 AM.