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.
https://wiki.archlinux.org/index.php/Systemd#Writing_unit_files
https://www.freedesktop.org/software/systemd/man/systemd.service.html

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.
https://www.freedesktop.org/software/systemd/man/systemd.service.html#Examples

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