2

I have a problem with systemd and Unit files.

I am using Ubuntu 16.04 Gnome Edition and I want to start up the application "synergy" when I log in.

After some research, I've learned that user unit files are stored in ~/.config/systemd/user/.

I have created a ~/.config/systemd/user/synergy.service unit file with the following:

[Unit]
Description=Synergy

[Service]
Environment=DISPLAY=:1
ExecStart=/usr/bin/synergy

[Install]
WantedBy=default.target

I have checked the functionality (it works):

systemctl --user start synergy.service
systemctl --user status synergy.service

And enabled it:

systemctl --user enable synergy.service

Unfortunately, after a reboot, synergy.service doesn't start when I log in.

I think I need to include an "after=" directive so that the Unit file starts when a user session is established.

Does anyone have an an idea or other way to start an application with systemd on log in?

Thanks for help

  • 1
    For a GUI application, you might better of using your desktop environment's autostart functionality instead of systemd's. – jordanm Oct 3 '16 at 20:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.