On 1 Mar 2002, Miguel Garcia Lopez wrote: > Hello all, > > I would like to know if there is any kernel mechanism to change the > runlevel of my machine. I am working on a -sort of- watchdog module and > would like to be able to nicely reboot my machine if any process does > not refresh it (as if I gave a "shutdown -r now" command). Is there such > a way? I have tried machine_restart(NULL), but it does a "hard" reboot. Should be done in userland (its handled by init), and the kernel should not have to know about these kinds of things. Then again if things were so fubared that a process with the watchdog died, then you're not bound to be able to shutdown cleanly anyway. > Also, I am very interested on being able to retreive current system > time in a human-readable form (YY/MM/DD hh:mm:ss). Is is possible to do > so within kernel space? If not, maybe someone could give some hint on > how to do it using "gettimeofday and friends" functions. Also should be done in userland, why would you need to have pretty printed time for anyway? Regards, Zwane -- Kernelnewbies: Help each other learn about the Linux kernel. Archive: http://mail.nl.linux.org/kernelnewbies/ IRC Channel: irc.openprojects.net / #kernelnewbies Web Page: http://www.kernelnewbies.org/