Forgive me, I am newer to Linux/Debian/Raspian.
The company I work for has a bash script being run from rc.local that updates /etc/hostname file on bootup of a raspberry pi based on the MAC Address of one of the network interfaces found on said pi, keeping the hostnames unique for each unit.
We also have an executable being run from systemd (sudo systemctl enable [executable-name]) that reads this /etc/hostname file first thing when it starts to see what it’s hostname is.
We are finding occasionally after we image the SD card with this script on it that our executable is starting up/reading this /etc/hostname file and getting the old hostname read into memory in the executable. (Second boot is ok because the script has already written to the /etc/hostname file at least once the correct information).
Is there a way to set up the systemd executable to wait till the rc.local bash file has finished completely before starting the systemd executable. Some Requires variable or something.