LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (http://www.linuxquestions.org/questions/linux-software-2/)
-   -   start init.d scripts before a chroot script using schroot? (http://www.linuxquestions.org/questions/linux-software-2/start-init-d-scripts-before-a-chroot-script-using-schroot-751972/)

arobinson74 09-02-2009 12:10 AM

start init.d scripts before a chroot script using schroot?
 
I am trying to get a chroot environment up that uses autofs inside the chroot that governs nfs mounts. It is a laptop, so I don't want the nfs mounts running when not at work, so I don't want to kick off the scripts in /etc/rc.local

I was looking into the schroot command-prefix and the exec.d support. exec.d looked good, but it is run outside the chroot, not inside where I need it.

I also wonder about schroot and its "session" idea. I wonder if I start a schroot session with "dchroot -c TEST /etc/init.d/autofs start", will I need to use the same chroot session later to ensure that I get access to the running automount processes?

No solution seems clean to me unless there is a way to run a script inside of the chroot using schroot/dchroot, but I do not see one, only to run one just before entering the chroot. I can probably use command-prefix, but that seems really messy to be passing the command to a script then to have to execute those args.

Is there a cleaner way that I am missing?

unSpawn 10-11-2009 04:05 PM

Quote:

Originally Posted by arobinson74 (Post 3666327)
It is a laptop, so I don't want the nfs mounts running when not at work, so I don't want to kick off the scripts in /etc/rc.local

If you want to have different configurations for different locations you could look into Debian packages like whereami, ifplugd or laptop-net. At least one of them (ifplugd, IIRC) should have custom hooks to enable you to run custom scripts, else they probably can be easily adapted to make NFS work in one location and bar it from running in another.


All times are GMT -5. The time now is 05:08 PM.