Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 306195 Details for
Bug 409189
app-emulation/lxc-0.8.0_rc2-r1 : add {pre,post}{up,down} capabilities to init script [patch]
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
lxc init script's patch
gentoo_409189_init.d.patch (text/plain), 1.72 KB, created by
Guillaume ZITTA
on 2012-03-21 15:59:12 UTC
(
hide
)
Description:
lxc init script's patch
Filename:
MIME Type:
Creator:
Guillaume ZITTA
Created:
2012-03-21 15:59:12 UTC
Size:
1.72 KB
patch
obsolete
>--- /usr/portage/app-emulation/lxc/files/lxc.initd 2011-10-19 19:51:48.000000000 +0200 >+++ /tmp/lxc 2012-03-21 16:57:47.000000000 +0100 >@@ -20,6 +20,23 @@ > > [ $CONTAINER != $SVCNAME ] && CONFIGFILE=${CONFIGFILE:-$(lxc_get_configfile)} > >+lxc_try_script() { >+ SCRIPT_TYPE=$1 >+ SCRIPT_NAME="" >+ if [ -f "/etc/lxc/${CONTAINER}.${SCRIPT_TYPE}" ]; then >+ SCRIPT_NAME="/etc/lxc/${CONTAINER}.${SCRIPT_TYPE}" >+ elif [ -f "/etc/lxc/${CONTAINER}/${SCRIPT_TYPE}" ]; then >+ SCRIPT_NAME="/etc/lxc/${CONTAINER}/${SCRIPT_TYPE}" >+ fi >+ if [ "${SCRIPT_NAME}" != "" ] >+ then >+ ebegin "Starting ${SCRIPT_NAME}" >+ ${SCRIPT_NAME} >+ eend $? >+ fi >+} >+ >+ > lxc_get_var() { > awk 'BEGIN { FS="[ \t]*=[ \t]*" } $1 == "'$1'" { print $2; exit }' ${CONFIGFILE} > } >@@ -91,6 +108,8 @@ > ELFCLASS64:ELFCLASS32:) setarch=linux32;; > esac > >+ lxc_try_script preup >+ > ebegin "Starting ${CONTAINER}" > env -i ${setarch} $(type -p lxc-start) -l WARN -n ${CONTAINER} -f ${CONFIGFILE} -d -o /var/log/lxc/${CONTAINER}.log > sleep 0.5 >@@ -98,7 +117,9 @@ > # lxc-start -d will _always_ report a correct startup, even if it > # failed, so rather than trust that, check that the cgroup exists. > [ -d ${cgroupmount}/${CONTAINER} ] >- eend $? >+ started=$? >+ eend ${started} >+ [[ ${started} == 0 ]] && lxc_try_script postup > } > > stop() { >@@ -111,6 +132,7 @@ > return 0 > fi > >+ lxc_try_script predown > init_pid=$(lxc-info -n ${CONTAINER} --pid | cut -d: -f 2) > > if [ "${init_pid}" = "-1" ]; then >@@ -135,5 +157,7 @@ > > ebegin "Stopping ${CONTAINER}" > lxc-stop -n ${CONTAINER} >- eend $? >+ stopped=$? >+ eend ${stopped} >+ [[ ${stopped} == 0 ]] && lxc_try_script postdown > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 409189
:
306193
|
306195
|
325520