Run a script on first boot after install in 16.04

Josef Wolf jw at raven.inka.de
Fri Jul 22 07:59:47 UTC 2016


On Wed, Jul 13, 2016 at 11:14:54AM +0200, Josef Wolf wrote:
> On Di, Jul 12, 2016 at 03:42:42 -0400, Tom H wrote:
> > On Tue, Jul 12, 2016 at 1:01 AM, Josef Wolf <jw at raven.inka.de> wrote:
> > > On Fr, Jul 08, 2016 at 11:54:16 +0200, Ralf Mardorf wrote:
> > >> On Thu, 7 Jul 2016 20:14:06 +0200, Josef Wolf wrote:
> > >>>
> > >>> Unfortunately, with 16.04, this won't work anymore. The symlinks
> > >>> in /etc/rcS.d are created, but the scripts won't be run at startup.
> > >>
> > >> Ubuntu switched from upstart to systemd.
> > >> Install the script to some /path/to/foo.sh, then add a
> > >> unit /lib/systemd/system/foo.service, e.g.
> > >> [ ... ]
> > >> and enable start on bootup by executing
> > >>
> > >> sudo systemctl enable foo.service
> > >
> > > I need to reboot, login and run "sudo systemctl enable foo.service" manually.
> > > I am looking for a way to activate this service from preseeding by
> > > late-command.
> > 
> > d-i doesn't have systemd as pid 1 so you have to add/remove symlinks
> > manually to enable/disable a service.
> 
> Yes, creting the links manually did the trick, thanks!

I have to come back to this topic again:

My postinstall-script that is started on first bootup starts a screen session.
This way, it can prompt me to query for additional information, and I am able
to to start new shell sessions for investigating any problems that can come
up.

unfortunatley, while waiting for my script to finish (that can last some
hours!), systemd outputs a message telling me that it is waiting for it to
finish. It repeats this message multiple times per second to show a red dot
moving from left to right and back again. This output destroys all the output
in my screen session and I can't seen any prompt (it is immedeately
overwritten). I can't even see what I am typing when I start a new shell in
screen by CTRL-A CTRL-C!

This output is thrown at whatever termial I switch, so switching terminals
won't help.

Why won't this output stay on virtual console 1? How can I disable it?

-- 
Josef Wolf
jw at raven.inka.de



More information about the ubuntu-users mailing list