You are not logged in.

#1 2018-10-13 21:35:05

killkrt
Member
From: Italy
Registered: 2016-02-24
Posts: 35

[?] Vncserver fails at startup, but works if launched manually

Hi,

I have installed vncserver as explained in the wiki, and it was working, after a recent system upgrade it stopped to work.

This is the output of journalctl -u vncserver@:1.service:

Oct 13 23:15:35 shuttle systemd[1]: Starting Remote desktop...
Oct 13 23:15:36 shuttle systemd[377]: pam_unix(login:session): session opened for user killkrt by (uid=0)
Oct 13 23:15:36 shuttle systemd[1]: Started Remote desktop.
Oct 13 23:15:36 shuttle systemd[501]: pam_unix(login:session): session opened for user killkrt by (uid=0)
Oct 13 23:15:36 shuttle systemd[501]: pam_systemd(login:session): Failed to create session: Start job for unit user-1000.slice failed with 'canceled'

Then if I restart the service as root (via sudo systemctl restart vncserver@1:service) it starts with no problem.
So I guess that it is something related which user is starting the service, but I cannot understand how to fix it.

User 1000 is my user (killkrt) and in the VNC service I put killkrt as user (in the Service section):

[Unit]                                                                                                                                             
Description=Remote desktop                                                                          
After=syslog.target network.target                                                                  
                                                                                                     
[Service]                                                                                           
Type=simple                                                                                         
User=killkrt                                                                                        
PAMName=login                                                                                       
                                                                                                     
ExecStartPre=/bin/sh -c '/usr/bin/vncserver -kill %i > /dev/null 2>&1 || :'                         
ExecStart=/usr/bin/vncserver -geometry 1920x1080 -alwaysshared -localhost -fg %i                    
ExecStop=/usr/bin/vncserver -kill %i                                                                
                                                                                                     
[Install]                                                                                           
WantedBy=multi-user.target          

Offline

Board footer

Powered by FluxBB