LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 01-25-2006, 10:51 AM   #1
magic_ghost
LQ Newbie
 
Registered: Jan 2006
Location: Oxford, England
Distribution: Mandrake 2006
Posts: 14

Rep: Reputation: 0
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?
 
Old 01-25-2006, 10:57 AM   #2
paragn
Member
 
Registered: Jan 2006
Distribution: Red Hat EL5, Fedora 7
Posts: 259

Rep: Reputation: 30
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
 
Old 01-25-2006, 10:59 AM   #3
paragn
Member
 
Registered: Jan 2006
Distribution: Red Hat EL5, Fedora 7
Posts: 259

Rep: Reputation: 30
i forgot to tell you check for source rpm
 
Old 01-25-2006, 11:09 AM   #4
magic_ghost
LQ Newbie
 
Registered: Jan 2006
Location: Oxford, England
Distribution: Mandrake 2006
Posts: 14

Original Poster
Rep: Reputation: 0
Linux shutdown

Thanks for the suggestions, I searched for SysVinit-2.85-34.src.rpm on google and downloaded the source RPM.
 
Old 01-25-2006, 11:14 AM   #5
paragn
Member
 
Registered: Jan 2006
Distribution: Red Hat EL5, Fedora 7
Posts: 259

Rep: Reputation: 30
good now extract it you will find source under /usr/src/redhat/SOURCES if you have any RH OS
 
Old 01-26-2006, 06:36 PM   #6
magic_ghost
LQ Newbie
 
Registered: Jan 2006
Location: Oxford, England
Distribution: Mandrake 2006
Posts: 14

Original Poster
Rep: Reputation: 0
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...
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Linux source-code tejprakash_kolla Linux - General 2 10-29-2005 05:54 PM
Get Source Code for Linux seventhsense Linux - Software 6 07-12-2005 05:44 AM
good C code source for linux acidjuice Programming 4 04-13-2005 05:56 PM
where i will get the source code of Linux?? and ... nazib Linux - General 1 02-16-2005 03:28 AM
Where to download linux source code JSuresh Linux - General 7 02-21-2003 12:08 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

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

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration