You are not logged in.

#1 2014-06-08 01:42:53

anptr
Member
Registered: 2011-10-20
Posts: 25

[Solved] custom systemd service error: Error spawning dbus-launch

Hello!
I wroted a shell script to change gnome background

gsettings set org.gnome.desktop.background picture-uri "/tmp/wallpaper.jpg"

After that i wrote a systemd wall.service file to launch it

[Unit]
Description=Change wallpaper
After=gdm.service

[Service]
Type=oneshot
ExecStart=test.sh

[Install]
WantedBy=graphical.target

When i try systemctl start wall.service, nothing happens and systemctl status wall.service gives me

dconf-WARNING **: failed to commit changes to dconf: Error spawning command line 'dbus-launch --autolaunch=74d66c08eacb4e12a2219f3fe74c245b --binary-syntax --close-stderr': Child process exited with code 1

Where the problem hides?

Last edited by anptr (2014-06-12 18:08:17)

Offline

#2 2014-06-08 02:50:50

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,414

Re: [Solved] custom systemd service error: Error spawning dbus-launch

I think in order for this to work, you would have to use systemd --user.  You would probably also need to set up a dbus.service and dbus.socket for the systemd --user as well.

There is a wiki page about using systemd --user.  Though that aspect of systemd is still in development, so things are subject to change at any moment.  A good example of this is the outdated portion of the systemd --user wiki page about managing your graphical session with it, which now no longer reliably works.

Offline

#3 2014-06-08 08:20:11

anptr
Member
Registered: 2011-10-20
Posts: 25

Re: [Solved] custom systemd service error: Error spawning dbus-launch

I created dbus.service and dbus.socket in /etc/systemd/user and enabled dbus.socket. Still same error. I also moved my service from systemd/system directory to systemd/user directory,and tried with systemctl --user start wall.service but it still does not work. So simple task and so many problems, amazing

Offline

#4 2014-06-08 09:16:32

tomk
Forum Fellow
From: Ireland
Registered: 2004-07-21
Posts: 9,839

Re: [Solved] custom systemd service error: Error spawning dbus-launch

Not a gnome user myself, but if I wanted something to change the wallpaper in my Openbox setup I wouldn't involve systemd at all. I would have thought gnome would have some utility for this built-in, but if not use nitrogen, feh, or other such tools.

Offline

#5 2014-06-08 15:47:54

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,414

Re: [Solved] custom systemd service error: Error spawning dbus-launch

tomk wrote:

Not a gnome user myself, but if I wanted something to change the wallpaper in my Openbox setup I wouldn't involve systemd at all. I would have thought gnome would have some utility for this built-in, but if not use nitrogen, feh, or other such tools.

This.

Really, you are just trying to make things overly complex.  But I was just trying to tell you how to achieve your goal along the path you were taking.  I too wouldn't involve systemd for such a task.  The advantages that systemd provides just aren't necessary for such a process.


Edit: Besides that, I think you would have to specify the $DISPLAY as well somewhere in that setup.  Either in the service file or the script you wrote.

Last edited by WonderWoofy (2014-06-08 15:49:01)

Offline

#6 2014-06-08 19:25:57

anptr
Member
Registered: 2011-10-20
Posts: 25

Re: [Solved] custom systemd service error: Error spawning dbus-launch

I actualy need a way to change wallpaper after gnome has loaded. I choosed systemd because it has some "hooks" (targets) for such thing. Maybe there is another alternatives to change wallpaper after gnome loads? This example of error just for localizing the problem. The whole thing is not about a changing background with systemd. I need to run script after gnome has loaded. This will download bing daily wallpaper and will set it to my desktop. Of course i can launch script myself, but i want to automate it somehow.

Offline

#7 2014-06-08 19:33:52

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,414

Re: [Solved] custom systemd service error: Error spawning dbus-launch

Why not use gnome's autostart functionality.  It has been a long time since I have used gnome, but I know it exists.

Offline

#8 2014-06-09 09:50:47

anptr
Member
Registered: 2011-10-20
Posts: 25

Re: [Solved] custom systemd service error: Error spawning dbus-launch

WonderWoofy wrote:

Why not use gnome's autostart functionality.  It has been a long time since I have used gnome, but I know it exists.

I created wallpaper.desktop file

[Desktop Entry]
Name=Bingwall
Type=Application
Exec=/home/test/scripts/wallpaper.php

and placed it into ~/.config/autostart. It works! Thank you for your answers.

Offline

#9 2014-06-09 15:09:59

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,414

Re: [Solved] custom systemd service error: Error spawning dbus-launch

Great!  Please mark the thread as [Solved].

Offline

Board footer

Powered by FluxBB