Run a script on first boot after install in 16.04

Josef Wolf jw at
Fri Jul 22 12:01:10 UTC 2016

On Fri, Jul 22, 2016 at 01:15:31PM +0200, Liam Proven wrote:
> On 22 July 2016 at 09:59, Josef Wolf <jw at> wrote:
> > I have to come back to this topic again:
> > My postinstall-script that is started on first bootup starts a screen session.
> Wow, you *really* like to make life difficult for yourself! :-o

No, I want to get rid of lots of manual work after install. This is because I
have to install lots of hosts in different locations with different roles.

The postinstall script:

- installs additional packges
- does lots of customizations
- checks out a svn repository with LOTS of configuration scripts (about 20k
  LOC in perl). Those scripts configure the host according to its
  hostname+domain+policy settings. This is similar to cfengine, but much more
  powerful and much more robust.

On every new debian/ubuntu-release, this postinstall needs some
adjustments. Therefore, I run this script within a screen session (on VT8) to
make it easier to investigate what breaks.

When the script stumbles over some problem, I can start a new screen-shell to
investigate what went wrong and possibly fix it before the script continues.

> Systemd does not play nice with ``screen'' and similar tools.

I don't need it to play nice with anybody. It should simply stay on the first
(or any) virtual console instead of throwing its excrements onto every console
which happens to be active.

> You might be better off investigating something like Devuan -- Debian
> without systemd:

No. I want to stay as close as possible to the main ubuntu distro. I don't
have any problem with systemd by itself. It should only put its output onto a
consistent VT (as virtually every other linux application does!) instead of
polluting every VT which happens to be active. That's the whole point of
virtual consoles, a concept known for more than 20 years!

Josef Wolf
jw at

More information about the ubuntu-users mailing list