2
# lxc containers starter script
3
# based on skeleton from Debian GNU/Linux
6
# Required-Start: $syslog $remote_fs
7
# Required-Stop: $syslog $remote_fs
8
# Default-Start: 2 3 4 5
10
# Short-Description: Linux Containers
11
# Description: Linux Containers
15
PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin
18
SCRIPTNAME="/etc/init.d/lxc"
20
. /lib/lsb/init-functions
22
if [ -f /etc/default/$NAME ] ; then
26
if [ "x$RUN" != "xyes" ] ; then
27
log_success_msg "$NAME init script disabled; edit /etc/default/$NAME"
33
if [ -f "$CONF_DIR/$name.conf" ]; then
34
lxc-start -n $name -f $CONF_DIR/$name.conf -d
36
log_failure_msg "Can't find config file $CONF_DIR/$name.conf"
43
for i in $CONTAINERS; do
44
[ -n "$nolog" ] || log_progress_msg "$i"
47
[ -n "$nolog" ] || log_end_msg 0
52
log_daemon_msg "Starting $DESC"
56
log_daemon_msg "Stopping $DESC"
57
action_all "lxc-stop -n"
60
log_daemon_msg "Restarting $DESC"
62
action_all "lxc-stop -n"
65
log_daemon_msg "Destroying $DESC"
66
action_all "lxc-destroy -n"
69
log_daemon_msg "Freezing $DESC"
70
action_all "lxc-freeze -n"
73
log_daemon_msg "Unfreezing $DESC"
74
action_all "lxc-unfreeze -n"
77
log_daemon_msg "Info on $DESC" "$NAME"
79
action_all "lxc-info -n" "nolog"
82
log_success_msg "Usage: $SCRIPTNAME {start|stop|force-reload|restart|destroy|freeze|unfreeze|info}"