Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
init.d: when suspending?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
psdasilva
Apprentice
Apprentice


Joined: 03 Sep 2005
Posts: 239

PostPosted: Fri Aug 24, 2007 2:46 am    Post subject: init.d: when suspending? Reply with quote

Hi.

I need to write a init script (/etc/init.d) that can distinguish between the normal shutdown and suspending.
I am using suspend2/hibernate script.

Is there a simple way to do this?

Thanks.

Paulo
Back to top
View user's profile Send private message
Veldrin
Veteran
Veteran


Joined: 27 Jul 2004
Posts: 1945
Location: Zurich, Switzerland

PostPosted: Fri Aug 24, 2007 6:59 am    Post subject: Reply with quote

My guess is, your are looking for hibernate-scripts: a collection of scripts, which takes down some init-scripts before suspending, and restoring them at resume.

If not, could you elaborate what you want to do.

cheers
V.
Back to top
View user's profile Send private message
psdasilva
Apprentice
Apprentice


Joined: 03 Sep 2005
Posts: 239

PostPosted: Fri Aug 24, 2007 2:04 pm    Post subject: Reply with quote

Yes. I know that I can write 2 scripts: one to put in the default runlevel and the other to be fired by the hibernate script. But there may be something I can check so that I can put everything in one script only.

Code:

if [ <is suspending> ]; then
    # suspending
    ...
else
    # normal shutdown
    ...
fi
Back to top
View user's profile Send private message
beatryder
Veteran
Veteran


Joined: 08 Apr 2005
Posts: 1138

PostPosted: Fri Aug 24, 2007 4:45 pm    Post subject: Reply with quote

no, he means the hibernate-script package.
_________________
Dont make it idiot proof, make it work.
Neucode.org
<suppressed key>
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo 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