Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions config/init/openrc/lxc-containers.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/sbin/openrc-run

depend() {
need net
use logger
after cgroupfs-mount
}

start() {
ebegin "Starting LXC autoboot containers"
@LIBEXECDIR@/lxc/lxc-containers start
eend $?
}

stop() {
ebegin "Stopping LXC containers"
@LIBEXECDIR@/lxc/lxc-containers stop
eend $?
}
18 changes: 18 additions & 0 deletions config/init/openrc/lxc-net.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/sbin/openrc-run

depend() {
need net
use logger
}

start() {
ebegin "Starting LXC network bridge"
@LIBEXECDIR@/lxc/lxc-net start
eend $?
}

stop() {
ebegin "Stopping LXC network bridge"
@LIBEXECDIR@/lxc/lxc-net stop
eend $?
}
17 changes: 17 additions & 0 deletions config/init/openrc/meson.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# SPDX-License-Identifier: LGPL-2.1+

if 'openrc' in init_script
configure_file(
configuration: conf,
input: 'lxc-containers.in',
output: 'lxc-containers',
install: true,
install_dir: join_paths(sysconfdir, 'init.d'))

configure_file(
configuration: conf,
input: 'lxc-net.in',
output: 'lxc-net',
install: true,
install_dir: join_paths(sysconfdir, 'init.d'))
endif
11 changes: 9 additions & 2 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -924,8 +924,15 @@ subdir('config/bash')
subdir('config/etc')
if want_install_init
subdir('config/init/common')
subdir('config/init/systemd')
subdir('config/init/sysvinit')
if 'systemd' in init_script
subdir('config/init/systemd')
endif
if 'sysvinit' in init_script
subdir('config/init/sysvinit')
endif
if 'openrc' in init_script
subdir('config/init/openrc')
endif
subdir('config/sysconfig')
endif
if want_selinux
Expand Down
2 changes: 1 addition & 1 deletion meson_options.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ option('examples', type: 'boolean', value: true,

# was --init-script in autotools
option('init-script', type: 'array',
choices: ['systemd', 'sysvinit'], value: ['systemd'],
choices: ['systemd', 'sysvinit', 'openrc'], value: ['systemd'],
description: 'init script')

# was --systemd-unidir in autotools
Expand Down
6 changes: 6 additions & 0 deletions src/lxc/confile.c
Original file line number Diff line number Diff line change
Expand Up @@ -4309,6 +4309,9 @@ static int get_config_cap_drop(const char *key, char *retv, int inlen,
int len, fulllen = 0;
struct cap_entry *cap;

if (c->caps.keep)
return fulllen;

if (!retv)
inlen = 0;
else
Expand All @@ -4327,6 +4330,9 @@ static int get_config_cap_keep(const char *key, char *retv, int inlen,
int len, fulllen = 0;
struct cap_entry *cap;

if (!c->caps.keep)
return fulllen;

if (!retv)
inlen = 0;
else
Expand Down