LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Linux From Scratch
User Name
Password
Linux From Scratch This Forum is for the discussion of LFS.
LFS is a project that provides you with the steps necessary to build your own custom Linux system.

Notices


Reply
  Search this Thread
Old 08-13-2009, 10:19 AM   #1
sanitynotvanity
Member
 
Registered: Jul 2007
Location: UK
Distribution: LFS 6.8, Android, Ubuntu 10.10, XP, 7 (HB,HP,Ultimate)
Posts: 41

Rep: Reputation: 15
How to extend the poweroff and reboot process? (without using sysvinit)


All I need to do is execute an additional command before the machine starts the halting process.

I had hoped to re-direct the symbolic links (reboot & poweroff) to my own halt bash script that would execute the additional command and then call halt.

but i soon realised that the process will always halt. which may not be the same as poweroff but certainly isn't the same as reboot!

I can't read the original halt program because its a binary (or i dont have an interpreter on my machine) - either way, i can't see the lady in red.

Luckily I found a snippet on the net, which explained that the halt program read the call to extract whether the file that called it was called reboot or poweroff and responded accordingly.

so then I replaced the symbolic links (reboot & poweroff) for two simple bash scripts that execute additional command and then call the halt script (self titled).

but this behaves exactly the same - reboot still does not reboot.


How else could i achieve this?

I have tried using the rc.0 and rc.6 zones in /etc/rc.d however, even at K00 the script does not get run soon enough.

background: this command unloads RTAI modules and kills the application that used them. if this is not done sooner the system will hang.

any ideas?

Cheers,

Andy

EDIT: RTAI means Real Time Application Interface

Last edited by sanitynotvanity; 08-13-2009 at 10:30 AM. Reason: Additional Info
 
Old 08-13-2009, 10:49 AM   #2
sanitynotvanity
Member
 
Registered: Jul 2007
Location: UK
Distribution: LFS 6.8, Android, Ubuntu 10.10, XP, 7 (HB,HP,Ultimate)
Posts: 41

Original Poster
Rep: Reputation: 15
I should have started this thread in the programming section, as its not LFS specific.

I do apologise

Could a MOD move it to somewhere more appropriate.

Cheers
 
Old 08-13-2009, 10:57 AM   #3
sanitynotvanity
Member
 
Registered: Jul 2007
Location: UK
Distribution: LFS 6.8, Android, Ubuntu 10.10, XP, 7 (HB,HP,Ultimate)
Posts: 41

Original Poster
Rep: Reputation: 15
Actually, can you just delete this

i have a new thread here :

http://www.linuxquestions.org/questi...4/#post3641932

cheers
 
  


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
reboot/poweroff how? demmylls Linux - General 2 08-13-2009 10:52 AM
Annoying message during reboot or poweroff janas03 Slackware 8 04-24-2008 06:05 AM
Panic; reboot/poweroff; 2.4.33.3 Tralce Linux - Kernel 0 12-04-2006 03:54 PM
reboot vs poweroff??? bigdog0007 Linux - Newbie 4 09-16-2005 03:48 AM
enabling poweroff/reboot for user YBA^[x] Slackware 11 12-13-2004 03:04 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Linux From Scratch

All times are GMT -5. The time now is 06:48 PM.

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
Open Source Consulting | Domain Registration