LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 07-24-2006, 01:02 PM   #1
ric
LQ Newbie
 
Registered: Jul 2006
Distribution: Slackware
Posts: 3

Rep: Reputation: 0
differentiate poweroff from halt


There are times when both poweroff and halt are needed. Since we have remote KVM access, a "halted' system can be restarted with a Control-Alt-Delete remotely. However a poweroff'ed system requires a site visit.

The convoluted shutdown path (halt and poweroff both call shutdown which runs rc.0 which calls poweroff again, and this time it powers off the system because of the run-level, if ACPI permits). The net effect of this on our hardware is
a) if ACPI is enabled, "shutdown -h", "halt", and "poweroff"
all remove power.
b) if ACPI is disabled, then all of these commands halt the
system.

The problem for me is that I need "halt" to halt the system so C-A-D can reboot it, and I need "poweroff" to remove power.

Before I spin my wheels trying to design a fix for this, has anyone else run into and solved this problem?
--
 
Old 07-24-2006, 01:46 PM   #2
PCPbSlack
LQ Newbie
 
Registered: Sep 2005
Distribution: Slackware 10.2 & 11
Posts: 11

Rep: Reputation: 0
I am not an expert, but if you want to restart your computer remotely why don't you use "reboot" command?
 
Old 07-24-2006, 02:58 PM   #3
johnson_steve
Senior Member
 
Registered: Apr 2005
Location: BrewCity, USA (Milwaukee, WI)
Distribution: Xubuntu 9.10, Gentoo 2.6.27 (AMD64), Darwin 9.0.0 (arm)
Posts: 1,152

Rep: Reputation: 46
shutdown -h and halt are supposed to poweroff the system (I believe just using poweroff itself you may be shutting it down improperly.) by disabling ACPI you remove the computers ability to power itself off. you may be able to edit the shutdown script and comment out the part that calls poweroff. then with ACPI enabled it should halt just like it did without APCI because it won't call poweroff.
 
Old 07-25-2006, 10:09 AM   #4
ric
LQ Newbie
 
Registered: Jul 2006
Distribution: Slackware
Posts: 3

Original Poster
Rep: Reputation: 0
A clarification

I guess I didn't make something clear. I need BOTH poweroff AND halt, depending on the situation.

For example, when the back end SAN is scheduled for maintenance, halting the connected systems is sufficient, and its easy to restart them via remote KVM (using C-A-D) when the SAN people have left the building (and been gone for at least an hour).

However, if a fan failure or an over-temperature condition is detected, powering off the system is the best thing to do to minimize harm to the system.

FYI, poweroff is a symlink to halt, and is processed the same way as "halt -p". Both run the shutdown script /etc/rc.d/rc.0 (unless -[fh] is given), so there is nothing "improper" about poweroff.
 
Old 07-25-2006, 12:06 PM   #5
johnson_steve
Senior Member
 
Registered: Apr 2005
Location: BrewCity, USA (Milwaukee, WI)
Distribution: Xubuntu 9.10, Gentoo 2.6.27 (AMD64), Darwin 9.0.0 (arm)
Posts: 1,152

Rep: Reputation: 46
Quote:
Originally Posted by ric
I guess I didn't make something clear. I need BOTH poweroff AND halt, depending on the situation.

For example, when the back end SAN is scheduled for maintenance, halting the connected systems is sufficient, and its easy to restart them via remote KVM (using C-A-D) when the SAN people have left the building (and been gone for at least an hour).

However, if a fan failure or an over-temperature condition is detected, powering off the system is the best thing to do to minimize harm to the system.

FYI, poweroff is a symlink to halt, and is processed the same way as "halt -p". Both run the shutdown script /etc/rc.d/rc.0 (unless -[fh] is given), so there is nothing "improper" about poweroff.
I got that. I'm saying halt is supposed to turn the computer off what you are calling halted is the system stuck in runlevel 0 because it can't turn itself off.

to do what you want you might be able to edit some of your shutdown scripts so that you would have a way to get it to not turn itself off. or go buy one of those thingys that is like a big powerstrip but you control the switch remotely.

I said 'you may be shutting it down improperly.' different things are implimented different ways on different distros. I would have no way of knowing without being in front of a slackware system or knowing from personal experiance. Gentoo doesn't even use the /etc/rc.d init script system. and my man page for power off says:
Quote:
If halt or reboot is called when the system is not in runlevel 0 or 6,
in other words when it's running normally, shutdown will be invoked
instead (with the -h or -r flag).
with poweroff clearly omitted.

The last thing I wanted to do was give you advise that could lead to filesystem corruption.
 
Old 07-25-2006, 12:51 PM   #6
cwwilson721
Senior Member
 
Registered: Dec 2004
Location: In my house.
Distribution: Ubuntu 10.10 64bit, Slackware 13.1 64-bit
Posts: 2,649
Blog Entries: 1

Rep: Reputation: 66
I understand what you're trying to do, ric.

Looking into it, maybe, kinda, sorta. I unfortunately don't have a KVM switch to experiment on my trash box with.

Helps to have a Slackware advice instead of from another distro that is setup different, too.

Any Slackware gurus out there that can give this guy a hand?
 
Old 07-25-2006, 08:04 PM   #7
Shade
Senior Member
 
Registered: Mar 2003
Location: Burke, VA
Distribution: RHEL, Slackware, Ubuntu, Fedora
Posts: 1,418
Blog Entries: 1

Rep: Reputation: 46
How about rebooting the machine and keeping it at the lilo prompt until you want it 'restarted' ?

Simple, I know... but something in my gut tells me this is about to get over-engineered

-- Shade

P.S. - there are network controlled power switches out there, too. I think someone mentioned this above as well.
 
  


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
[help]: Poweroff & halt edison Linux - General 3 03-16-2005 10:40 AM
halt or poweroff permission for users salahuddin_66 Slackware 6 04-23-2004 05:13 AM
Halt, but no poweroff frzburn Slackware 4 02-19-2004 07:58 PM
poweroff will not halt system ceph Linux - General 1 11-06-2003 03:44 PM
halt/poweroff quirks saturn_vk Linux - Hardware 3 03-27-2003 03:05 PM

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

All times are GMT -5. The time now is 01:34 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
Open Source Consulting | Domain Registration