LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Linux shutdown - source code (https://www.linuxquestions.org/questions/linux-software-2/linux-shutdown-source-code-407822/)

magic_ghost 01-25-2006 09:51 AM

Linux shutdown - source code
 
Hello, I am in the process of writing a small program which emulates a timer. I'm having real trouble working out how to set the timer and letting it run for x number of seconds. When I use shutdown, I notice that the user is able to specify a time period before the computer is shutdown.

What I want to do is look at the source code for shutdown and see how they've done it. So the question is: Where can I find the source code for the Linux shutdown command?

paragn 01-25-2006 09:57 AM

hi,
you have not specified which OS? so assuming you are seeking for RPM check for latest RPM of SysVinit. on my RHEL4 i have SysVinit-2.85-34.3

paragn 01-25-2006 09:59 AM

i forgot to tell you check for source rpm

magic_ghost 01-25-2006 10:09 AM

Linux shutdown
 
Thanks for the suggestions, I searched for SysVinit-2.85-34.src.rpm on google and downloaded the source RPM.

paragn 01-25-2006 10:14 AM

good now extract it you will find source under /usr/src/redhat/SOURCES if you have any RH OS

magic_ghost 01-26-2006 05:36 PM

Linux shutdown source code
 
Hello, once again thanks for the help to those who responded.

I had a look at the source code for shutdown.c and was completely miffed as to the location of the time delay code.

It certainly isn't going to be asy working out how to code this timer program...


All times are GMT -5. The time now is 01:42 AM.