diff options
author | Roy Marples <roy@marples.name> | 2008-03-03 17:19:56 +0000 |
---|---|---|
committer | Roy Marples <roy@marples.name> | 2008-03-03 17:19:56 +0000 |
commit | 15cf41e7131cebbb74241180f36f59384c7a0477 (patch) | |
tree | 30accca041088b161a4d5cfcb731dcd40a496868 | |
parent | f3e90dddbfcf838b653846cce7fd2be479c68900 (diff) |
Split VPS into VSERVER and OPENVZ
-rw-r--r-- | init.d.Linux/clock.in | 2 | ||||
-rw-r--r-- | init.d.Linux/consolefont.in | 2 | ||||
-rw-r--r-- | init.d.Linux/keymaps.in | 2 | ||||
-rw-r--r-- | init.d.Linux/modules.in | 2 | ||||
-rw-r--r-- | init.d.Linux/numlock.in | 2 | ||||
-rw-r--r-- | init.d.Linux/procfs.in | 2 | ||||
-rw-r--r-- | init.d.Linux/sysctl.in | 2 | ||||
-rw-r--r-- | init.d/bootmisc.in | 2 | ||||
-rw-r--r-- | init.d/fsck.in | 2 | ||||
-rw-r--r-- | init.d/halt.sh.in | 2 | ||||
-rw-r--r-- | init.d/localmount.in | 5 | ||||
-rw-r--r-- | init.d/netmount.in | 2 | ||||
-rw-r--r-- | init.d/root.in | 2 | ||||
-rw-r--r-- | init.d/swap.in | 2 | ||||
-rw-r--r-- | man/runscript.8 | 8 | ||||
-rw-r--r-- | sh.Linux/init.sh.in | 10 | ||||
-rw-r--r-- | sh/net.sh.in | 2 | ||||
-rw-r--r-- | src/librc/librc.c | 7 | ||||
-rw-r--r-- | src/librc/rc.h | 3 | ||||
-rw-r--r-- | src/rc/rc.c | 4 |
20 files changed, 36 insertions, 29 deletions
diff --git a/init.d.Linux/clock.in b/init.d.Linux/clock.in index 88c61c79..0bb71980 100644 --- a/init.d.Linux/clock.in +++ b/init.d.Linux/clock.in @@ -28,7 +28,7 @@ depend() else before * fi - keyword noprefix nouml novps noxenu + keyword noopenvz noprefix nouml novserver noxenu } setupopts() diff --git a/init.d.Linux/consolefont.in b/init.d.Linux/consolefont.in index 4244180b..384004d0 100644 --- a/init.d.Linux/consolefont.in +++ b/init.d.Linux/consolefont.in @@ -9,7 +9,7 @@ depend() need localmount need keymaps # sets up terminal encoding scheme after hotplug - keyword noprefix nouml novps noxenu + keyword noopenvz noprefix nouml novserver noxenu } start() diff --git a/init.d.Linux/keymaps.in b/init.d.Linux/keymaps.in index bb601c6e..2079e049 100644 --- a/init.d.Linux/keymaps.in +++ b/init.d.Linux/keymaps.in @@ -15,7 +15,7 @@ dumpkeys_charset=${dumpkeys_charset:-${DUMPKEYS_CHARSET}} depend() { need localmount - keyword noprefix nouml novps noxenu + keyword noopenvz noprefix nouml novserver noxenu } start() diff --git a/init.d.Linux/modules.in b/init.d.Linux/modules.in index 3f0e0dab..b09620df 100644 --- a/init.d.Linux/modules.in +++ b/init.d.Linux/modules.in @@ -7,7 +7,7 @@ description="Loads a user defined list of kernel modules." depend() { use isapnp - keyword noprefix novps + keyword noopenvz noprefix novserver } start() diff --git a/init.d.Linux/numlock.in b/init.d.Linux/numlock.in index fd23ede8..1a71367e 100644 --- a/init.d.Linux/numlock.in +++ b/init.d.Linux/numlock.in @@ -9,7 +9,7 @@ ttyn=${rc_tty_number:-${RC_TTY_NUMBER}:-12} depend() { need localmount - keyword noprefix + keyword noopenvz noprefix novserver } _setleds() diff --git a/init.d.Linux/procfs.in b/init.d.Linux/procfs.in index d286ca94..a30fd92c 100644 --- a/init.d.Linux/procfs.in +++ b/init.d.Linux/procfs.in @@ -7,7 +7,7 @@ description="Mounts misc filesystems in /proc." depend() { need localmount - keyword noprefix + keyword noopenvz noprefix novserver } start() diff --git a/init.d.Linux/sysctl.in b/init.d.Linux/sysctl.in index 19408ca1..ad6b2a92 100644 --- a/init.d.Linux/sysctl.in +++ b/init.d.Linux/sysctl.in @@ -6,7 +6,7 @@ depend() { use hostname before bootmisc logger - keyword noprefix novps + keyword noopenvz noprefix novserver } start() diff --git a/init.d/bootmisc.in b/init.d/bootmisc.in index f98cf6b9..08f9cc57 100644 --- a/init.d/bootmisc.in +++ b/init.d/bootmisc.in @@ -113,7 +113,7 @@ start() [ -x /sbin/restorecon ] && restorecon /tmp/.ICE-unix /tmp/.X11-unix # Create an 'after-boot' dmesg log - if [ "${RC_SYS}" != "VPS" ]; then + if [ "${RC_SYS}" != "VSERVER" -a "${RC_SYS}" != "OPENVZ" ]; then dmesg > /var/log/dmesg chmod 640 /var/log/dmesg fi diff --git a/init.d/fsck.in b/init.d/fsck.in index 61aa947a..967eee37 100644 --- a/init.d/fsck.in +++ b/init.d/fsck.in @@ -9,7 +9,7 @@ _ISF=" depend() { after clock modules - keyword nojail noprefix notimeout + keyword nojail noopenvz noprefix notimeout novserver } _abort() { diff --git a/init.d/halt.sh.in b/init.d/halt.sh.in index 39dd4f4f..dca6815c 100644 --- a/init.d/halt.sh.in +++ b/init.d/halt.sh.in @@ -27,7 +27,7 @@ sync; sync # If we are in a VPS, we don't need anything below here, because # 1) we don't need (and by default can't) umount anything (VServer) or # 2) the host utils take care of all umounting stuff (OpenVZ) -if [ "${RC_SYS}" = "VPS" ]; then +if [ "${RC_SYS}" = "VSERVER" -o "${RC_SYS}" = "OPENVZ" ]; then if [ -e /etc/init.d/"$1".sh ]; then . /etc/init.d/"$1".sh else diff --git a/init.d/localmount.in b/init.d/localmount.in index 4c7d5fd4..9d95a8a0 100644 --- a/init.d/localmount.in +++ b/init.d/localmount.in @@ -8,7 +8,7 @@ depend() { need fsck use modules mtab - keyword nojail noprefix + keyword nojail noopenvz noprefix novserver } start() @@ -29,9 +29,6 @@ start() stop() { - # Don't unmount anything for VPS systems - [ "${RC_SYS}" = "VPS" ] && return 0 - # We never unmount / or /dev or $RC_SVCDIR local x= no_umounts="/|/dev|/dev/.*|${RC_SVCDIR}" diff --git a/init.d/netmount.in b/init.d/netmount.in index f136f45a..3219c83c 100644 --- a/init.d/netmount.in +++ b/init.d/netmount.in @@ -34,7 +34,7 @@ depend() config /etc/fstab need net ${pmap} use afc-client amd autofs dns nfs nfsmount portmap rpcbind rpc.statd - keyword nojail noprefix + keyword nojail noopenvz noprefix novserver } start() diff --git a/init.d/root.in b/init.d/root.in index da21db5c..c87b7f1b 100644 --- a/init.d/root.in +++ b/init.d/root.in @@ -7,7 +7,7 @@ description="Mount the root fs read/write" depend() { need fsck - keyword nojail noprefix + keyword nojail noopenvz noprefix novserver } start() diff --git a/init.d/swap.in b/init.d/swap.in index 0404af1e..f64ddc59 100644 --- a/init.d/swap.in +++ b/init.d/swap.in @@ -5,7 +5,7 @@ depend() { need localmount - keyword nojail noprefix + keyword nojail noopenvz noprefix novserver } start() diff --git a/man/runscript.8 b/man/runscript.8 index 79f957c6..1b9488f2 100644 --- a/man/runscript.8 +++ b/man/runscript.8 @@ -137,12 +137,14 @@ Tags a service with a keyword. Here's the keywords we currently understand:- .It Dv nojail When in a jail, exclude this service from any dependencies. The service can still be run directly. +.It Dv noopenvz +Same as nojail, but for OpenVZ systems. .It Dv notimeout Do not time out waiting for that service. .It Dv nouml Same as nojail, but for UML systems. -.It Dv novps -Same as nojail, but for VServer and OpenVZ systems. +.It Dv novserver +Same as nojail, but for VServer systems. .It Dv noxen0 Same as nojail, but for Xen DOM0 systems. .It Dv noxenu @@ -284,7 +286,7 @@ Boot runlevel chosen. Default is boot. Default runlevel chosen. Default is default. .It Va RC_SYS A special variable to describe the system more. -Possible values are XENU, XEN0, UML and VPS. +Possible values are OPENVZ, XENU, XEN0, UML and VSERVER. .It Va RC_UNAME The result of `uname -s`. .El diff --git a/sh.Linux/init.sh.in b/sh.Linux/init.sh.in index 90dbea82..190f8f17 100644 --- a/sh.Linux/init.sh.in +++ b/sh.Linux/init.sh.in @@ -65,7 +65,7 @@ mount_svcdir() # Set the console loglevel to 1 for a cleaner boot # the logger should anyhow dump the ring-0 buffer at start to the # logs, and that with dmesg can be used to check for problems -if [ -n "${dmesg_level}" -a "${RC_SYS}" != "VPS" ]; then +if [ -n "${dmesg_level}" -a "${RC_SYS}" != "VSERVER" ]; then dmesg -n "${dmesg_level}" fi @@ -108,7 +108,10 @@ if [ -r /sbin/livecd-functions.sh ]; then livecd_read_commandline fi -if [ "${RC_UNAME}" != "GNU/kFreeBSD" -a "${RC_SYS}" != "VPS" ]; then +if [ "${RC_UNAME}" != "GNU/kFreeBSD" \ + -a "${RC_SYS}" != "VSERVER" \ + -a "${RC_SYS}" != "OPENVZ" ] +then if grep -Eq "[[:space:]]+sysfs$" /proc/filesystems; then if [ -d /sys ]; then if ! mountinfo --quiet /sys; then @@ -128,7 +131,8 @@ fi # Try to figure out how the user wants /dev handled if [ "${rc_devices}" = "static" \ - -o "${RC_SYS}" = "VPS" \ + -o "${RC_SYS}" = "VSERVER" \ + -o "${RC_SYS}" = "OPENVZ" \ -o "${RC_UNAME}" = "GNU/kFreeBSD" ] then ebegin "Using existing device nodes in /dev" diff --git a/sh/net.sh.in b/sh/net.sh.in index 1fe52f19..1ad99983 100644 --- a/sh/net.sh.in +++ b/sh/net.sh.in @@ -21,7 +21,7 @@ depend() need localmount after bootmisc provide net - keyword nojail noprefix + keyword nojail noprefix novserver case "${IFACE}" in lo|lo0);; diff --git a/src/librc/librc.c b/src/librc/librc.c index 16b0f0b7..c6280d15 100644 --- a/src/librc/librc.c +++ b/src/librc/librc.c @@ -207,8 +207,11 @@ const char *rc_sys (void) } else if (file_regex ("/proc/cpuinfo", "UML")) return (RC_SYS_UML); else if (file_regex ("/proc/self/status", - "(s_context|VxID|envID):[[:space:]]*[1-9]")) - return (RC_SYS_VPS); + "(s_context|VxID):[[:space:]]*[1-9]")) + return (RC_SYS_VSERVER); + else if (file_regex ("/proc/self/status", + "envID:[[:space:]]*[1-9]")) + return (RC_SYS_OPENVZ); #endif return (NULL); diff --git a/src/librc/rc.h b/src/librc/rc.h index d2fde601..0b811f46 100644 --- a/src/librc/rc.h +++ b/src/librc/rc.h @@ -232,9 +232,10 @@ bool rc_service_daemons_crashed (const char *service); * OpenRC can support some special sub system types, normally virtualization. * Some services cannot work in these systems, or we do something else. */ #define RC_SYS_JAIL "JAIL" +#define RC_SYS_OPENVZ "OPENVZ" #define RC_SYS_PREFIX "PREFIX" #define RC_SYS_UML "UML" -#define RC_SYS_VPS "VPS" +#define RC_SYS_VSERVER "VSERVER" #define RC_SYS_XEN0 "XEN0" #define RC_SYS_XENU "XENU" const char *rc_sys (void); diff --git a/src/rc/rc.c b/src/rc/rc.c index 183c23c3..e1b7ac3d 100644 --- a/src/rc/rc.c +++ b/src/rc/rc.c @@ -289,8 +289,8 @@ static void sulogin (bool cont) #ifdef __linux__ char *e = getenv ("RC_SYS"); - /* VPS systems cannot do a sulogin */ - if (e && strcmp (e, "VPS") == 0) { + /* VSERVER and OPENVZ systems cannot do a sulogin */ + if (e && (strcmp (e, "VSERVER") == 0 || strcmp (e, "OPENVZ") == 0) { execl ("/sbin/halt", "/sbin/halt", "-f", (char *) NULL); eerrorx ("%s: unable to exec `/sbin/halt': %s", applet, strerror (errno)); } |