Run a script on first boot after install in 16.04

Josef Wolf jw at raven.inka.de
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
  done

The scripts have names like S98postinstall.pl, so symlinks like
/etc/rcS.d/S98postinstall.pl 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?

Thanks!

-- 
Josef Wolf
jw at raven.inka.de



More information about the ubuntu-users mailing list