Summary: | app-emulation/lxc - /etc/init.d/lxc should respect 'lxc.lxcpath' setting | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | i.Dark_Templar <idarktemplar> |
Component: | Current packages | Assignee: | Diego Elio Pettenò (RETIRED) <flameeyes> |
Status: | RESOLVED DUPLICATE | ||
Severity: | normal | CC: | dev-zero, dschridde+gentoobugs, hwoarang, idarktemplar, virtualization |
Priority: | Normal | Keywords: | PATCH |
Version: | unspecified | ||
Hardware: | All | ||
OS: | Linux | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- | |
Attachments: | files/lxc.initd.4 |
Description
i.Dark_Templar
2014-10-20 09:02:47 UTC
Created attachment 387030 [details]
files/lxc.initd.4
Updated openrc config based on latest found in the portage tree (lxc.initd.3).
diff:
--- /usr/portage/app-emulation/lxc/files/lxc.initd.3 2014-10-18 21:00:37.000000000 +0400
+++ /tmp/lxc.initd.4 2014-10-20 12:53:15.358622759 +0400
@@ -6,10 +6,13 @@
CONTAINER=${SVCNAME#*.}
lxc_get_configfile() {
- if [ -f "/etc/lxc/${CONTAINER}.conf" ]; then
- echo "/etc/lxc/${CONTAINER}.conf"
- elif [ -f "/etc/lxc/${CONTAINER}/config" ]; then
- echo "/etc/lxc/${CONTAINER}/config"
+ local confpath
+ confpath="$(lxc-config lxc.lxcpath)"
+
+ if [ -f "${confpath}/${CONTAINER}.conf" ]; then
+ echo "${confpath}/${CONTAINER}.conf"
+ elif [ -f "${confpath}/${CONTAINER}/config" ]; then
+ echo "${confpath}/${CONTAINER}/config"
else
eerror "Unable to find a suitable configuration file."
eerror "If you set up the container in a non-standard"
Comment on attachment 387030 [details]
files/lxc.initd.4
--- files/lxc.initd.3
+++ files/lxc.initd.4
@@ -6,10 +6,13 @@
CONTAINER=${SVCNAME#*.}
lxc_get_configfile() {
- if [ -f "/etc/lxc/${CONTAINER}.conf" ]; then
- echo "/etc/lxc/${CONTAINER}.conf"
- elif [ -f "/etc/lxc/${CONTAINER}/config" ]; then
- echo "/etc/lxc/${CONTAINER}/config"
+ local confpath
+ confpath="$(lxc-config lxc.lxcpath)"
+
+ if [ -f "${confpath}/${CONTAINER}.conf" ]; then
+ echo "${confpath}/${CONTAINER}.conf"
+ elif [ -f "${confpath}/${CONTAINER}/config" ]; then
+ echo "${confpath}/${CONTAINER}/config"
else
eerror "Unable to find a suitable configuration file."
eerror "If you set up the container in a non-standard"
Also, instead of lines: local confpath confpath="$(lxc-config lxc.lxcpath)" variable 'lxc_path' from file '/usr/share/lxc/lxc.functions' may be used. It's defined this way: lxc_path=`lxc-config lxc.lxcpath` Can this https://bugs.gentoo.org/show_bug.cgi?id=530896 solve your problem? Yes, scripts from bug #530896 also worked for me, but they produced some warnings on 'stop' action: * Sending signal to stop Linux Container ${name} ... [ !! ] * Try to request a clean shutdown Linux Container ${name} ... [ !! ] * Halting Linux Container ${name} ... [ ok ] Nonetheless LXC container stops. Lets move to 530896 so we can create a unified to solution to solve both of your problems. *** This bug has been marked as a duplicate of bug 530896 *** |