The unit file works when manually started. systemctl --user enable
does not auto-start the service after user login.
Unit File
[Unit]
Description = VNC Duplicate Display RDP
After = default.target
[Service]
Type = simple
ExecStart = /opt/tigervnc/usr/bin/x0vncserver -passwordfile /etc/.vncpasswd -display :0
TimeoutSec = 30
RestartSec = 10
Restart = always
[Install]
WantedBy = default.target
I have reloaded and reenabled this unit
$ systemctl --user daemon-reload
$ systemctl --user reenable x0vncserver
Status
Status after user login
● x0vncserver.service - VNC Duplicate Display RDP
Loaded: loaded (/usr/lib/systemd/user/x0vncserver.service; enabled; vendor preset: enabled)
Active: inactive (dead)
Target Status
$ systemctl --user --type target
UNIT LOAD ACTIVE SUB DESCRIPTION
basic.target loaded active active Basic System
default.target loaded active active Default
paths.target loaded active active Paths
sockets.target loaded active active Sockets
timers.target loaded active active Timers
LOAD = Reflects whether the unit definition was properly loaded.
ACTIVE = The high-level unit activation state, i.e. generalization of SUB.
SUB = The low-level unit activation state, values depend on unit type.
5 loaded units listed. Pass --all to see loaded but inactive units, too.
To show all installed unit files use 'systemctl list-unit-files'.
Manual Start
$ systemctl --user start x0vncserver
$ systemctl --user status x0vncserver
● x0vncserver.service - VNC Duplicate Display RDP
Loaded: loaded (/usr/lib/systemd/user/x0vncserver.service; enabled; vendor preset: enabled)
Active: active (running) since Mon 2017-08-07 18:27:00 IST; 5s ago
Main PID: 2999 (x0vncserver)
CGroup: /user.slice/user-1004.slice/user@1004.service/x0vncserver.service
└─2999 /opt/tigervnc/usr/bin/x0vncserver -passwordfile /etc/.vncpasswd -display :0
Aug 07 18:27:00 Machine systemd[930]: Started VNC Duplicate Display RDP.
Aug 07 18:27:00 Machine x0vncserver[2999]: Mon Aug 7 18:27:00 2017
Aug 07 18:27:00 Machine x0vncserver[2999]: Geometry: Desktop geometry is set to 1920x1080+0+0
Aug 07 18:27:00 Machine x0vncserver[2999]: Main: XTest extension present - version 2.2
Aug 07 18:27:00 Machine x0vncserver[2999]: Main: Listening on port 5900
References
I've looked around and found users with similar issues but none of the proposed solutions fixed my issue
- https://stackoverflow.com/questions/39871883/systemctl-status-shows-inactive-dead
- https://bbs.archlinux.org/viewtopic.php?id=170344
- Why is my Systemd unit loaded, but inactive (dead)?
- https://github.com/systemd/systemd/issues/4301
- https://github.com/systemd/systemd/issues/2690
- https://superuser.com/questions/955922/enabled-systemd-unit-does-not-start-at-boot
Update
This happens to a particular user. systemctl --user enable
works for at least one other user on the same device.
x0vncserver