[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Daemons in schroot or how to start chroot automatically



Hi all

I have some questions about starting daemons in a chroot environment or 
rather about starting schroot on bootup.
The reason I want to do this is to clean up my server. It's a Squeeze 
with an AMD64 kernel from backports. Some packages are from testing which 
gives me problems because of dependencies that can't be fullfilled: 
sabnzbdplus from testing depends on python so I can't install build-
essential...

So far I was able to setup a chroot with schroot and installed sid in it.
What I did:

Mounted a 327G partition to /srv
and created a new directory /srv/chroot/sid

Edited /etc/schroot/schroot.conf

[sid]
description=Debian sid (unstable)
directory=/srv/chroot/sid
users=hoferr
groups=hoferr
root-groups=root
aliases=unstable,default

Installed sid
$ sudo debootstrap sid /srv/chroot/sid/ http://ftp.ch.debian.org/debian/

Entered the chroot with
$ sudo schroot -p -c sid

Installed locales and reconfigured them. I also installed vim.
I noticed that auto-completion isn't working.
What packages should I install? Is auto-complete-el sufficient or is 
there a meta package for some base system packages?

In the chroot I have created a new user called hoferr and am now able to 
login without root privilieges.
But in there sudo is missing. Maybe this can be resolved by installing 
the correct base system meta package mentioned above?


Aside some missing packages everything looks promising.
To get back to my main reason of doing this: After stopping the "old" 
sabnzbdplus can I just install the chroot sabnzbplus with the "normal" 
home partition mounted? It will probably start automatically when the 
chroot is started and I should be able to access its web service from the 
LAN.

But how can I start the chroot on bootup automatically. i probably just 
have to write a init.d script and do a update.rc.

Is this enough as init.d script?
http://pastebin.com/raw.php?i=hHSvG30v

Or should I use the skeleton?
If yes what are the Required-Start/Stop variables?
And should I then just create a DAEMON script in /usr/sbin with the 
following content?

#! /bin/sh
schroot -c sid





Best regards
Ramon


Reply to: