Wednesday, March 14, 2018

Ubuntu Server - Available options for various post installation customization?



I've created an Ubuntu Server ISO with a set of custom packages I want installed during the installation process. I alos have a preseed and kickstart file working. This took me a while but I have it working thanks to: How to create a Customized Ubuntu Server ISO?




Now I need to do things such as:




  • setting some firewall rules

  • writing some conf files

  • placing down keys

  • changing system name

  • ultimately creating a custom shell




This is a lot for me to digest and it is taking me a long time to understand which tool or part of the process I should be doing the above with. I think anything that has to do with just placing files can be done with a custom deb package and installed like my other packages. However, I don't know the best place for setting the host name, setting firewall rules, and eventually creating a custom shell/interface to limit the non root user's abilities. Note: Everything at this stage should be possible with the disc only... no internet access.



I've read this page and I believe I can script almost anything I'd need but only before the full system has booted: https://help.ubuntu.com/community/InstallCDCustomization. The purpose here is to get the server setup and secure to receive its final customization from Chef.



Basically, I just need to know where to begin with the bullets and could use pointers to examples. Can anyone help me?



I followed shvahabi's advice here How can I make "rc.local" run on startup?. Basically, I'm enabling and using rc.local on the ubuntu box. Rc.local is normally not used on debian. It's very similar to Window's registry run keys. Ultimately I'll have my first boot configuration script AND the custom rc.local file in a custom deb package that places the files on the box at installation time (custom deb lives on the ISO itself). Then, on every boot, the rc.local will run my script and I can put a check in so that it only runs on the first boot.



Important note: edit and use "/etc/rc.local" to place a line to run your script... NOT "/etc/init.d/rc.local". The second one is actually controlled by another package and will NOT let you install a custom version of it from a custom deb file during installation. The init.d version's sole purpose is to call the "/etc/rc.local" one anyways.




I'm not using systemd or upstart because you need to type in commands to start the services first. This needed to be hands free. HOWEVER, I believe all those commands do is make link files, but I didn't feel like figuring out where to place those. Two files in a custom deb package is easiest.


No comments:

Post a Comment

11.10 - Can't boot from USB after installing Ubuntu

I bought a Samsung series 5 notebook and a very strange thing happened: I installed Ubuntu 11.10 from a usb pen drive but when I restarted (...