| View previous topic :: View next topic |
| Author |
Message |
destroyedlolo Guru

Joined: 17 Jun 2011 Posts: 374 Location: Close to Annecy
|
Posted: Thu Apr 12, 2012 2:49 pm Post subject: Mounting file system only for particular runlevels |
|
|
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
Thanks
Laurent |
|
| Back to top |
|
 |
BoneKracker Veteran


Joined: 14 Mar 2006 Posts: 1480 Location: U.S.A.
|
Posted: Wed Apr 18, 2012 4:21 pm Post subject: |
|
|
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 |
|
 |
destroyedlolo Guru

Joined: 17 Jun 2011 Posts: 374 Location: Close to Annecy
|
Posted: Thu Apr 19, 2012 8:10 am Post subject: |
|
|
It's what I did
Bye |
|
| Back to top |
|
 |
BoneKracker Veteran


Joined: 14 Mar 2006 Posts: 1480 Location: U.S.A.
|
Posted: Thu Apr 19, 2012 12:17 pm Post subject: |
|
|
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 |
|
 |
destroyedlolo Guru

Joined: 17 Jun 2011 Posts: 374 Location: Close to Annecy
|
Posted: Thu Apr 19, 2012 2:28 pm Post subject: |
|
|
My question was to know if there is a smart way.
Is any smarter way ? |
|
| Back to top |
|
 |
BoneKracker Veteran


Joined: 14 Mar 2006 Posts: 1480 Location: U.S.A.
|
Posted: Fri Apr 20, 2012 3:07 pm Post subject: |
|
|
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 |
|
 |
|