Update lxc-archlinux template to work with systemd

Use arch-install-scripts for installation.

Signed-off-by: Alexander Vladimirov <alexander.idkfa.vladimirov@gmail.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
lxc-netstat: improve finding fs mountpoint of hierarchy

We cannot assume that the mount source name always starts with 'cgroup'
so we check the filesystem type instead.

Use 'awk' instead of 'grep -E' and  as it is a better tool for this job.

This fixes the tool on systems using openrc.

Signed-off-by: Natanael Copa <ncopa@alpinelinux.org>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
legacy/lxc-ls: improve finding fs mountpoint of hierarchy

We cannot assume that the mount source name always starts with 'cgroup'
so we check the filesystem type instead.

Use 'awk' instead of 'grep -E' and  as it is a better tool for this job.

This fixes the tool on systems using openrc.

Signed-off-by: Natanael Copa <ncopa@alpinelinux.org>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
cleanup: use lxc-info --state-is

We now have the possibility to test for a given state. Use this feature
instead of parsing output with grep or awk

Signed-off-by: Natanael Copa <ncopa@alpinelinux.org>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
fix open check (0 is a valid fd)

Signed-off-by: Dwight Engen <dwight.engen@oracle.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
lxc-shutdown: use posix shell instead of bash

- avoid getopt --longoptions
- use 'which' instead of 'type' to detect existance of tools
- specify -s SIG<signame> with kill

Signed-off-by: Natanael Copa <ncopa@alpinelinux.org>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
lxc-ps: use posix shell and awk instead of bash

Use awk to parse the output pf 'ps' and the tasks files for the
containers.

Use awk fields to find PID column rather than assume that the PID field
is exactly 5 chars wide and has a leading space ' PID'. This works as
long as the PID field is before the command or other field that include
spaces. This also makes it work with busybox 'ps'.

Signed-off-by: Natanael Copa <ncopa@alpinelinux.org>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
templates: install lxc-alpine

Make sure we actually install lxc-alpine

Signed-off-by: Natanael Copa <ncopa@alpinelinux.org>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
lxc-alpine: indent fixes

Signed-off-by: Natanael Copa <ncopa@alpinelinux.org>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
lxc-alpine: add --repository option

This allows specifying what repository to use for the container.

Signed-off-by: Natanael Copa <ncopa@alpinelinux.org>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
lxc-alpine: add support for setting arch from command line

This allows us to lxc-create 32 bit guests on x86_64 hosts.

Signed-off-by: Natanael Copa <ncopa@alpinelinux.org>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
lxc-alpine: add support for installing optional packages

Let users append a list of packages they want install in the container

Signed-off-by: Natanael Copa <ncopa@alpinelinux.org>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
kill -s expects the signal name without SIG

The previous lxc-shutdown change replaced 'kill SIG<name>' by
'kill -s SIG<name>'. Although this works with busybox where it was tested,
this doesn't actually work with all kill implementations. Some requiring just
the signal name without the prefix.

This changes "-s SIG<name>" by just "-s <name>". Tested with busybox and
standard kill.

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>