This release brings two bugfixes to the hypernode-vagrant LXC container development environment. On Hypernode we use systemd as the init system and over time some incompatibilities were introduced and discovered with various versions of LXC.

Fixing the ‘Failed at step NAMESPACE spawning /usr/sbin/varnishd’ error

Previously this error could occur in the initial shell provisioner with more recent versions of systemd and LXC on the host system:

==> hypernode: Running provisioner: shell...
    hypernode: Running: /tmp/vagrant-shell20180202-982-fegnc3.sh
    hypernode: Synchronizing state of php5.6-fpm.service with SysV init with /lib/systemd/systemd-sysv-install...
    hypernode: Executing /lib/systemd/systemd-sysv-install disable php5.6-fpm
    hypernode: insserv: warning: current start runlevel(s) (empty) of script `php5.6-fpm' overrides LSB defaults (2 3 4 5).
    hypernode: insserv: warning: current stop runlevel(s) (0 1 2 3 4 5 6) of script `php5.6-fpm' overrides LSB defaults (0 1 6).
    hypernode: insserv: warning: current start runlevel(s) (empty) of script `php5.6-fpm' overrides LSB defaults (2 3 4 5).
    hypernode: insserv: warning: current stop runlevel(s) (0 1 2 3 4 5 6) of script `php5.6-fpm' overrides LSB defaults (0 1 6).
    hypernode: Synchronizing state of php5.5-fpm.service with SysV init with /lib/systemd/systemd-sysv-install...
    hypernode: Executing /lib/systemd/systemd-sysv-install disable php5.5-fpm
    hypernode: insserv: warning: current start runlevel(s) (empty) of script `php5.5-fpm' overrides LSB defaults (2 3 4 5).
    hypernode: insserv: warning: current stop runlevel(s) (0 1 2 3 4 5 6) of script `php5.5-fpm' overrides LSB defaults (0 1 6).
    hypernode: update-alternatives: 
    hypernode: using /usr/bin/php7.0 to provide /usr/bin/php (php) in manual mode
    hypernode: Synchronizing state of php7.0-fpm.service with SysV init with /lib/systemd/systemd-sysv-install...
    hypernode: Executing /lib/systemd/systemd-sysv-install enable php7.0-fpm
    hypernode: insserv: warning: current start runlevel(s) (empty) of script `php7.0-fpm' overrides LSB defaults (2 3 4 5).
    hypernode: insserv: warning: current stop runlevel(s) (0 1 2 3 4 5 6) of script `php7.0-fpm' overrides LSB defaults (0 1 6).
    hypernode: Cannot open /var/lib/varnish/6af9cf-root-magweb-vgr/_.vsm: No such file or directory
    hypernode: Cannot open /var/lib/varnish/6af9cf-root-magweb-vgr/_.vsm: No such file or directory

This was caused by the Varnish service failing to start after container startup.

Feb 02 08:44:14 6af9cf-root-magweb-vgr systemd[1]: Started Varnish HTTP accelerator.
-- Subject: Unit varnish.service has finished start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- Unit varnish.service has finished starting up.
-- 
-- The start-up result is done.
Feb 02 08:44:14 6af9cf-root-magweb-vgr systemd[1096]: varnish.service: Failed at step NAMESPACE spawning /usr/sbin/varnishd: Invalid argument
-- Subject: Process /usr/sbin/varnishd could not be executed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- The process /usr/sbin/varnishd could not be executed and failed.
-- 
-- The error number returned by this process is 22.
Feb 02 08:44:14 6af9cf-root-magweb-vgr systemd[1]: varnish.service: Main process exited, code=exited, status=226/NAMESPACE
Feb 02 08:44:14 6af9cf-root-magweb-vgr systemd[1]: varnish.service: Unit entered failed state.
Feb 02 08:44:14 6af9cf-root-magweb-vgr systemd[1]: varnish.service: Failed with result 'exit-code'.
Feb 02 08:44:14 6af9cf-root-magweb-vgr systemd[1]: varnish.service: Service hold-off time over, scheduling restart.
Feb 02 08:44:14 6af9cf-root-magweb-vgr systemd[1]: Stopped Varnish HTTP accelerator.
-- Subject: Unit varnish.service has finished shutting down
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- Unit varnish.service has finished shutting down.
Feb 02 08:44:14 6af9cf-root-magweb-vgr systemd[1]: varnish.service: Start request repeated too quickly.
Feb 02 08:44:14 6af9cf-root-magweb-vgr systemd[1]: Failed to start Varnish HTTP accelerator.
-- Subject: Unit varnish.service has failed

The systemd unit file for the Varnish service in the boxfile now contains PrivateDevices=false as a workaround for this problem. Thanks to tomlankhorst and pauluse for reporting these issues.

Network namespace sandboxing is now disabled in the LXC box

There was an issue with starting hostnamectl which caused systemctlctl status to report a degraded state. This can happen when the kernel on the host does not have namespacing support. The PrivateNetwork setting has now been set to false for this service to work around the issue.

Some additional documentation was added

In the past we have received some questions relating to setting up networking in the container and questions about how to solve environment specific issues on various distributions. But since we only officially support Ubuntu and MacOSX, we always recommend people to run hypernode-vagrant on those operating systems.

But because we receive questions about other distributions anyway we have now added a short reference to help guiding the setup on Arch Linux. Pull requests for additional documentation are always welcome, so if you encounter a problem related to your specific environment don’t hesitate to share it on GitHub so it also might help other people in the future.

Please keep in mind that the hypernode-vagrant box really is only built with the beforementioned two operating systems in mind, so if you encounter any problems running it on other systems you are on your own.