You are not logged in.
Hi there,
I've got a script which fetches some information from the internet, does some magic and then writes some values in a temp file for later use.
Obviously, because of the internet access, the script has some noticeable execution time.
What I want:
1) The script shall be executed automatically after boot is finished.
2) The script shall be executed before a specific user logs in. If a user logs in before the script is finished, nothing bad would happen.
Where can I place / link such a script?
I thought about using a systemd-unit (WantedBy=multi-user.target ), however, I think this would delay the boot process? This should be avoided.
/etc/bash.bashrc, .bash_profile, .bashrc and so on are executed after a user logs in, thus, not the right solution either.
Any ideas?
Offline
I thought about using a systemd-unit (WantedBy=multi-user.target ), however, I think this would delay the boot process?
Not unless other units are configured to wait until your unit has finished. Parallelism is a feature of systemd.
Reference: https://wiki.archlinux.org/title/System … work_is_up
Jin, Jîyan, Azadî
Offline
Another advantage of using systemd is that you can make your script depend on network-online.target so that it is only triggered once the network is up.
Offline