How to set a systemd unit to start after loading the desktop?
14
votes
4
answers
54451
views
I created systemd unit for x0vncserver like this
[Unit]
Description=Remote desktop service (VNC)
After=graphical.target
[Service]
Type=forking
User=user
ExecStart=/usr/bin/sh -c '/usr/bin/x0vncserver -display :0 -rfbport 5900 -passwordfile /home/user/.vnc/passwd &'
[Install]
WantedBy=multi-user.target
and enabled it to run but it fails. Then I realized as I am trying to load the original desktop using x0vncserver, I can only do that after loading the desktop itself completely. So I have to set the system unit to run after loading the desktop but how? Or any timed way to set it up? Though it may be possible by using desktop session tools but any systemd way solution?
and my default.target is
# systemctl get-default graphical.target
Asked by Pavel Sayekat
(621 rep)
Oct 13, 2017, 03:18 AM
Last activity: Sep 16, 2023, 05:35 AM
Last activity: Sep 16, 2023, 05:35 AM