start init.d scripts before a chroot script using schroot?
Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
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.
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.