Re: [vserver] prefered way to add a support for a new distro

From: Daniel Hokka Zakrisson <daniel_at_hozac.com>
Date: Fri 03 Aug 2007 - 14:23:47 BST
Message-ID: <47746.192.168.102.6.1186147427.squirrel@intranet>

Natanael Copa wrote:
> On Fri, 2007-08-03 at 14:41 +0200, Daniel Hokka Zakrisson wrote:
>> Natanael Copa wrote:
>> > Hi,
>> >
>> > I'd like to add support for my distro alpinelinux.
>> >
>> > Currently to install a guest I need to:
>> >
>> > vserver myguest build --iniststyle sysv ... -m skeleton albootstrap
>> > /vservers/myguest
>> > echo "/etc/init.d/rcL" > /etc/vservers/myguest/apps/init/cmd.start
>> > echo "/etc/init.d/rcK" > /etc/vservers/myguest/apps/init/cmd.stop
>> > echo "killall5" >> /etc/vservers/myguest/apps/init/cmd.stop
>>
>> You want it to run /etc/init.d/rcK killall5 on stop?
>
> I want to execute /etc/init.d/rcK and when that is done I'd like to run
> killall5 in case some process is not stopped with rcK.

Well, that's not what it's doing. Why aren't you just running killall5 at
the end of rcK? (Also note that util-vserver will kill all processes in a
guest if they're still around after the stop process is completed.)

>> > echo "kernel.grsecurity.chroot_caps = 0" >> /etc/sysctl.conf
>> > rm /vservers/myguest/etc/mtab
>> > chroot /vserver/myguest rc_add -s 20 -k syslog
>> >
>> > (the ablootstrap script basicly downloads and unpacks a base.tar.bz2
>> > file)
>> >
>> > Now, my question is, how is the prefered way to add support for
>> alpine?
>> > should I use -d alpine -m template with base.tar.bz2 and put the other
>> > stuff in a /usr/lib/util-vserver/distributions/alpine dir or should I
>> > create a new -m albootstrap like debootstrap?
>> >
>> > Natanael Copa
>>
>> Depends on what you want, I guess. -m template doesn't download
>> anything.
>> Regardless of the method you choose, the other things should be in an
>> initpost script. (Well, not the sysctl.conf modification.)
>
> I'm trying to do the -m template right now. Is there somehwere I can put
> app/init/cmd.{start,stop} scripts for a distro rather than for an
> individual vserver config? Or should I just create cmd.{start,stop} from
> the initpost?

Yes. See e.g. the gentoo distribution for an example of how to change the
configuration from the initpost script.

> The sysctl.conf modification is for the vserver host so it should not go
> with the vserver guest scripts anyway. Maybe a check + notification to
> user that he will need to tweak the grsec params but thats not your
> problem.
>
> Thanks!
>
> Natanael Copa

-- 
Daniel Hokka Zakrisson
Received on Fri Aug 3 14:24:14 2007
[Next/Previous Months] [Main vserver Project Homepage] [Howto Subscribe/Unsubscribe] [Paul Sladen's vserver stuff]
Generated on Fri 03 Aug 2007 - 14:24:18 BST by hypermail 2.1.8