I used to run several scripts at startup to set things the way I want my server running. After migrating to Ubuntu 18.04, I am having trouble with a few scripts and I am just wondering if this is still the preferred method to run shell scripts automatically after rebooting?
Following Ubuntu 16.04 traditional init startup scripts have been superseded by the systemd service and its configurations. Most of the scripts or script instructions were rewritten into so called systemd unit files. Therefore I would recommend to setup a systemd service for your custom startup scripts.
/etc/systemd/system/foo.service with content:
Replace with your parameters accordingly. This service definition will run
/opt/foo/setup-foo.sh on each startup.
Remember to load and enable the service:
sudo systemctl daemon-reload
sudo systemctl enable foo.service
For more info take a look at this example.