I'm not familiar with the specifics or ArchLinux, but here is how to manage systemd in general.
Well, basically systemd is a collection of scripts in /etc/init.d/ that are pointed by symlinks from /etc/rcX.d, where X is the number of run level. Symlinks themselves are of the following format:
[K | S] + nn + [string]
- nn is a number that determines the order in which those scripts run
- string is the name of the script as it appears in /etc/init.d/
- and finally K or S determine the command that the script is invoked with: stop or start respectively.
So, if you want your script to run last in the boot sequence, you need to do the following:
- put your script in /etc/init.d/ and make it executable
- determine the target runlevel the script should start at (tipically 2 for console and 5 for graphical user interface). Can be determined with something like
- have a look at what scripts are already there in this runlevel
ls /etc/rc<target runlevel>.d/ and choose a two-digit number that is greater than any other already there.
- using an utility specific to your distribution like
update-rc.d for Debian based or
chkconfig for Fedora-like or manually, create a symlink /etc/rc.d/S to your init script.