LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (http://www.linuxquestions.org/questions/slackware-14/)
-   -   Slackware-current need a double reboot command to really reboot the system (http://www.linuxquestions.org/questions/slackware-14/slackware-current-need-a-double-reboot-command-to-really-reboot-the-system-4175426836/)

sardinha 09-12-2012 05:31 AM

Slackware-current need a double reboot command to really reboot the system
 
Hello,

If I run reboot ou halt command on the system, it's only terminate some processes and doesn't finish the reboot.
Output from messages log:
Quote:

shutdown[1872]: shutting down for system reboot
init: Switching to runlevel: 6
init: no more processes left in this runlevel
Then after ran again reboot command the system finishing the reboot.

To really reboot I'm using a double command:
Code:

# reboot && reboot
Anyone with the same problem with current version (64-bits)?

Thank you.

Pedro Correia Sardinha

Celyr 09-12-2012 05:39 AM

I'm not going to say that
Code:

# reboot
has not to be used but
Code:

# shutdown -r now
it's safer (and well, it works).
The behavior of
Code:

# reboot
changes if you are on a specific runlevel I find shutdown to be more consistent.
BTW: what you are doing with
Code:

# reboot && reboot
it's evil, read the reboot manual for clarification.
I have slackware-current and reboot it's working as expected, Maybe you messed up with rc scripts ?

tronayne 09-12-2012 05:47 AM

...and if you really want to do it quick and clean (as root, su -, sudo):
Code:

init 6
Or, take it to single-user mode
Code:

init 1
do some stuff (like updates) then
Code:

init 6
And life is good.

Oops, forgot shut it off:
Code:

init 0
Hope this helps some.

Celyr 09-12-2012 05:51 AM

His rc.6 is "damaged" I think, what's the output of
Code:

# ls -lash /etc/rc.d/rc.6

sardinha 09-12-2012 06:00 AM

Thank you Celery and tronayne for your replies.

Resulting no difference by running:
Code:

# shutdown -r now

Code:

# ls -lash /etc/rc.d/rc.6
Give this output:
8.0K -rwxr-xr-x 1 root root 7.6K Aug 15 00:03 /etc/rc.d/rc.6

Thank you.

Celyr 09-12-2012 06:01 AM

then it's your inittab, please attach the result of
Code:

# cat /etc/inittab

sardinha 09-12-2012 06:11 AM

1 Attachment(s)
Celyr,

Attached inittab!

Thank you.

Celyr 09-12-2012 06:33 AM

It looks ok.
try
Code:

$ md5sum /etc/rc.d/rc.6
d3b597a1a0c0b1891dc613da9cdb20d3  /etc/rc.d/rc.6

my is vanilla, if your it's not same as mine you may want to get it back with
Code:

# slackpkg reinstall sysvinit-scripts
your inittab has CRLF newline
Code:

# Runlevel 6 reboots the system.^M$
l6:6:wait:/etc/rc.d/rc.6^M$
^M$

do a
Code:

cat -A /etc/inittab
to make sure it's a copy paste issue :) you should not see any ^M

sardinha 09-12-2012 07:21 AM

3 Attachment(s)
Thank you for all suggestions, but It was my mistake with default system rc scripts. Sorry! In this case I modified rc.samba, a month ago, changing rc.samba script to run samba4 AD. I don't searched what the default system is doing in reboot process to start and stop samba3, I just believed that using samba4 rc script as rc.samba could simplify, wrong! Because I'm using samba4 for serving an Active Directory, I had to do it in other way. The resolution was revert the samba4 rc script to rc.samba4, then starting rc.samba4 at boot in rc.local, and stop in rc.local_shutdown.

Thank you.

guanx 09-12-2012 09:43 AM

Since long ago there were discussions why children rc's should be called
1) with the "sh" prefix such as "sh /etc/rc.d/rc.wicd start"
2) with a "." prefix

Has there been any conlusions apart from the negligible performance gain by 2)?

I believe 2) easily messes things up, while 1) just stores one piece of information twice in two places (the command line in the caller and the shebang of the callee).

tronayne 09-12-2012 12:36 PM

You only need to do the sh shell_prog_name if shell_prog_name is not executable; if it is, just type the name and optional argument. You (c|w)ould
Code:

chmod 755 /etc/rc.d/rc.wicd
and problem solved.

What the dot-space prefix does is to execute a shell program in the current environment; the shell does not execute the program in a new PID, it executes in the current PID. What that does is allow you to modify your current environment if desired -- any environment variables set in a dot-space execution will remain set in the current environment.

Just for grins, the "rc" comes from DEC days (like the PDP line), means "run command." The boyos at Bell Labs built Unix on DEC PDP's and, gee, wonder why the used rc, eh?

Hope this helps some.

guanx 09-12-2012 03:19 PM

Quote:

Originally Posted by tronayne (Post 4778702)
...

Hope this helps some.

Sorry I meant to ask why they are there and not what they are.


All times are GMT -5. The time now is 11:31 AM.