LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu
User Name
Password
Ubuntu This forum is for the discussion of Ubuntu Linux.

Notices


Reply
  Search this Thread
Old 05-12-2011, 08:45 AM   #1
darkduck
Member
 
Registered: Jan 2011
Location: London
Distribution: Ubuntu, Debian
Posts: 493

Rep: Reputation: 26
Question 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?
 
Old 05-12-2011, 10:30 AM   #2
rylan76
Senior Member
 
Registered: Apr 2004
Location: Potchefstroom, South Africa
Distribution: Fedora 17 - 3.3.4-5.fc17.x86_64
Posts: 1,520

Rep: Reputation: 100Reputation: 100
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...)

Last edited by rylan76; 05-12-2011 at 10:34 AM.
 
Old 05-12-2011, 10:37 AM   #3
darkduck
Member
 
Registered: Jan 2011
Location: London
Distribution: Ubuntu, Debian
Posts: 493

Original Poster
Rep: Reputation: 26
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.
 
Old 05-13-2011, 06:09 AM   #4
fellow2w
LQ Newbie
 
Registered: Jul 2009
Posts: 29

Rep: Reputation: 5
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?
 
Old 05-13-2011, 06:24 AM   #5
darkduck
Member
 
Registered: Jan 2011
Location: London
Distribution: Ubuntu, Debian
Posts: 493

Original Poster
Rep: Reputation: 26
Quote:
Originally Posted by fellow2w View Post
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.
 
Old 05-13-2011, 06:42 AM   #6
fellow2w
LQ Newbie
 
Registered: Jul 2009
Posts: 29

Rep: Reputation: 5
cheers I guess I'll have to start a new thread!
 
Old 05-16-2011, 01:54 PM   #7
rylan76
Senior Member
 
Registered: Apr 2004
Location: Potchefstroom, South Africa
Distribution: Fedora 17 - 3.3.4-5.fc17.x86_64
Posts: 1,520

Rep: Reputation: 100Reputation: 100
Quote:
Originally Posted by darkduck View Post
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!
 
Old 05-19-2011, 11:12 AM   #8
darkduck
Member
 
Registered: Jan 2011
Location: London
Distribution: Ubuntu, Debian
Posts: 493

Original Poster
Rep: Reputation: 26
Quote:
Originally Posted by rylan76 View Post
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-(
 
Old 05-20-2011, 08:50 AM   #9
rylan76
Senior Member
 
Registered: Apr 2004
Location: Potchefstroom, South Africa
Distribution: Fedora 17 - 3.3.4-5.fc17.x86_64
Posts: 1,520

Rep: Reputation: 100Reputation: 100
Hmm... maybe it is getting executed concurrently?

Though that doesn't make sense, I'd think a shutdown script gets executed sequentially...
 
Old 05-20-2011, 09:03 AM   #10
darkduck
Member
 
Registered: Jan 2011
Location: London
Distribution: Ubuntu, Debian
Posts: 493

Original Poster
Rep: Reputation: 26
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.
 
Old 07-24-2011, 02:48 AM   #11
jqturnipseed
LQ Newbie
 
Registered: Jul 2011
Posts: 2

Rep: Reputation: Disabled
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.
 
Old 08-04-2011, 08:21 PM   #12
nathanboyd
LQ Newbie
 
Registered: Aug 2011
Posts: 1

Rep: Reputation: Disabled
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.
 
Old 08-07-2011, 12:33 PM   #13
jqturnipseed
LQ Newbie
 
Registered: Jul 2011
Posts: 2

Rep: Reputation: Disabled
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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[FYI] "last -f <old wtmp> -x reboot shutdown" incorrect for last reboot and shutdown catkin Linux - General 1 03-25-2010 11:52 PM
Reboot/Shutdown hangs up..... linuxlover.chaitanya Ubuntu 3 10-17-2008 06:35 AM
Debian 3.1 hangs up at reboot or shutdown ckostyn Debian 14 08-21-2005 03:11 AM
MDK 10 hangs on reboot/shutdown (2.6 kernel) Arbitor Mandriva 9 04-16-2004 04:05 PM
Mandrake 9.2 hangs on shutdown/reboot buboleck Mandriva 4 02-05-2004 03:36 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu

All times are GMT -5. The time now is 12:53 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration