mirror of
https://git.proxmox.com/git/mirror_lxc
synced 2025-07-14 09:18:23 +00:00

- move action() from common to sysvinit wrapper since its only really applicable for sysvinit and not the other init systems - fix bug in action() fallback, need to shift away msg before executing action - make lxc-net 98 so it starts before lxc-container (99), otherwise the lxcbr0 won't be available when containers are autostarted - make the default RUNTIME_PATH be /var/run instead of /run. On older distros (like ol6.5) /run doesn't exist. lxc-net will create this directory and attempt to create the dnsmasq.pid file in it, but this will fail when SELinux is enabled because the directory will have the default_t type. Newer systems have /var/run symlinked to /run so you get to the same place in that case. - add %postun to remove lxc-dnsmasq user when pkgs are removed - fix bug in lxc-oracle template that was creating /var/lock/subsys/lxc as a dir and interfering with the init scripts Signed-off-by: Dwight Engen <dwight.engen@oracle.com> Acked-by: Stéphane Graber <stgraber@ubuntu.com>
62 lines
1.1 KiB
Bash
62 lines
1.1 KiB
Bash
#!/bin/sh -
|
|
#
|
|
# lxc-net Start/Stop LXC Networking
|
|
#
|
|
# chkconfig: 345 98 01
|
|
# description: Starts/Stops LXC Network Bridge
|
|
#
|
|
### BEGIN INIT INFO
|
|
# Provides: lxc-net
|
|
# Default-Start: 2 3 4 5
|
|
# Default-Stop: 1
|
|
# Short-Description: Bring up/down LXC Network Bridge
|
|
# Description: Bring up/down LXC Network Bridge
|
|
### END INIT INFO
|
|
|
|
sysconfdir="@SYSCONFDIR@"
|
|
|
|
# Source function library.
|
|
test ! -r "$sysconfdir"/rc.d/init.d/functions ||
|
|
. "$sysconfdir"/rc.d/init.d/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() {
|
|
action $"Starting LXC network bridge: " @LIBEXECDIR@/lxc/lxc-net start
|
|
}
|
|
|
|
stop() {
|
|
action $"Stopping LXC network bridge: " @LIBEXECDIR@/lxc/lxc-net stop
|
|
}
|
|
|
|
# See how we were called.
|
|
case "$1" in
|
|
start)
|
|
start
|
|
;;
|
|
|
|
stop)
|
|
stop
|
|
;;
|
|
|
|
restart|reload|force-reload)
|
|
$0 stop
|
|
$0 start
|
|
;;
|
|
|
|
*)
|
|
echo "Usage: $0 {start|stop|restart|reload|force-reload}"
|
|
exit 2
|
|
;;
|
|
esac
|
|
|
|
exit $?
|