Run a script on first boot after install in 16.04

Josef Wolf jw at
Thu Jul 7 18:14:06 UTC 2016

Hello all,

I have created a customized install-cd that uses the preseed/late_command from
debian-installer to install some perl-scripts which should be run at the very
first reboot after the install.

This is the script that is run from late_command:

  #! /bin/sh
  umask 077
  # make our customized instfiles available afte reboot
  cp -a /cdrom/preseed/instfiles             /target
  cp -a /cdrom/preseed/instfiles/gem/files/* /target
  chmod -R u=rwX,go= /target/instfiles
  # make start scripts executable at first boot
  cd /target/instfiles/gem/scripts/start
  for i in *; do
      ln -s /instfiles/gem/scripts/start/$i /target/etc/rcS.d

The scripts have names like, so symlinks like
/etc/rcS.d/ are created. The scripts delete themselves when
done, so they will vanish once they're done.

This strategy worked great since 6.10 up to 14.04.

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.

Any ideas why the links in /etc/rcS.d are ignored and how to get them executed
at first reboot?


Josef Wolf
jw at

More information about the ubuntu-users mailing list