
Systemd 文件指出,每個使用者單元可以新增到多個位置:請參閱手冊頁上的表 2:
https://www.freedesktop.org/software/systemd/man/systemd.unit.html
例如,這包括~/.config/systemd/user
。
strace
然而,在我的 Ubuntu 18.04 機器上,systemd 似乎並沒有在那裡查看,僅在位置的子集上(...因為在嘗試啟動我的服務時顯然在 systemd 進程上使用):
openat(AT_FDCWD, "/run/user/1000/systemd/system.control/parsec.service", O_RDONLY|O_NOCTTY|O_NOFOLLOW|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/run/user/1000/systemd/transient/parsec.service", O_RDONLY|O_NOCTTY|O_NOFOLLOW|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/etc/systemd/user/parsec.service", O_RDONLY|O_NOCTTY|O_NOFOLLOW|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/lib/systemd/user/parsec.service", O_RDONLY|O_NOCTTY|O_NOFOLLOW|O_CLOEXEC) = -1 ENOENT (No such file or directory)
為什麼?另外,我怎麼能讓它從使用者可寫入位置拾取單位?