在 2021-06-29星期二的 12:42 +0100,Patrick O'Callaghan写道:
I'm trying to get a specific service to start on login, and the usual method (KDE Autostart) isn't working so I'm trying to do it with a systemd unit:
How is that not working? Is it due to systemd-xdg-autostart-generator? KDE on Wayland seems to be using systemd-xdg-autostart-generator by default and causing some problems...
$ cat startinsync.service [Unit] Description=insync-headless service After=default.target [Service] ExecStart=/bin/sh /usr/bin/insync-headless start
Just an advice, If you have shebang ahead, you don't need /bin/sh.
ExecStart=/path/to/script.sh is enough, but make sure the script have +x set.
KillSignal=SIGINT [Install] WantedBy=default.target
The docs say that the place to put the unit file is given by:
$ pkg-config systemd --variable=systemduserunitdir /usr/lib/systemd/user
No, this place is usually for units installed by package manager.
Per-user unit files can be placed to * ~/.config/systemd/user/ : for you only * /etc/systemd/user/ : for everyone on this system You can check for the detail by `man SYSTEMD.UNIT 5`
So I copied the file there:
$ ls -l /usr/lib/systemd/user/startinsync.service -rw-r--r--. 1 root root 177 Jun 29 12:31 /usr/lib/systemd/user/startinsync.service
Execute `systemctl --user daemon-reload` to tell systemd instance that files on disk have changed.
and tried to enable it:
$ sudo systemctl enable startinsync Failed to enable unit: Unit file startinsync.service does not exist.
That is for system units, to manage user units, use: * systemd --user enable startinsync to enable for you only * systemd --global enable startinsync to enable for everyone on this system
I'm out of ideas.
Asking here is a great idea :)
poc _______________________________________________ users mailing list -- users@lists.fedoraproject.org To unsubscribe send an email to users-leave@lists.fedoraproject.org Fedora Code of Conduct: https://docs.fedoraproject.org/en- US/project/code-of-conduct/ List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines List Archives: https://lists.fedoraproject.org/archives/list/users@lists.fedoraproje ct.org Do not reply to spam on the list, report it: https://pagure.io/fedora-infrastructure