There are lots of instructions out there for creating basic systemd service files, but they all seem (rightfully so) to instruct you to make calls to systemctl daemon-reload
and systemctl enable
. If you need to add a service to a drive you have mounted but not booted (think system orchestration), how would you do that purely by writing to the file system (files, directories, symlinks).
I'm sure there will be a few "it depends on where your X lives" and that is okay. This can have limited (or no) portability. I just want to make sure that my plan works.
That plan being:
- Write a service file in
/usr/lib/systemd/system/
- Symlink to it from
/etc/systemd/system/multi-user.target.wants/