mirror of
https://dev.iopsys.eu/feed/iopsys.git
synced 2025-12-10 07:44:50 +01:00
swmodd: run lxc as service containers
This commit is contained in:
parent
22daedac3c
commit
5f967edb5b
2 changed files with 31 additions and 2 deletions
|
|
@ -5,13 +5,13 @@
|
||||||
include $(TOPDIR)/rules.mk
|
include $(TOPDIR)/rules.mk
|
||||||
|
|
||||||
PKG_NAME:=swmodd
|
PKG_NAME:=swmodd
|
||||||
PKG_VERSION:=2.3.3
|
PKG_VERSION:=2.4.0
|
||||||
|
|
||||||
LOCAL_DEV:=0
|
LOCAL_DEV:=0
|
||||||
ifneq ($(LOCAL_DEV),1)
|
ifneq ($(LOCAL_DEV),1)
|
||||||
PKG_SOURCE_PROTO:=git
|
PKG_SOURCE_PROTO:=git
|
||||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/lcm/swmodd.git
|
PKG_SOURCE_URL:=https://dev.iopsys.eu/lcm/swmodd.git
|
||||||
PKG_SOURCE_VERSION:=f73adba35daa8e24b7f28dc73eb58f53761a0d3b
|
PKG_SOURCE_VERSION:=cd1b40094b46e8223d13253e4bc41a8a2f000cf1
|
||||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||||
PKG_MIRROR_HASH:=skip
|
PKG_MIRROR_HASH:=skip
|
||||||
endif
|
endif
|
||||||
|
|
|
||||||
|
|
@ -14,6 +14,34 @@ is_container_running() {
|
||||||
return $?
|
return $?
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
configure_lxc_container() {
|
||||||
|
local requested_state name ctype du_status BUNDLE
|
||||||
|
|
||||||
|
ctype="${1}"
|
||||||
|
name="${2}"
|
||||||
|
requested_state="${3}"
|
||||||
|
du_state="${4}"
|
||||||
|
BUNDLE="${5}"
|
||||||
|
|
||||||
|
if [ "${ctype}" != "lxc" ]; then
|
||||||
|
return 0;
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "${du_status}" = "Uninstalling" ]; then
|
||||||
|
lxc-stop -q -k "${name}"
|
||||||
|
if [ -d "${BUNDLE:?}/${name:?}" ]; then
|
||||||
|
rm -rf "${BUNDLE:?}/${name:?}"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "${requested_state}" = "Idle" ]; then
|
||||||
|
lxc-stop -q -k "${name}"
|
||||||
|
elif [ "${requested_state}" = "Active" ]; then
|
||||||
|
lxc-start -q "${name}" >/dev/null 2>&1
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
configure_crun_container() {
|
configure_crun_container() {
|
||||||
local name type autostart du_status requested_state url username password
|
local name type autostart du_status requested_state url username password
|
||||||
local BRIDGE BUNDLE BOOT
|
local BRIDGE BUNDLE BOOT
|
||||||
|
|
@ -38,6 +66,7 @@ configure_crun_container() {
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "${type}" != "crun" ]; then
|
if [ "${type}" != "crun" ]; then
|
||||||
|
configure_lxc_container "${type}" "${name}" "${requested_state}" "${du_status}" "${BUNDLE}"
|
||||||
return 0;
|
return 0;
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue