PDA

View Full Version : [ubuntu] Very slow shutdown



gredawarha
July 8th, 2012, 09:30 PM
Hello all

I have just noticed over the last few days that my Ubuntu 12.04 is taking 30+ seconds to shutdown where before it would shutdown very quickly.

I click the icon in the top right hand corner and then select shutdown or retart. Then nothing happens for 30 seconds or so and then it begins to shutdown.

Okay this is not the worst thing in the world but it's pretty annoying. Any idea on what is suddenly delaying the shutdown?

Appreciate any help.

gredawarha
July 8th, 2012, 11:15 PM
In addition if i run the shutdown command from a terminal it shuts down nice and quickly.

Also my partern has her own log in on the same machine yet does not have the same issue.

Mopar1973Man
July 9th, 2012, 03:49 AM
Being a noob myself but I'm willing to take a crack at it. You might want to look and see what is running on your side and your partners side for apps. Maybe that will give you a idea to the rogue program that might be running causing the slow shut down. Might just find the zombie...

But do a search for system monitor it should pop up...

NikTh
July 9th, 2012, 07:34 AM
Like Mopar1973Man (http://ubuntuforums.org/member.php?u=1574534) said , maybe its an app that hangs properly shutdown or maybe its a graphical problem (cause you said that from terminal its ok). So from your parnters account or just create a new user to see if its an app that fails to terminated.
If its a graphical bug you can try to add a line in to /etc/default/halt.

sudo nano /etc/default/haltand add this line INIT_HALT = POWEROFF
then click Ctrl+x and Y(es) and Enter to save .

gredawarha
July 9th, 2012, 08:23 PM
Thank you both for the replies. I tried to see if their was a particular program causing the issue but I couldn't find anything obvious.

I then added the line INIT_HALT = POWEROFF and so far that seems to have resolved the issue.

Many thanks

NikTh
July 9th, 2012, 08:26 PM
I then added the line INIT_HALT = POWEROFF and so far that seems to have resolved the issue.

Do a further examination and if the problem solved , come back and mark thread as solved from thread tools .
Thanks

gredawarha
July 9th, 2012, 08:34 PM
I spoke to soon it is still taking 30+ seconds to shutdown. Is there anything else I can do to try to resolve this?

NikTh
July 9th, 2012, 08:56 PM
Try to add one more parm in another file.
Give this command

gksudo gedit /etc/default/grub and find the line GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
and make it exactly like this
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash acpi=force"
save the document and then run in terminal

sudo update-grub
Hope this helps

matt_symes
July 9th, 2012, 10:35 PM
Hi

What happens if you shutdown using dbus ?


dbus-send --system --print-reply --dest=org.freedesktop.ConsoleKit /org/freedesktop/ConsoleKit/Manager org.freedesktop.ConsoleKit.Manager.Stop

Kind regards

gredawarha
July 10th, 2012, 06:36 PM
Hi NikTh

Changing that line in GRUB did not solve the issue.

Hi matt_symes

Using that command shutdown the computer quickly, there was some text displayed in the terminal but it shutdown to quickly to take note of it.

NikTh
July 11th, 2012, 11:04 AM
Hi matt_symes

Using that command shutdown the computer quickly, there was some text displayed in the terminal but it shutdown to quickly to take note of it.

So a workaround (not fix) can be a shortcut with this code.
Make a script

gedit shutdown.sh
copy-paste inside the code matt_symes gave you. Save . Then give execute rights

chmod a+x shutdown.sh
then go to keyboard - shortcuts and custom click (+)
At the command box give the path for shutdown.sh
e.g
/home/yourusername/shutdown.sh . Then click "disabled" and define a key. :)

matt_symes
July 11th, 2012, 06:00 PM
Hi

Open a terminal and copy and paste


/usr/lib/indicator-session/gtk-logout-helper --shutdown

Do you see any error messages ? Does it shutdown quickly ?

Kind regards

gredawarha
July 14th, 2012, 09:48 PM
Hi Matt

Ran the comand, the machine shuts down quickly but no messages.

gredawarha
July 15th, 2012, 08:06 AM
This is very annoying, I may just have to reinstall which has it's own annoyances. :(

matt_symes
July 16th, 2012, 05:40 PM
Hi

Create another user account log into it and try to shutdown from that account. Is the shutdown slow ?

Kind regards

hypnot0ad
July 16th, 2012, 06:03 PM
This is what I use and find it to work perfectly,


sudo shutdown -h now

How long have you had this problem?

techvish81
July 18th, 2012, 07:59 AM
if I shutdown while the network is connected, it takes double the time than the regular shutdown. so i disconnect network and shutdown.

gredawarha
July 19th, 2012, 08:45 AM
I did a reinstal (keeping my home directory) and the problem still persists so presumably there is something in my home directory that is causing the issue. I have my videos and photos backed up on an external hard drive and my documetns are on ubuntu one.

I will therefore delete my user account and home/darren directory and then reinstall see if that works.

matt_symes
July 19th, 2012, 11:46 AM
Hi

If you have not reinstalled yet. From the terminal type


gnome-session-quit

Is that still slow ? Maybe the problem is with saving your sessions.

Kind regards

Wirephire
July 19th, 2012, 01:05 PM
I faced similar behavior in earlier Ubuntu release. The fix I was using:

cd /etc/init.d
sudo wget http://www.jejik.com/files/examples/umountcifs
sudo chmod ugo+x umountcifs
sudo update-rc.d umountcifs stop 02 0 6 .

gredawarha
July 30th, 2012, 05:43 PM
Gave up in the end and did a fresh install backing up my important stuff first. Thank you though to those that tried to help me.

Diego Jp
September 25th, 2012, 04:03 AM
Hi

If you have not reinstalled yet. From the terminal type


gnome-session-quitIs that still slow ? Maybe the problem is with saving your sessions.

Kind regards

I've got that problem :/
running these script it's still slow

daslinkard
September 25th, 2012, 04:28 AM
Are you running NetworkManager? If so there seems to be a fix here (http://www.madanalogy.com/2008/04/fix-slow-ubuntu-shutdown-with-cifs.html).

minja
December 3rd, 2012, 09:38 PM
I had a same problem with Ubuntu 12.04 studio. This worked!
Thanks!:KS


I faced similar behavior in earlier Ubuntu release. The fix I was using:

cd /etc/init.d
sudo wget http://www.jejik.com/files/examples/umountcifs
sudo chmod ugo+x umountcifs
sudo update-rc.d umountcifs stop 02 0 6 .

layolayo
August 21st, 2013, 12:51 AM
I'm running a brand new Lenovo X1 Carbon with 13.04 64bit - and noticed a big difference between the shutdown speeds on this new laptop and my System76 Lemur. The Lemur is ultra fast sub 3 seconds, the Lenovo 5-10 seconds. I have TLP installed - TLP (http://askubuntu.com/questions/28543.../285681#285681 (http://askubuntu.com/questions/285434/is-there-a-power-saving-application-similar-to-jupiter/285681#285681))

Running through several forums, it looks like it is the network settings that cause this delay (for me) and simply by setting the line in /etc/default/tlp

DEVICES_TO_DISABLE_ON_SHUTDOWN="bluetooth wifi"

My laptop now shuts down in the same manner as my Lemur - nice :)

layolayo
August 27th, 2013, 10:40 PM
Quick note on this - I'm not sure how or why yet, but this shutdown speed only works on battery... when plugged into a PSU it is back to the 6-10 secs...? maybe that SHUTDOWN is not the answer...