[PLUG] Power off on shutdown: Slackware-9.1

Brian Horan bhoran at hexdev.com
Thu Oct 16 19:06:01 UTC 2003


or you could compile the following code into setuid-root executable
called 'emacs'.....

--------------------------------
#include <unistd.h>
#include <sys/reboot.h>
#include <stdio.h>

/* see reboot(2) for details on this */


int main(void)
{
	unsigned int ttl = 0xA;
	(void)printf("The system will power off in %d seconds\n\a",ttl);
	sync();
	sync();
	sync(); /* a third one for good luck */
	(void)sleep(ttl);
	reboot(0x4321FEDC);
	return 0x0;
}
--------------------------------------


On Thu, 2003-10-16 at 21:25, Rich Shepard wrote:
> On Thu, 16 Oct 2003, Mark Morgan wrote:
> 
> > While poweroff or for that matter "shutdown -h now" will power the system
> > off, it still needs to be supported by the BIOS and after that the kernel.
> 
> Mark,
> 
>   The BIOS is so set.
> 
> > If APM, then you need the apm modules loaded.  I forget what the APIC
> > equivalent might be.
> 
>   It may well be that apmd is not loading. I'll check tomorrow.
> 
> Thanks,
> 
> Rich
> 
> Dr. Richard B. Shepard, President
> 
>                        Applied Ecosystem Services, Inc. (TM)
>             2404 SW 22nd Street | Troutdale, OR 97060-1247 | U.S.A.
>  + 1 503-667-4517 (voice) | + 1 503-667-8863 (fax) | rshepard@appl-ecosys.com
>                          http://www.appl-ecosys.com/
> 
> _______________________________________________
> PLUG mailing list
> PLUG at lists.pdxlinux.org
> http://lists.pdxlinux.org/mailman/listinfo/plug
-- 
Brian Horan <bhoran at hexdev.com>





More information about the PLUG mailing list