LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   system hanging on 'Saving random seed' (https://www.linuxquestions.org/questions/linux-newbie-8/system-hanging-on-saving-random-seed-241874/)

PennyroyalFrog 10-12-2004 04:47 PM

system hanging on 'Saving random seed'
 
When I do a shutdown command my system hangs on 'Saving random seed... [ok]' when shutting down... it does not do this with a reboot command... i'm using gentoo. any ideas how to fix this?

scotepi 09-27-2005 09:28 PM

same
 
im having the same problome and having it on 2 different gentoo computers. and solution for this would be nice

scotepi 09-30-2005 10:22 PM

anyone know whats up?

Dark_Helmet 09-30-2005 11:45 PM

I don't use Gentoo, so you these instructions may require some footwork/translation on your part, but it shoudl be minimal.

First thing I would do is check out your startup/shutdown scripts. There's usually a single directory that holds all of them: /etc/rc.d/init.d (this may be one of those translation things). There should also be a series of directories labeled rcX.d in /etc/rc.d. X is a number going from 0 to 6. That number specifies a runlevel. When the system changes run levels, it executes the contents of the appropriate rcX.d directory. Those directories contain symbolic links back to /etc/rc.d/init.d. Confusing, I know, but hold on.

Shutting down the machine is a switch to runlevel 0. Rebooting the machine is a switch to runlevel 6. Look at the contents of the two directories for differences. Because you say the problem shows up only on a shutdown and not a reboot, it's likely that /etc/rc.d/rc0.d will have more links than /etc/rc.d/rc6.d.

Now, try to find out which script is responsible for saving the volume information. You can probably do that with this command:
Code:

grep -l "Saving random seed" /etc/rc.d/init.d/*
Look at the symbolic links in the rc0.d directory to find out which symbolic link points to that script. It's probably something like "K45random". Once you find it, look for the next "K" symbolic link. It may be "K46something", "K50something", or even "K99something". That next little bugger might be your problem. See if it has a corresponding entry in rc6.d. If not, that's a pretty strong indication it's why you see it on hatl and not reboot. You'll have to examine the script it points to and debug what it's doing and why it might cause the hang.

Can't be much more help than that without more info. Sorry.

scotepi 10-01-2005 10:44 AM

i cant find the rc directories but i can list everything at different runlevels and if needed remove them. the only thing that looks like it could be it is urandom.

but when i ran the grep on /etc/init.d/ i also got urandom.

Dark_Helmet 10-01-2005 10:59 AM

That sounds like a reasonable name for the script. I assume urandom is an actual file in /etc/init.d and not a link?

You could try this command to find the symbolic links:
Code:

find /etc -type l -iname "*urandom"
Just to be thorough, that's a lower case 'L' and not a '1' after the type option.

If none of that gets you any closer, then go ahead and list out what happens during a switch to runlevel 0 and a switch to runlevel 6. There should be a difference. If anything, it should also give you a clue about the hanging script's name. The prime suspects are any scripts after urandom.

EDIT:
A quick search told me that Gentoo keeps some startup info in /etc/runlevels, but I'm not sure how it relates to /etc/init.d. I'm guessing they are the equivalent of the rcX.d directories.

scotepi 10-01-2005 11:20 AM

k so it's a sym link to /etc/init.d and i checked on tohers and they were the same

Code:

lrwxrwxrwx  1 root root 35 Aug 13 08:38 /etc/runlevels/boot/urandom -> /tmp/stage1root//etc/init.d/urandom

Dark_Helmet 10-01-2005 11:34 AM

Ok, so how does Gentoo enforce ordering? There's got to be some organization or file somewhere that specifies what sequence the scripts run in. What scripts get executed in what order when shutting down? What about rebooting?

scotepi 10-01-2005 11:41 AM

the init files have dependances in their config's and at boot it does calculating dependanceys. guessin thats how

Dark_Helmet 10-01-2005 02:45 PM

For the love of... I have one question for the Gentoo maintainers: "Why?!?!"

Alright my friend, here's the deal. I went to the Gentoo website to pull up their documentation. This is just my opinion, but they needlessly overcomplicated the booting process, and that's going to make it tough for you to figure out what exactly is going on.

I'm sure you already know this, but halting the system pulls its scripts from /etc/runlevels/shutdown. Rebooting pulls its scripts from /etc/runlevels/reboot. That's about as easy as it's going to get.

You'll need to pull out a pen and paper or open a text editor for the next part. The scripts in those directories will be executed in alphabetical order. As you saw though, each script can have dependencies. So what you need to do is map out the sequence of what gets called from start to finish for both halt and reboot. That's going to be a pain in the arse because dependencies may have dependencies, etc. If, for example, you looked at the script for sendmail, it might a dependency on the dhcp script. So the sequence would be dhcp->sendmail, but you'll have to examine dhcp to see if it has dependencies (like network). So the full sequence would be network->dhcp->sendmail.

Anyway, once you've contructed the list, compare the shutdown and reboot sequences. Look at the stop() portion of the scripts called after urandom in the halt sequence. Your problem is going to be there. You'll have to manually check each one. If there's a command to display text in one of them, you know the problem is happening between the end of urandom and the display attempt. Focus your attention there. If you look at the scripts and need some help, post them, and I'll do my best to help out.

EDIT:
I don't have a man page for rc-update, but it might help figure out the order. The documentation refers to using
Code:

rc-update show
to show all scripts and which runlevels execute them. There may be an option to specify what the sequence is for a specific runlevel. Check your man page to see.


All times are GMT -5. The time now is 02:35 AM.