You are not logged in.

#1 2023-02-18 06:26:57

nonsense
Member
Registered: 2023-01-02
Posts: 5

agent can not be started with systemd

I made a file in .config/systemd/user/agent-gnome.service:

[Unit]
Description=Gnome Agent
PartOf=graphical-session.target

[Service]
Type=simple
StandardOutput=journal
ExecStart=/usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1

[Install]
WantedBy=graphical-session.target

This service exit with code 1 after logging into wayland compositor:

× agent-gnome.service - Gnome Agent
     Loaded: loaded (/home/yann/.config/systemd/user/agent-gnome.service; enabled; preset: enabled)
     Active: failed (Result: exit-code) since Sat 2023-02-18 14:23:32 CST; 8s ago
   Duration: 30ms
    Process: 1168 ExecStart=/usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1 (code=exited, status=1/FAILURE)
   Main PID: 1168 (code=exited, status=1/FAILURE)
        CPU: 28ms

Feb 18 14:23:32 art systemd[1155]: Started Gnome Agent.
Feb 18 14:23:32 art systemd[1155]: agent-gnome.service: Main process exited, code=exited, status=1/FAILURE
Feb 18 14:23:32 art systemd[1155]: agent-gnome.service: Failed with result 'exit-code'.

Restarting this service after logging into wayland compositor will make it work.
Which part of my file is wrong please?

Offline

#2 2023-02-18 07:25:39

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 76,383

Re: agent can not be started with systemd

Which part of my file is wrong please?

Relying on systemd for this, use an https://wiki.archlinux.org/title/XDG_Autostart service

The graphical.target is the default target.
It does not mean that there's a GUI session or a DM.

You can try to add

Requires=graphical.target
After=graphical.target

but I doubt this will cut it.
You'd probably have to add some sort of gnome.target and then activate that after starting the session (eg. using an autostart service) - or you skip this nonsense and just use an autostart service directly.

Offline

Board footer

Powered by FluxBB