I’m new to Manjaro.
What the best way is for having a script run after system startup? I want to mount a network drive and start a webserver.
I have seen that the desktop offers a configuration menu ‘Session and Startup’ where I can specify applications for autostart, with a trigger for autostarting them.
I have then created a shell script and added it to the autostart section, triggered by restart (although I would have preferred ‘on system start’, but that’s not in the list).
What I see now is: The script seems to get executed during the shutdown phase of a restart, not during the startup phase. It does not get executed when I first shutdown the system and start it again. So my script will never become effective.
I have solved my problem by adding an ‘@reboot’ entry to root’s crontab. This works fine, but I’m not totally happy with it because I have read somewhere that @reboot is deprecated.
So my questions are:
- Can I have a script run at system startup by configuring it somewhere in the settings GUI?
- If not: Where is the recommended hook?