Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Mounting file system only for particular runlevels
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
destroyedlolo
Guru
Guru


Joined: 17 Jun 2011
Posts: 374
Location: Close to Annecy

PostPosted: Thu Apr 12, 2012 2:49 pm    Post subject: Mounting file system only for particular runlevels Reply with quote

Hello,

Is it a smart way to mount some file system only for a particular runlevel ?

The story behind is I'm running Gentoo in VirtualBox on my professional PC, and I may or not launch a webserver.
So,
  • in default runlevel, I don't start a webserver so /web mustn't be mounted
  • in webserver runlevel, I would like to mount /web and to start apache.

For the moment, I've created an init.d script only linked with webserver runlevel, but I wonder if there is any smartest way :wink:

Thanks

Laurent
Back to top
View user's profile Send private message
BoneKracker
Veteran
Veteran


Joined: 14 Mar 2006
Posts: 1480
Location: U.S.A.

PostPosted: Wed Apr 18, 2012 4:21 pm    Post subject: Reply with quote

Another way would be to create an init.d script and then make it a depdency of your webserver's init.d script.

For example, if your script to mount /web is named /etc/init.d/mount_web, then in your webserver's init script you could add a "need" statement to the dependencies:
Code:
depend() {
    need mount_web
}

This way, the filesystem will always be mounted before the webserver is started, and the webserver cannot start if the filesystem cannot be mounted.
_________________
Oldthinkers unbellyfeel INGSOC.
-- Headline of a document on Winston Smith's terminal in his cubicle at the Ministry of Truth, seen briefly in the background in one scene of the movie rendition of Nineteen Eighty-Four.
Back to top
View user's profile Send private message
destroyedlolo
Guru
Guru


Joined: 17 Jun 2011
Posts: 374
Location: Close to Annecy

PostPosted: Thu Apr 19, 2012 8:10 am    Post subject: Reply with quote

It's what I did :)

Bye
Back to top
View user's profile Send private message
BoneKracker
Veteran
Veteran


Joined: 14 Mar 2006
Posts: 1480
Location: U.S.A.

PostPosted: Thu Apr 19, 2012 12:17 pm    Post subject: Reply with quote

Put "[Solved]" in the threat title.
_________________
Oldthinkers unbellyfeel INGSOC.
-- Headline of a document on Winston Smith's terminal in his cubicle at the Ministry of Truth, seen briefly in the background in one scene of the movie rendition of Nineteen Eighty-Four.
Back to top
View user's profile Send private message
destroyedlolo
Guru
Guru


Joined: 17 Jun 2011
Posts: 374
Location: Close to Annecy

PostPosted: Thu Apr 19, 2012 2:28 pm    Post subject: Reply with quote

My question was to know if there is a smart way.

Is any smarter way ?
Back to top
View user's profile Send private message
BoneKracker
Veteran
Veteran


Joined: 14 Mar 2006
Posts: 1480
Location: U.S.A.

PostPosted: Fri Apr 20, 2012 3:07 pm    Post subject: Reply with quote

Yes. The smarter way is for you to study rc systems and figure it out for yourself.
_________________
Oldthinkers unbellyfeel INGSOC.
-- Headline of a document on Winston Smith's terminal in his cubicle at the Ministry of Truth, seen briefly in the background in one scene of the movie rendition of Nineteen Eighty-Four.
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