mirror of
https://git.proxmox.com/git/mirror_lxc
synced 2025-08-14 13:31:27 +00:00
Merge pull request #978 from evgeni/lsb-init-scripts
don't make sysv init scripts dependant on distribution specifics
This commit is contained in:
commit
1bf4292e3f
@ -17,30 +17,26 @@
|
|||||||
# Description: Bring up/down LXC autostart containers
|
# Description: Bring up/down LXC autostart containers
|
||||||
### END INIT INFO
|
### END INIT INFO
|
||||||
|
|
||||||
sysconfdir="@SYSCONFDIR@"
|
# To be replaced by LSB functions, if they can be found
|
||||||
|
# Defined here for distributions that don't have log_daemon_msg
|
||||||
|
log_daemon_msg () {
|
||||||
|
echo $@
|
||||||
|
}
|
||||||
|
|
||||||
# Source function library.
|
# Try to source LSB init functions to define LSB log_* functions.
|
||||||
test ! -r "$sysconfdir"/rc.d/init.d/functions ||
|
test ! -r /lib/lsb/init-functions ||
|
||||||
. "$sysconfdir"/rc.d/init.d/functions
|
. /lib/lsb/init-functions
|
||||||
|
|
||||||
# provide action() fallback
|
|
||||||
if ! type action >/dev/null 2>&1; then
|
|
||||||
# Real basic fallback for sysvinit "action" verbage.
|
|
||||||
action() {
|
|
||||||
echo -n "$1 "
|
|
||||||
shift
|
|
||||||
"$@" && echo "OK" || echo "Failed"
|
|
||||||
}
|
|
||||||
fi
|
|
||||||
|
|
||||||
start() {
|
start() {
|
||||||
# Setup host /dev for autodev containers.
|
# Setup host /dev for autodev containers.
|
||||||
@LIBEXECDIR@/lxc/lxc-devsetup
|
@LIBEXECDIR@/lxc/lxc-devsetup
|
||||||
action $"Starting LXC autoboot containers: " @LIBEXECDIR@/lxc/lxc-containers start
|
log_daemon_msg "Starting LXC autoboot containers: "
|
||||||
|
@LIBEXECDIR@/lxc/lxc-containers start
|
||||||
}
|
}
|
||||||
|
|
||||||
stop() {
|
stop() {
|
||||||
action $"Stopping LXC containers: " @LIBEXECDIR@/lxc/lxc-containers stop
|
log_daemon_msg "Stopping LXC containers: "
|
||||||
|
@LIBEXECDIR@/lxc/lxc-containers stop
|
||||||
}
|
}
|
||||||
|
|
||||||
# See how we were called.
|
# See how we were called.
|
||||||
|
@ -17,28 +17,24 @@
|
|||||||
# Description: Bring up/down LXC Network Bridge
|
# Description: Bring up/down LXC Network Bridge
|
||||||
### END INIT INFO
|
### END INIT INFO
|
||||||
|
|
||||||
sysconfdir="@SYSCONFDIR@"
|
# To be replaced by LSB functions, if they can be found
|
||||||
|
# Defined here for distributions that don't have log_daemon_msg
|
||||||
|
log_daemon_msg () {
|
||||||
|
echo $@
|
||||||
|
}
|
||||||
|
|
||||||
# Source function library.
|
# Try to source LSB init functions to define LSB log_* functions.
|
||||||
test ! -r "$sysconfdir"/rc.d/init.d/functions ||
|
test ! -r /lib/lsb/init-functions ||
|
||||||
. "$sysconfdir"/rc.d/init.d/functions
|
. /lib/lsb/init-functions
|
||||||
|
|
||||||
# provide action() fallback
|
|
||||||
if ! type action >/dev/null 2>&1; then
|
|
||||||
# Real basic fallback for sysvinit "action" verbage.
|
|
||||||
action() {
|
|
||||||
echo -n "$1 "
|
|
||||||
shift
|
|
||||||
"$@" && echo "OK" || echo "Failed"
|
|
||||||
}
|
|
||||||
fi
|
|
||||||
|
|
||||||
start() {
|
start() {
|
||||||
action $"Starting LXC network bridge: " @LIBEXECDIR@/lxc/lxc-net start
|
log_daemon_msg "Starting LXC network bridge: "
|
||||||
|
@LIBEXECDIR@/lxc/lxc-net start
|
||||||
}
|
}
|
||||||
|
|
||||||
stop() {
|
stop() {
|
||||||
action $"Stopping LXC network bridge: " @LIBEXECDIR@/lxc/lxc-net stop
|
log_daemon_msg "Stopping LXC network bridge: "
|
||||||
|
@LIBEXECDIR@/lxc/lxc-net stop
|
||||||
}
|
}
|
||||||
|
|
||||||
# See how we were called.
|
# See how we were called.
|
||||||
|
Loading…
Reference in New Issue
Block a user