How to run a script on system startup

The preferred way on a systemd system is to write a systemd unit for your script. This is normal way to start a service/script/program/daemon on boot.

Cron is deprecate in favor of systemd timers. But you probably don’t need them anyway.

This GUI options are can only be used to start a service/script/program/daemon with user permissions after a Human user login in. This is not “at startup”.

You only need to edit text files, no need for a GUI. Use your favorite terminal text editor for this.

Something to read.

Also check out example 3. Which is a good starting point for s systemd unit that need to start a script. But depending on what your script does, oneshot might not work.

You should start your websever with the normal provided systemd service. Maybe add your own script service as a requirement.

However mounting is done via systemd.mounts. Check out

2 Likes