mirror of
https://github.com/OpenRC/openrc.git
synced 2024-11-23 01:43:37 +08:00
Podman detection
This commit is contained in:
parent
bd18358134
commit
b94dc7d8ab
@ -168,6 +168,7 @@
|
||||
#
|
||||
# "" - nothing special
|
||||
# "docker" - Docker container manager (Linux)
|
||||
# "podman" - Podman container manager (Linux)
|
||||
# "jail" - Jail (DragonflyBSD or FreeBSD)
|
||||
# "lxc" - Linux Containers
|
||||
# "openvz" - Linux OpenVZ
|
||||
|
@ -15,7 +15,7 @@ depend()
|
||||
{
|
||||
after clock procfs
|
||||
use modules devfs
|
||||
keyword -docker -lxc -openvz -prefix -systemd-nspawn -vserver
|
||||
keyword -docker -podman -lxc -openvz -prefix -systemd-nspawn -vserver
|
||||
}
|
||||
|
||||
start()
|
||||
|
@ -15,7 +15,7 @@ description="Mount the control groups."
|
||||
|
||||
depend()
|
||||
{
|
||||
keyword -docker -prefix -systemd-nspawn -vserver
|
||||
keyword -docker -podman -prefix -systemd-nspawn -vserver
|
||||
after sysfs
|
||||
}
|
||||
|
||||
|
@ -15,7 +15,7 @@ depend()
|
||||
{
|
||||
need termencoding
|
||||
after hotplug bootmisc modules
|
||||
keyword -docker -lxc -openvz -prefix -systemd-nspawn -uml -vserver -xenu
|
||||
keyword -docker -podman -lxc -openvz -prefix -systemd-nspawn -uml -vserver -xenu
|
||||
}
|
||||
|
||||
start()
|
||||
|
@ -15,7 +15,7 @@ depend()
|
||||
{
|
||||
provide dev-mount
|
||||
before dev
|
||||
keyword -docker -prefix -systemd-nspawn -vserver
|
||||
keyword -docker -podman -prefix -systemd-nspawn -vserver
|
||||
}
|
||||
|
||||
mount_dev()
|
||||
|
@ -14,7 +14,7 @@ description="Set the dmesg level for a cleaner boot"
|
||||
depend()
|
||||
{
|
||||
before dev modules
|
||||
keyword -docker -lxc -prefix -systemd-nspawn -vserver
|
||||
keyword -docker -podman -lxc -prefix -systemd-nspawn -vserver
|
||||
}
|
||||
|
||||
start()
|
||||
|
@ -17,7 +17,7 @@ depend()
|
||||
{
|
||||
after clock
|
||||
use dev clock modules
|
||||
keyword -docker -jail -lxc -openvz -prefix -systemd-nspawn -timeout -vserver -uml
|
||||
keyword -docker -podman -jail -lxc -openvz -prefix -systemd-nspawn -timeout -vserver -uml
|
||||
}
|
||||
|
||||
_abort() {
|
||||
|
@ -14,7 +14,7 @@ description="Sets the hostname of the machine."
|
||||
depend()
|
||||
{
|
||||
after clock
|
||||
keyword -docker -lxc -prefix -systemd-nspawn
|
||||
keyword -docker -podman -lxc -prefix -systemd-nspawn
|
||||
}
|
||||
|
||||
start()
|
||||
|
@ -34,7 +34,7 @@ depend()
|
||||
if yesno $clock_adjfile; then
|
||||
use root
|
||||
fi
|
||||
keyword -docker -lxc -openvz -prefix -systemd-nspawn -uml -vserver -xenu
|
||||
keyword -docker -podman -lxc -openvz -prefix -systemd-nspawn -uml -vserver -xenu
|
||||
}
|
||||
|
||||
setupopts()
|
||||
|
@ -15,7 +15,7 @@ depend()
|
||||
{
|
||||
need termencoding
|
||||
after devfs
|
||||
keyword -docker -lxc -openvz -prefix -systemd-nspawn -uml -vserver -xenu
|
||||
keyword -docker -podman -lxc -openvz -prefix -systemd-nspawn -uml -vserver -xenu
|
||||
}
|
||||
|
||||
start()
|
||||
|
@ -16,7 +16,7 @@ depend()
|
||||
need fsck root
|
||||
use lvm modules
|
||||
after clock lvm modules
|
||||
keyword -docker -jail -lxc -prefix -systemd-nspawn -vserver
|
||||
keyword -docker -podman -jail -lxc -prefix -systemd-nspawn -vserver
|
||||
}
|
||||
|
||||
start()
|
||||
|
@ -15,7 +15,7 @@ depend()
|
||||
{
|
||||
use isapnp
|
||||
provide modules-load
|
||||
keyword -docker -lxc -openvz -prefix -systemd-nspawn -vserver
|
||||
keyword -docker -podman -lxc -openvz -prefix -systemd-nspawn -vserver
|
||||
}
|
||||
|
||||
find_modfiles()
|
||||
|
@ -14,7 +14,7 @@ description="Re-mount filesystems read-only for a clean reboot."
|
||||
depend()
|
||||
{
|
||||
after killprocs savecache
|
||||
keyword -docker -lxc -openvz -prefix -systemd-nspawn -vserver
|
||||
keyword -docker -podman -lxc -openvz -prefix -systemd-nspawn -vserver
|
||||
}
|
||||
|
||||
start()
|
||||
|
@ -16,7 +16,7 @@ depend()
|
||||
after modules net
|
||||
need sysfs
|
||||
provide network-online
|
||||
keyword -docker -jail -lxc -openvz -prefix -systemd-nspawn -uml -vserver
|
||||
keyword -docker -podman -jail -lxc -openvz -prefix -systemd-nspawn -uml -vserver
|
||||
}
|
||||
|
||||
get_interfaces()
|
||||
|
@ -26,7 +26,7 @@ depend()
|
||||
use afc-client amd openvpn
|
||||
use dns
|
||||
use root
|
||||
keyword -docker -jail -lxc -prefix -systemd-nspawn -vserver
|
||||
keyword -docker -podman -jail -lxc -prefix -systemd-nspawn -vserver
|
||||
}
|
||||
|
||||
start()
|
||||
|
@ -15,7 +15,7 @@ ttyn=${rc_tty_number:-${RC_TTY_NUMBER:-12}}
|
||||
|
||||
depend()
|
||||
{
|
||||
keyword -docker -lxc -openvz -prefix -systemd-nspawn -vserver
|
||||
keyword -docker -podman -lxc -openvz -prefix -systemd-nspawn -vserver
|
||||
}
|
||||
|
||||
_setleds()
|
||||
|
@ -16,7 +16,7 @@ depend()
|
||||
after clock
|
||||
use devfs
|
||||
want modules
|
||||
keyword -docker -lxc -openvz -prefix -systemd-nspawn -vserver
|
||||
keyword -docker -podman -lxc -openvz -prefix -systemd-nspawn -vserver
|
||||
}
|
||||
|
||||
start()
|
||||
|
@ -15,7 +15,7 @@ depend()
|
||||
{
|
||||
after clock
|
||||
need fsck
|
||||
keyword -docker -jail -lxc -openvz -prefix -systemd-nspawn -vserver
|
||||
keyword -docker -podman -jail -lxc -openvz -prefix -systemd-nspawn -vserver
|
||||
}
|
||||
|
||||
start()
|
||||
|
@ -13,7 +13,7 @@ depend()
|
||||
{
|
||||
need termencoding
|
||||
after bootmisc clock keymaps
|
||||
keyword -docker -lxc -openvz -prefix -systemd-nspawn -uml -vserver -xenu
|
||||
keyword -docker -podman -lxc -openvz -prefix -systemd-nspawn -uml -vserver -xenu
|
||||
}
|
||||
|
||||
start()
|
||||
|
@ -14,7 +14,7 @@ ttyn=${rc_tty_number:-${RC_TTY_NUMBER:-12}}
|
||||
|
||||
depend()
|
||||
{
|
||||
keyword -docker -lxc -openvz -prefix -systemd-nspawn -uml -vserver -xenu
|
||||
keyword -docker -podman -lxc -openvz -prefix -systemd-nspawn -uml -vserver -xenu
|
||||
use root
|
||||
after bootmisc clock termencoding
|
||||
}
|
||||
|
@ -15,7 +15,7 @@ depend()
|
||||
{
|
||||
after clock
|
||||
need localmount
|
||||
keyword -docker -jail -lxc -openvz -prefix -systemd-nspawn
|
||||
keyword -docker -podman -jail -lxc -openvz -prefix -systemd-nspawn
|
||||
provide urandom
|
||||
}
|
||||
|
||||
|
@ -13,7 +13,7 @@ depend()
|
||||
{
|
||||
after clock root
|
||||
before localmount
|
||||
keyword -docker -jail -lxc -openvz -prefix -systemd-nspawn -vserver
|
||||
keyword -docker -podman -jail -lxc -openvz -prefix -systemd-nspawn -vserver
|
||||
}
|
||||
|
||||
start()
|
||||
|
@ -15,7 +15,7 @@ swclock_file="${swclock_file:-/var/lib/misc/openrc-shutdowntime}"
|
||||
depend()
|
||||
{
|
||||
provide clock
|
||||
keyword -docker -lxc -openvz -prefix -systemd-nspawn -uml -vserver -xenu
|
||||
keyword -docker -podman -lxc -openvz -prefix -systemd-nspawn -uml -vserver -xenu
|
||||
}
|
||||
|
||||
# swclock is an OpenRC built in
|
||||
|
@ -15,7 +15,7 @@ sysfs_opts=nodev,noexec,nosuid
|
||||
|
||||
depend()
|
||||
{
|
||||
keyword -docker -lxc -prefix -systemd-nspawn -vserver
|
||||
keyword -docker -podman -lxc -prefix -systemd-nspawn -vserver
|
||||
}
|
||||
|
||||
mount_sys()
|
||||
|
@ -16,7 +16,7 @@ ttyn=${rc_tty_number:-${RC_TTY_NUMBER:-12}}
|
||||
|
||||
depend()
|
||||
{
|
||||
keyword -docker -lxc -openvz -prefix -systemd-nspawn -uml -vserver -xenu
|
||||
keyword -docker -podman -lxc -openvz -prefix -systemd-nspawn -uml -vserver -xenu
|
||||
after devfs
|
||||
}
|
||||
|
||||
|
@ -16,7 +16,7 @@ depend()
|
||||
{
|
||||
after clock
|
||||
need localmount
|
||||
keyword -docker -jail -lxc -openvz -prefix -systemd-nspawn
|
||||
keyword -docker -podman -jail -lxc -openvz -prefix -systemd-nspawn
|
||||
}
|
||||
|
||||
save_seed()
|
||||
|
@ -318,6 +318,8 @@ Same as -jail, but for Xen DOM0 systems.
|
||||
Same as -jail, but for Xen DOMU systems.
|
||||
.It Dv -docker
|
||||
Same as -jail, but for docker systems.
|
||||
.It Dv -podman
|
||||
Same as -jail, but for podman systems.
|
||||
.It Dv -containers
|
||||
Same as -jail, but for all relevant container types on the operating
|
||||
system.
|
||||
|
@ -100,7 +100,7 @@ _get_containers() {
|
||||
c="-jail"
|
||||
;;
|
||||
Linux)
|
||||
c="-docker -lxc -openvz -rkt -systemd-nspawn -uml -vserver"
|
||||
c="-docker -podman -lxc -openvz -rkt -systemd-nspawn -uml -vserver"
|
||||
;;
|
||||
esac
|
||||
echo $c
|
||||
|
@ -287,6 +287,8 @@ detect_container(const char *systype RC_UNUSED)
|
||||
return RC_SYS_SYSTEMD_NSPAWN;
|
||||
if (strcmp(systype, RC_SYS_DOCKER) == 0)
|
||||
return RC_SYS_DOCKER;
|
||||
if (strcmp(systype, RC_SYS_PODMAN) == 0)
|
||||
return RC_SYS_PODMAN;
|
||||
}
|
||||
if (file_regex("/proc/cpuinfo", "UML"))
|
||||
return RC_SYS_UML;
|
||||
@ -306,6 +308,8 @@ detect_container(const char *systype RC_UNUSED)
|
||||
return RC_SYS_SYSTEMD_NSPAWN;
|
||||
else if (exists("/.dockerenv"))
|
||||
return RC_SYS_DOCKER;
|
||||
else if (exists("/run/.containerenv"))
|
||||
return RC_SYS_PODMAN;
|
||||
/* old test, I'm not sure when this was valid. */
|
||||
else if (file_regex("/proc/1/environ", "container=docker"))
|
||||
return RC_SYS_DOCKER;
|
||||
|
@ -319,6 +319,7 @@ bool rc_service_daemons_crashed(const char *);
|
||||
* OpenRC can support some special sub system types, normally virtualization.
|
||||
* Some services cannot work in these systems, or we do something else. */
|
||||
#define RC_SYS_DOCKER "DOCKER"
|
||||
#define RC_SYS_PODMAN "PODMAN"
|
||||
#define RC_SYS_JAIL "JAIL"
|
||||
#define RC_SYS_NONE ""
|
||||
#define RC_SYS_OPENVZ "OPENVZ"
|
||||
|
Loading…
Reference in New Issue
Block a user