[CentOS] Run as root on reboot

Thu Oct 29 10:56:35 UTC 2020
Pete Biggs <pete at biggs.org.uk>

> 
> By "initial setup", I meant during the initial install of the 
> operating system, starting from "net-install".  Maybe one user is 
> defined.  The reboot command is issued from a script that was 
> initiated by hand. 
> 
So you want it to run as the final part of the install process??

If that's the case, then you should create a kickstart file with the
post installation script in it:

https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/7/html/installation_guide/sect-kickstart-syntax#sect-kickstart-postinstall

If you want/need it to run the script after the install has completed
and the first reboot, then you need to look at the FirstBoot scripts

https://access.redhat.com/solutions/2028143

P.