Commit graph

10 commits

Author SHA1 Message Date
Virgil Dupras c8801ba8b2
Merge pull request #447 from hsoft/unprivileged-template
lxc-template: make runnable by unprivileged users
2018-01-13 08:35:43 -05:00
Virgil Dupras 553f1b5ed0 lxc-template: make runnable by unprivileged users
lxc-template needlessly require root privileges in two places:

1. lock file location for `flock`
2. failing on `tar` failure during rootfs extraction

For `flock`, it's not necessary that the lock file be in `/var/lock`, it
can be anywhere. Why not put it in `LXC_PATH`?

For the failing `tar` thing, that's because some device are created with
`mknod` which unprivileged users can't do. These device, however, are
not necessary for the container to run well. We can ignore `tar`'s error
exit code.

I replaced the exist code check by a check for the existence of
`/bin/true` in rootfs. I think that it's a good indication of whether
the rootfs was extracted.

Why am I making this change? Because I'd like to add support for
unprivileged containers in `vagrant-lxc` but it's kind of a big change
to make at once, so I thought I'd go incrementally.
2017-12-09 19:36:54 -05:00
Tobias Schramm 0cdd4d352c Fixes #420 (blaze it) 2016-08-22 22:27:00 +02:00
Cam Cope 6dcf584b25 preserve xattrs 2016-05-11 16:54:12 -07:00
Robin Gloster 64240323f0 fix shebang in template 2015-08-02 09:58:36 +00:00
Dan Post 96b2c7175a lxc-template: add parameter strip-components, as not all tarballs are created like ./rootfs/... 2014-08-25 11:57:54 -07:00
Fabio Rehm 4d45a4082b lxc-template: Write rootfs config to container config file when the fallback kicks in
Fix GH-282
2014-05-12 23:54:51 -03:00
Fabio Rehm b210b260b1 lxc-template: Backport --rootfs fallback from old template [GH-282] 2014-05-07 17:34:00 -03:00
Fabio Rehm ebdf50297f lxc-template: ensure /var/lock/subsys exists before creating lock 2014-03-14 00:32:47 -03:00
Fabio Rehm 4f49be03ad core: Make lxc-template optional [GH-254] 2014-03-14 00:32:03 -03:00
Renamed from boxes/common/lxc-template (Browse further)