You are not logged in.
I use pulseaudio-dlna (from AUR), a program that creates a pulseaudio sink to stream sound to a DLNA server. This needs to be run as a user. I can start it perfectly fine from the command line:
pulseaudio-dlnaI don't want to run it from the command line every time I need it. I saw that systemd has the option to run a program as a user, when that user logs in for the first time. See https://wiki.archlinux.org/index.php/Systemd/User. Note that for me, logging in means logging into Xfce with lightdm. So I created a service file:
[Unit]
Description=Pulseaudio DLNA
[Service]
ExecStart=/usr/bin/pulseaudio-dlna
[Install]
WantedBy=multi-user.targetNow I can start my service from a terminal in Xfce:
systemctl --user start pulseaudio-dlnaI enabled my service, assuming that this would start it when I log on to X:
systemctl --user enable pulseaudio-dlnaBut after logging in, nothing happens. Then I thought, let's do it the ugly way. So in the Autostart settings of Xfce, I now added the line
systemctl --user start pulseaudio-dlnaThis still doesn't work, because now the service does start, but crashes because for some reason it cannot find the ip-address of the host (my computer). I can supply that as a parameter but that also doesn't work because it cannot find the network. But at this point I feel I'm digressing too much. Does anyone have an idea why it doesn't start when I log in to X?
Offline
Offline
Requires=network.target
After=network.targetOtherwise maybe paste the actual error messages about the missing IP/network.
Also the setup where you run the service shown in #1 as user service from XFCE autostart is rather detouring - you could just run the command directly.
Online