You are not logged in.

#1 2013-12-10 07:03:52

Ownaginatious
Member
Registered: 2010-08-28
Posts: 60

Enabled services not starting under a user instance of systemd :(

So I have a user instance of systemd enabled so I can have it handle X applications. I have one service defined like this:

[Unit]
Description=CPU and GPU sensor reader.
Requires=xorg.target

[Service]
ExecStart=/etc/i3_sensor_scripts/gen_script.sh
Restart=always
RestartSec=10
Environment=DISPLAY=:%i

The service simply polls the temperature on my video card and CPU. Due to some idiot at AMD/ATI deciding that details like that shouldn't be accessible unless the xserver is started (even though it's through the command line), I'm forced to go this route with the user instance of systemd.

Anyway, I can successfully enable it like this:

systemctl --user enable sensor_reader@0.service

That yields;

ln -s '/home/mike/.config/systemd/user/sensor_reader@0.service' '/home/mike/.config/systemd/user/multi-user.target.wants/sensor_reader@0.service'

However, when I restart the computer and it boots into my desktop, the service doesn't start automatically. If I run:

systemctl --user start sensor_reader@0.service

It runs fine.

Any idea what's going on here? Do I need to enable another service to enable services or something?

Any help would be appreciated.

Thanks!

Offline

#2 2013-12-10 07:32:58

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

Re: Enabled services not starting under a user instance of systemd :(

I think that the user session works just like the system session.  So when it starts systemd --user, it will just start whatever it deems the default.target.  So you need to additionally set up a target, then make that the default.target.  Then set your service there to be WantedBy this new target you have set up.  All this should be done in [Install] sections.

Offline

#3 2013-12-10 10:18:21

brain0
Developer
From: Aachen - Germany
Registered: 2005-01-03
Posts: 1,382

Re: Enabled services not starting under a user instance of systemd :(

multi-user.target does not exist in the user instance, try default.target instead.

Offline

Board footer

Powered by FluxBB