summaryrefslogtreecommitdiffstats
path: root/main/lxc/lxc.initd
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2014-02-27 20:25:44 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2014-02-27 20:25:44 +0000
commit590666635836b89d298e44d7764b3cdb34dd722b (patch)
treee955f31184952e40f06fe5b07e6f35cdf3e7dd8c /main/lxc/lxc.initd
parent5de16cbe0d926037839ed12d3a8b5adff657e688 (diff)
downloadaports-590666635836b89d298e44d7764b3cdb34dd722b.tar.bz2
aports-590666635836b89d298e44d7764b3cdb34dd722b.tar.xz
main/lxc: improve init script
Use lxc-wait instead of letting start-stop-daemon look for the pid. This should speed up the startup with up to 500ms.
Diffstat (limited to 'main/lxc/lxc.initd')
-rw-r--r--main/lxc/lxc.initd11
1 files changed, 4 insertions, 7 deletions
diff --git a/main/lxc/lxc.initd b/main/lxc/lxc.initd
index ae844872a..298051f1f 100644
--- a/main/lxc/lxc.initd
+++ b/main/lxc/lxc.initd
@@ -61,29 +61,26 @@ start() {
ebegin "Starting container ${CONTAINER}"
start-stop-daemon --start $command \
--pidfile $pidfile \
- --wait 500 \
-- \
--daemon \
--pidfile $pidfile \
--name ${CONTAINER} \
--rcfile ${CONFIGFILE} \
--logpriority WARN \
- --logfile /var/log/lxc/${CONTAINER}.log
+ --logfile /var/log/lxc/${CONTAINER}.log \
+ || eend $? || return $?
+ lxc-wait -n ${CONTAINER} -t 5 -s RUNNING
eend $?
}
stop() {
checkconfig || return 1
- ebegin "Shutting down system in container ${CONTAINER}"
+ ebegin "Stopping container ${CONTAINER}"
start-stop-daemon --stop --pidfile ${pidfile} \
--retry ${POWEROFF_SIGNAL:-SIGUSR2}/${TIMEOUT:-30} \
--progress
eend $?
-
- ebegin "Stopping containter ${CONTAINER}"
- lxc-stop -n ${CONTAINER}
- eend $?
}
reboot() {