Re: [vserver] support for alpine linux guests

From: Daniel Hokka Zakrisson <daniel_at_hozac.com>
Date: Wed 29 Aug 2007 - 16:43:48 BST
Message-ID: <46D59434.70000@hozac.com>

Natanael Copa wrote:
> Thanks for you feedback. Really appreciated!
>
> On Mon, 2007-08-27 at 22:06 +0200, Daniel Hokka Zakrisson wrote:
>> Natanael Copa wrote:
>>> Hi,
>>>
>>> Alpine Linux is a distribution for secure light weight
>>> servers/firewalls, based on uclibc/busybox, built using Gentoo
>>> framework.
>>>
>>> Attatched is initpre and initpost scripts to allow easy installation of
>>> Alpine Linux guests. It is done in seconds. Create directory
>>> distributions/alpine and save the attatched files there.
>> Why is sysv the only supported initstyle? Why wouldn't plain work?
>
> layziness. It worked but init scripts needs some modifications and it
> looked pretty easy to make sysv working.
>
> I will look into fixing that.
>
>> Just using chroot to run things isn't okay, start the guest and execute
>> whatever commands are needed inside.
>
> just curious. why? (where is the documentation covering this that i
> missed?)

Breaking out of a chroot is very easy, see chroot(2).

>> For copying files into the guest, use chroot-sh truncate.
>>
>> Checking for grsec stuff in the initpost script is just wrong.
>
> ok. I will remove that.
>
>> For examples on how to do these things, just look at the redhat initpost
>> script.
>
> Looks pretty hackish. Since I'm the author of alpine I have the power to
> make the default scripts and things vserver friendly.
>
> To avoid the 'chroot "$vdir" /bin/busybox --install -s' I have the
> following options:
> * make sure template archive contains all it needs (running
> busybox --install -s before creating the emplate archive)
>
> * execute both /etc/init.d/rcS and /etc/init.d/rcL from
> cmd.start. (busybox --install -s is called from rcS)

You can only call one thing, so you'd have to make another script that
calls both of them.

> Which is preferred?

That's up to you...

> To avoid the 'chroot "$vdir" rc_add -s 20 -k syslog' it looks like a
> serious overkill to do the complicated "start vserver", "execute in
> vserver" and "stop vserver" as showed in redhat initpost. The only thing
> needed is to create 2 links in the chroot:
>
> ln -s ../init.d/syslog $vdir/etc/rcL.d/S20syslog
> ln -s ../init.d/syslog $vdir/etc/rcK.d/K20syslog
>
> How can that be easily done correctly without starting/stopping the
> vserver?

chroot-sh. IMHO starting the guest isn't a big deal, and is much nicer
if you ever want to add more commands.

> Natanael Copa

-- 
Daniel Hokka Zakrisson
Received on Wed Aug 29 16:44:04 2007
[Next/Previous Months] [Main vserver Project Homepage] [Howto Subscribe/Unsubscribe] [Paul Sladen's vserver stuff]
Generated on Wed 29 Aug 2007 - 16:44:11 BST by hypermail 2.1.8