[PATCH] alpine linux initpost

Natanael Copa <[email protected]>
Newsgroups gmane.linux.vserver
Message-ID <CAJT+8exK76DuvzoracccmQWdnUqChZtLasQkL5ZCG5DpzzLU8w@mail.gmail.com>
Hi,

Alpine linux switched to openrc (like gentoo) several years ago.

The attached patch adds support for that in initpost. It would be nice
it it could be applied upstream.

I would also like to mention that Alpine Linux ships a vserver
"livecd", which can run the vserver "host" root from tmpfs. It means
that you can boot your vserver kernel and from cdrom/CF/USB run the
host's root filesystem from tmpfs, and have the disks dedicated for
the vservers. (the config is stored in a file thats read at boot)

Benefit with that is that you can log in to the host and run the host
tools, even if one of the guests manages to block the disk IO
completely.

Another nice thing with Alpine Linux is that the base system is very
small, 6.1MB for a 64 bit guest and 5.9MB for 32 bit, so each new
alpine linux vserver adds very little overhead and all resources are
used for the application you want run in there. (mailservers,
webservers database etc)

Basically all infrastructure for alpine linux (web page, bug tracker
mysql, postresql, email server, build servers, development build
servers) runs vserver.

Thanks!

-- 
Natanael Copa
alpine.patch (text/x-diff, 867 B)
Index: distrib/alpine/initpost
===================================================================
--- a/distrib/alpine/initpost	(revision 2855)
+++ b/distrib/alpine/initpost	(working copy)
@@ -1,6 +1,6 @@
 #!/bin/bash
 
-# Copyright (C) 2007 Natanael Copa <[email protected]>
+# Copyright (C) 2007, 2012 Natanael Copa <[email protected]>
 #  
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -37,7 +37,12 @@
 $_VSERVER "$vserver" stop  &>/dev/null || true
 $_VSERVER "$vserver" start --rescue --rescue-init /bin/busybox sh -c '
 	/bin/busybox --install -s
-	/sbin/rc_add -s 20 -k syslog
+	if [ -x /sbin/rc-update ]; then
+		/sbin/rc-update add syslog boot
+		/bin/rmdir /etc/rcL.d /etc/rcK.d
+	else
+		/sbin/rc_add -s 20 -k syslog
+	fi
 '
 
 # set up hostname
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.