Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Performing commands upon going to sleep
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Gentoo on PPC
View previous topic :: View next topic  
Author Message
shr1nk
Tux's lil' helper
Tux's lil' helper


Joined: 21 Jun 2003
Posts: 90

PostPosted: Tue Jan 13, 2004 3:19 pm    Post subject: Performing commands upon going to sleep Reply with quote

I have a powerbook G4 running the 2.4.22-behn-r4 kernel on a powerbook G4 1Ghz Titanium.

Is there a way to perform commands before the laptop goes to sleep?

i.e. I want to perform some bash commands just immediately before the laptop is put to sleep. Namely the following commands:

(1) as root, /etc/init.d/samba stop
(2) as root /etc/init.d/sshd stop

and when the laptop wakes,

(1) as root, /etc/init.d/samba start
(2) as root /etc/init.d/sshd start


is this possible?
Back to top
View user's profile Send private message
nephros
Advocate
Advocate


Joined: 07 Feb 2003
Posts: 2139
Location: Graz, Austria (Europe - no kangaroos.)

PostPosted: Tue Jan 13, 2004 5:03 pm    Post subject: Reply with quote

Take a look at acpid and its config files in /etc/acpid/*. The scripts there allow you to fill in those things.
I am pretty sure the will be executed as root.

This assumes your lappie goes to sleep through ACPI of course, I don't know about APM, but I guess something similar is possible with apmd.

I don't know about the wake-up part either, but if all else fails, use a cron script which polls for the daemon processes :)
_________________
Please put [SOLVED] in your topic if you are a moron.
Back to top
View user's profile Send private message
shr1nk
Tux's lil' helper
Tux's lil' helper


Joined: 21 Jun 2003
Posts: 90

PostPosted: Wed Jan 14, 2004 3:30 am    Post subject: Reply with quote

doh'...
im using APM with my powerbook...

any ideas?
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Gentoo on PPC All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum