# Cannot seem to shut down properly

## Hikaru79

Shutting down seems to be a huge problem for my Gentoo (brand new). As root, if I do 'shutdown now', it begins the shutdown process, but always stays stuck indefinetly at "Saving Random Seed    [ok]" and never goes past that point. As for trying to shut down from XFce, it's not even an option -- it's greyed out.

Any ideas? =/ I'm having to force-shut it every single time.

----------

## ONEEYEMAN

What's gonna hapeen, when you pressw the power button after it freezes, on shutdown now command? Does it give you an error in this case?

Thank you.

----------

## RinkyDinks_RJ

 *Quote:*   

> As for trying to shut down from XFce, it's not even an option -- it's greyed out.

 

Are you running a dm? (xdm, gdm, kdm). If you're not then running one should fix that.

Try using acpid or apmd, it fixes this problem on some computers.

----------

## Hikaru79

 *ONEEYEMAN wrote:*   

> What's gonna hapeen, when you pressw the power button after it freezes, on shutdown now command? Does it give you an error in this case?
> 
> Thank you.

 

I'm not sure what you mean. If I press the power button after it freezes, it just... turns off. It doesn't give an error message when it turns back on , at any rate.

And Rinky, thanks =) I'll give a dm a try.

----------

## Hikaru79

I really hate to bump topics like this, but not being able to shut down seems to me like a pretty serious problem, and any guidance would be GREATLY appreciated...  :Sad:  So, does anyone know why 'shutdown now' hangs on "Saving random seed      [ok]" ?  :Embarassed: 

----------

## Timer

I have the same problem too :/ Any help would be appreciated.

----------

## Hikaru79

 *Timer wrote:*   

> I have the same problem too :/ Any help would be appreciated.

 

This problem was solved for me in the IRC channel. Apparently, its now standard procedure to use

```
shutdown -h now
```

 as opposed to 

```
shutdown now
```

. Try that.

----------

## Lechium

i use 

```
halt =p
```

----------

## phsdv

 *Hikaru79 wrote:*   

> As for trying to shut down from XFce, it's not even an option -- it's greyed out.

 

This was solved for me after I  installed sudo.

----------

## phsdv

 *Hikaru79 wrote:*   

> Shutting down seems to be a huge problem for my Gentoo (brand new). As root, if I do 'shutdown now', it begins the shutdown process, but always stays stuck indefinetly at "Saving Random Seed    [ok]"

 

Apperently you go to init level 1 and not 0. Or you init levels are not correct. How does your /etc/inittab file look like?

----------

## Hikaru79

 *phsdv wrote:*   

>  *Hikaru79 wrote:*   Shutting down seems to be a huge problem for my Gentoo (brand new). As root, if I do 'shutdown now', it begins the shutdown process, but always stays stuck indefinetly at "Saving Random Seed    [ok]" 
> 
> Apperently you go to init level 1 and not 0. Or you init levels are not correct. How does your /etc/inittab file look like?

 

Here it is:

```
#

# /etc/inittab:  This file describes how the INIT process should set up

#                the system in a certain run-level.

#

# Author:  Miquel van Smoorenburg, <miquels@cistron.nl>

# Modified by:  Patrick J. Volkerding, <volkerdi@ftp.cdrom.com>

# Modified by:  Daniel Robbins, <drobbins@gentoo.org>

# Modified by:  Martin Schlemmer, <azarah@gentoo.org>

#

# $Header: /home/cvsroot/gentoo-src/rc-scripts/etc/inittab,v 1.6 2003/01/06 21:32:43 azarah Exp $

#

# Default runlevel.

id:3:initdefault:

# System initialization, mount local filesystems, etc.

si::sysinit:/sbin/rc sysinit

# Further system initialization, brings up the boot runlevel.

rc::bootwait:/sbin/rc boot

l0:0:wait:/sbin/rc shutdown 

l1:S1:wait:/sbin/rc single

l2:2:wait:/sbin/rc nonetwork

l3:3:wait:/sbin/rc default

l4:4:wait:/sbin/rc default

l5:5:wait:/sbin/rc default

l6:6:wait:/sbin/rc reboot

#z6:6:respawn:/sbin/sulogin

# TERMINALS

c1:12345:respawn:/sbin/agetty 38400 tty1 linux

c2:12345:respawn:/sbin/agetty 38400 tty2 linux

c3:12345:respawn:/sbin/agetty 38400 tty3 linux

c4:12345:respawn:/sbin/agetty 38400 tty4 linux

c5:12345:respawn:/sbin/agetty 38400 tty5 linux

c6:12345:respawn:/sbin/agetty 38400 tty6 linux

# What to do at the "Three Finger Salute".

ca:12345:ctrlaltdel:/sbin/shutdown -r now

# Used by /etc/init.d/xdm to control DM startup.

# Read the comments in /etc/init.d/xdm for more

# info. Do NOT remove, as this will start nothing

# extra at boot if /etc/init.d/xdm is not added

# to the "default" runlevel.

x:a:once:/etc/X11/startDM.sh

# End of /etc/inittab

```

Is there anything wrong with it?  :Embarassed: 

----------

## phsdv

 *Hikaru79 wrote:*   

> Is there anything wrong with it?

 Nope, nothing... I have the same. 

It looks your system going to "init 1" instead of "init 0" for a shutdown, very strange. Does the same thing happen when you do this from a console (without X11)? And after it stops and you press <enter> you still have the prompt? If you have, you are really in init 1.

----------

## nizar

 *phsdv wrote:*   

>  *Hikaru79 wrote:*   Is there anything wrong with it? Nope, nothing... I have the same. 
> 
> It looks your system going to "init 1" instead of "init 0" for a shutdown, very strange. Does the same thing happen when you do this from a console (without X11)? And after it stops and you press <enter> you still have the prompt? If you have, you are really in init 1.

 

Exactly the problem that I have  :Sad: 

usually shutting kdm fails and nothing happens, I press ENTER and I have the prompt again! Another reboot/shutdown does the reboot/shutdown.

Any ideas

TIA

----------

## phsdv

I just had a look at the c-code of shutdown.c, it will show to which runlevel it will go:

```
  /* Tell users what we're gonna do. */

  switch(down_level[0]) {

   case '0':

      strcpy(newstate, "for system halt");

      break;

   case '6':

      strcpy(newstate, "for reboot");

      break;

   case '1':

      strcpy(newstate, "to maintenance mode");

      break;

   default:

      sprintf(newstate, "to runlevel %s", down_level);

      break;

  }
```

Do you see eny of those messages?

Also you should really try:

```
shutdown -h now
```

 see following code:

```
 /* Process the options. */

  while((c = getopt(argc, argv, "acqkrhnfFyt:g:i:")) != EOF) {

     switch(c) {

                ....

        case 'r': /* Automatic reboot */

         down_level[0] = '6';

           break;

        case 'h': /* Halt after shutdown */

         down_level[0] = '0';

           break;

                ....
```

after that it will call the init process with the runlevel to go to:

```
  /* Now execute init to change runlevel. */

  sync();

  execv(INIT, args);
```

Can you check if

```
 init 0
```

 as root will halt your system?

----------

## Gentoo-Ed

sorry for "budging in" like this

I have the same problem too. In when I do init 0 instead of shutdown my system is neetly turned off. Wonder why shutdown doesn't.

----------

## phsdv

Hoi Ed, We really do not know. Does "shutdown -h" help? What messages do you have when you do a shutdown?

----------

## Gentoo-Ed

I did the shutdown with " shutdown -h" or " shutdown -h now".

Both don't get any error messages at all.

If wan't I can provide the entire sequence of messages (I'll just hook up the laptop next to the screen and type it over".

Fortunatly it isn't really anoying because I know init 0 does work.

I'll keep toggleing it between installations of other software.

Turn off by button doesn't work

----------

