Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 364611 - inconsistency between app-emulation/lxc-0.7.4.1 initscript and lxc-create
Summary: inconsistency between app-emulation/lxc-0.7.4.1 initscript and lxc-create
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal minor (vote)
Assignee: Diego Elio Pettenò (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-04-23 19:41 UTC by Sergio
Modified: 2011-04-24 15:47 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sergio 2011-04-23 19:41:24 UTC
Running 'lxc-create -n c0 -t template -f /path/to/conf' a configuration file is generated in /etc/lxc/c0/config.
But the related initscript (/etc/init.d/lcx.c0) look for a /etc/lxc/c0.conf file.

Even if it is very easy to correct, it looks a bit weird to me and perhaps it may be easily correct it in the next release.

Hope not misunderstand.

Reproducible: Always

Steps to Reproduce:
1. lxc-create -n c0 -t any -f /home/<user>/c0.conf
2. ln -s /etc/init.d/lxc /etc/init.d/lxc.c0
3. /etc/init.d/lxc.c0 start
Actual Results:  
[!!]
Fatal: unable to open '/etc/lxc/c0.conf'
(I reverse translated it from the italian...)

Expected Results:  
[ok]

The quickest workaround is:
ln -s /etc/lxc/c0/config /etc/lxc/c0.conf

Best could be a initscript modification:
7c7
< CONFIGFILE=${CONFIGFILE:-/etc/lxc/${CONTAINER}.conf}
---
> CONFIGFILE=${CONFIGFILE:-/etc/lxc/${CONTAINER}/config}

/etc/lxc/${CONTAINER}/ could also be a good place for additional ware (fstab).

Regards,
HUjuice
Comment 1 Diego Elio Pettenò (RETIRED) gentoo-dev 2011-04-24 15:14:14 UTC
Grml to upstream introducing conventions and then changing them again.

To be honest I don't like the idea of using too many subdirectories (since I much prefer inline fstabs). But I'll see to do a fallback in the init script: if the original /etc/lxc/$container.conf file is missing, it'll check for /etc/lxc/$container/config.
Comment 2 Diego Elio Pettenò (RETIRED) gentoo-dev 2011-04-24 15:24:52 UTC
Okay this should be fixed in 0.7.4.1-r1.
Comment 3 Sergio 2011-04-24 15:47:37 UTC
Hello diego,
your proposal is obviously OK and I completely agree.

I think that the weirdness is about the lxc-create behaviour and, generally speaking, that some minor feature is missing in the whole equipment.

Even if young, anyway, it is a very interesting project.

Regards,
Sergio