Quote:
Originally Posted by Sergei Steshenko
Take the source of 'poweroff' command and find the answer there.
|
Quote:
Originally Posted by unSpawn
...else please show us what you've got already (if "trying" means you actually tried to code anything) and what the errors are, if any.
|
With great enthusiasm, I vote for
A.
At least on Slackware, this command (issued while logged in as root so that the
PATH environment variable would have a convenient variable)
Code:
file $(which poweroff)
produced:
Code:
/sbin/poweroff: symbolic link to `halt'
Ok, then. It's the same program that does both, and it probably examines
argv[0] to determine whether to power off or simply halt. So:
produced:
Code:
/sbin/halt: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), stripped
Now I was getting somewhere.
I explored the source, and discovered that if you have the appropriate man pages installed and you do this at the command line:
then all will be revealed.
Hope this helps.