@badbetty
My original post was initially longer and I considered to edit it to protect your already "screwed neurons", cut some introductory details and links, and also due to the fact that I got myself bored reading through it
. I'm sorry now about that as I see you're still a little bit confused and "obsessively" focused on the shutdown command.
First, some basic HW facts about the BIOS / PM / APM / ACPI:
- the BIOS has it's own HW PM subsystem that is independent and autonomous, powered even if the computer is powered off but still connected to the power line / has a charged battery in case of a mobile computer.
https://en.wikipedia.org/wiki/Power_management
- this BIOS PM autonomous subsystem has an interface (API) implemented to connect and communicate with the operating system (Windows/Linux/MacOS...etc) which is called APM (first implementation) and ACPI (latest implementation):
https://en.wikipedia.org/wiki/Advanced_power_management
https://en.wikipedia.org/wiki/Advanc...ower_Interface
Focusing only on Linux and its kernel (Slackware in our case), you should realize that there were a lot of changes during its development, first covering APM and lately ACPI. That's why you'll find a lot of obsolete/confusing information on the Internet.
To understand the
old shutdown command and how it works I can provide you with some clues:
- again, the shutdown command is by itself
not designed to handle directly the APM/ACPI but only to call the init system (process) which in turn is executing the Linux system shutdown script and provide (pass over) it with the variable (option) with which shutdown was executed. In Slackware's case this shutdown script is /etc/rc.d/rc.6
- a short excerpt from the shutdown man page covering the -H switch:
HALT OR POWEROFF
The -H option just sets the init environment variable INIT_HALT to HALT, and the -P option just sets that variable to POWEROFF. The shutdown script that calls halt(8) as the last thing in the shutdown sequence should check these environment variables and call halt(8) with the right options for these options to actually have any effect. Debian 3.1 (sarge) supports this.
- the snippet of /etc/rc.d/rc.6 that handles the shutdown command an its variable:
Code:
# Now halt (poweroff with APM or ACPI enabled kernels) or reboot.
if [ "$shutdown_command" = "reboot" ]; then
echo "Rebooting."
/sbin/reboot
else
/sbin/poweroff
fi
- as you can see, in case of a shutdown it is calling /sbin/poweroff which is telling the BIOS (through the APMD/ACPID - kernel support)to cut the power
For what you want to achieve, you have two options, either shut down the system entirely with the shutdown command and use the BIOS WoL capabilities to handle the wake up and loading of the OS. This is the most simple and safe alternative.
Or, use the more "exotic" power states like suspend to RAM or hibernation, from which states the system is recovering faster (doesn't need to boot and load the OS), by calling them through APM/ACPI, in which the system is not really powered off but in a very low power consuming state, and use pm-utils to trigger them. Even in this case you still need to configure (turn on) the WoL capabilities in BIOS. Additional to this PM call you need to set your NIC to enable and accept WoL under Linux. As stated above, the shutdown command isn't of any help here because it only tells init what to do and not the BIOS (through APM/ACPI).
Just to make sure your neurons are "unscrewed", I'm detailing (again) the way this OS-BIOS communication is done nowadays.
The ACPI support is implemented (embedded) in the kernel and is controllable through the /sys/power/ directory and the acpid daemon - the most appropriate tools to talk to this system are the pm-tools. Obviously, if you know what you're doing, you can manually tune the power states by editing the values in /sys/power/ but I wouldn't encourage that:
https://www.kernel.org/doc/Documenta.../interface.txt
https://www.kernel.org/doc/Documenta...-debugging.txt
A last note, if you go for hibernation on Slackware, then you need to setup a partition where the RAM contents will be saved and you should follow this guide:
https://docs.slackware.com/howtos:sl...in:hibernation