Ticket #202: 0006-add-lxc-support.patch

File 0006-add-lxc-support.patch, 4.4 KB (added by www.google.com/accounts/o8/id?id=aitoawkdrfjwkw0m08vjwopkly4ntpup9sqnoeq, 10 months ago)
  • init.d/fsck.in

    diff --git a/init.d/fsck.in b/init.d/fsck.in
    index 68cdf14..279e25c 100644
    a b _IFS=" 
    99depend() 
    1010{ 
    1111        use dev clock modules 
    12         keyword -jail -openvz -prefix -timeout -vserver 
     12        keyword -jail -openvz -prefix -timeout -vserver -lxc 
    1313} 
    1414 
    1515_abort() { 
  • init.d/hwclock.in

    diff --git a/init.d/hwclock.in b/init.d/hwclock.in
    index ea9fa34..e99900f 100644
    a b depend() 
    2828        else 
    2929                before * 
    3030        fi 
    31         keyword -openvz -prefix -uml -vserver -xenu 
     31        keyword -openvz -prefix -uml -vserver -xenu -lxc 
    3232} 
    3333 
    3434setupopts() 
  • init.d/localmount.in

    diff --git a/init.d/localmount.in b/init.d/localmount.in
    index 89a4801..a4d1116 100644
    a b depend() 
    88{ 
    99        need fsck 
    1010        use lvm modules mtab 
    11         keyword -jail -openvz -prefix -vserver 
     11        keyword -jail -openvz -prefix -vserver -lxc 
    1212} 
    1313 
    1414start() 
  • init.d/modules.in

    diff --git a/init.d/modules.in b/init.d/modules.in
    index c2270ff..7c0b993 100644
    a b description="Loads a user defined list of kernel modules." 
    77depend() 
    88{ 
    99        use isapnp 
    10         keyword -openvz -prefix -vserver 
     10        keyword -openvz -prefix -vserver -lxc 
    1111} 
    1212 
    1313start() 
  • init.d/mount-ro.in

    diff --git a/init.d/mount-ro.in b/init.d/mount-ro.in
    index 45e0fab..69032d7 100644
    a b description="Re-mount filesytems read-only for a clean reboot." 
    77depend() 
    88{ 
    99        need killprocs savecache 
    10         keyword -prefix -openvz -vserver 
     10        keyword -prefix -openvz -vserver -lxc 
    1111} 
    1212 
    1313start() 
  • init.d/numlock.in

    diff --git a/init.d/numlock.in b/init.d/numlock.in
    index 9d88fa0..7bf3dc7 100644
    a b ttyn=${rc_tty_number:-${RC_TTY_NUMBER:-12}} 
    99depend() 
    1010{ 
    1111        need localmount 
    12         keyword -openvz -prefix -vserver 
     12        keyword -openvz -prefix -vserver -lxc 
    1313} 
    1414 
    1515_setleds() 
  • init.d/procfs.in

    diff --git a/init.d/procfs.in b/init.d/procfs.in
    index 712adc2..2b73bd7 100644
    a b depend() 
    88{ 
    99        use modules devfs 
    1010        need localmount 
    11         keyword -openvz -prefix -vserver 
     11        keyword -openvz -prefix -vserver -lxc 
    1212} 
    1313 
    1414start() 
  • init.d/root.in

    diff --git a/init.d/root.in b/init.d/root.in
    index 6dc37c8..0689060 100644
    a b description="Mount the root fs read/write" 
    77depend() 
    88{ 
    99        need fsck 
    10         keyword -jail -openvz -prefix -vserver 
     10        keyword -jail -openvz -prefix -vserver -lxc 
    1111} 
    1212 
    1313start() 
  • init.d/swap.in

    diff --git a/init.d/swap.in b/init.d/swap.in
    index 564531b..d99b9b8 100644
    a b  
    55depend() 
    66{ 
    77        need localmount 
    8         keyword -jail -openvz -prefix -vserver 
     8        keyword -jail -openvz -prefix -vserver -lxc 
    99} 
    1010 
    1111start() 
  • init.d/swclock.in

    diff --git a/init.d/swclock.in b/init.d/swclock.in
    index 2d091fe..3357fc7 100644
    a b depend() 
    88{ 
    99        before * 
    1010        provide clock 
    11         keyword -openvz -prefix -uml -vserver -xenu 
     11        keyword -openvz -prefix -uml -vserver -xenu -lxc 
    1212} 
    1313 
    1414# swclock is an OpenRC built in 
  • man/runscript.8

    diff --git a/man/runscript.8 b/man/runscript.8
    index a3e1f2e..f380617 100644
    a b When in a jail, exclude this service from any dependencies. The service can 
    143143still be run directly. 
    144144.It Dv -openvz 
    145145Same as -jail, but for OpenVZ systems. 
     146.It Dv -lxc 
     147Same as -jail, but for Linux Resource Containers (LXC). 
    146148.It Dv -shutdown 
    147149Don't stop this service when shutting the system down. 
    148150This normally quite safe as remaining daemons will be sent a SIGTERM just 
  • src/librc/librc.c

    diff --git a/src/librc/librc.c b/src/librc/librc.c
    index 96e3195..34bd9e1 100644
    a b rc_sys(void) 
    233233                return RC_SYS_VSERVER; 
    234234        else if (exists("/proc/vz/veinfo") && !exists("/proc/vz/version")) 
    235235                return RC_SYS_OPENVZ; 
     236        else if (file_regex("/proc/self/cgroup", ":/.+$")) 
     237                return RC_SYS_LXC; 
    236238        else if (file_regex("/proc/self/status", 
    237239                "envID:[[:space:]]*[1-9]")) 
    238240                return RC_SYS_OPENVZ; /* old test */ 
  • src/librc/rc.h.in

    diff --git a/src/librc/rc.h.in b/src/librc/rc.h.in
    index 373f1d1..4b7977e 100644
    a b bool rc_service_daemons_crashed(const char *); 
    268268 * Some services cannot work in these systems, or we do something else. */ 
    269269#define RC_SYS_JAIL    "JAIL" 
    270270#define RC_SYS_OPENVZ  "OPENVZ" 
     271#define RC_SYS_LXC     "LXC" 
    271272#define RC_SYS_PREFIX  "PREFIX" 
    272273#define RC_SYS_UML     "UML" 
    273274#define RC_SYS_VSERVER "VSERVER"