You are not logged in.

#1 2017-05-08 15:18:51

gaulderson
Member
Registered: 2017-05-05
Posts: 23

[SOLVED] Systemd user service fails

So I have a systemd user service located at

~/.config/systemd/user/wallpaper.service

that contains

[Unit]
Description=Set desktop wallpaper

[Service]
Type=simple
ExecStart=/usr/bin/feh --bg-fill --randomize /home/gaul/pictures/wallpaper/*

[Install]
WantedBy=default.target

When starting the service with

 systemctl --user start wallpaper.service 

I get no error, but my desktop background stays the same.

When I check the status with

systemctl --user status wallpaper

I get

● wallpaper.service - Set desktop wallpaper
   Loaded: loaded (/home/gaul/.config/systemd/user/wallpaper.service; disabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Mon 2017-05-08 11:13:56 EDT; 1min 4s ago
  Process: 1039 ExecStart=/usr/bin/feh --bg-fill --randomize /home/gaul/pictures/wallpaper/* (code=exited, status=1/FAILURE)
 Main PID: 1039 (code=exited, status=1/FAILURE)

May 08 11:13:56 ziggy systemd[452]: Started Set desktop wallpaper.
May 08 11:13:56 ziggy systemd[452]: wallpaper.service: Main process exited, code=exited, status=1/FAILURE
May 08 11:13:56 ziggy systemd[452]: wallpaper.service: Unit entered failed state.
May 08 11:13:56 ziggy systemd[452]: wallpaper.service: Failed with result 'exit-code'.

Any idea why I might be getting this error code? The command works fine when I run it just in the terminal.

Thank you.

Last edited by gaulderson (2017-05-08 16:06:48)

Offline

#2 2017-05-08 15:44:52

falconindy
Developer
From: New York, USA
Registered: 2009-10-22
Posts: 4,111
Website

Re: [SOLVED] Systemd user service fails

You're trying to use shell expansion which doesnt work in a service unit.

Offline

#3 2017-05-08 16:02:33

gaulderson
Member
Registered: 2017-05-05
Posts: 23

Re: [SOLVED] Systemd user service fails

Ah okay, thank you. Is there any equivalent way to do this command or am I just better off writing a script?

edit: found a workaround with /bin/bash -c "<command>".

If there's a better or more preferred method please let me know otherwise this should be sufficient.

Last edited by gaulderson (2017-05-08 16:06:25)

Offline

Board footer

Powered by FluxBB