permission systemd x11vnc.service solved  [Solved]

Message
Author
klein

Re: permission systemd x11vnc.service

#11 Post by klein »

fehlix that worked like a charm, but i'm going to try and set up a init file so if it stops i wont have to reboot i can restart it from cli .

thank you fehlix & Richard

User avatar
fehlix
Developer
Posts: 12904
Joined: Wed Apr 11, 2018 5:09 pm

Re: permission systemd x11vnc.service

#12 Post by fehlix »

klein wrote: Thu Sep 27, 2018 9:30 pm ... but i'm going to try and set up a init file so if it stops i wont have to reboot i can restart it from cli .
Well, you have not to reboot in case it stops or you like to restart it.
Just run from the terminal command line or put those into a little (re)-start script
for manually starting / restarting and place it in to /usr/local/bin
like this example:

Code: Select all

#!/bin/bash
# name :x11vnc_start.sh
# dir: /usr/local/bin
# restart / start x11vnc daemon
#
/usr/bin/killall x11vnc >/dev/null 2>&1
sleep 2
/usr/bin/x11vnc -xkb -noxrecord -noxfixes -noxdamage -auth /var/run/lightdm/root/:0 -auth guess -rfbauth /etc/x11vnc.pass
echo "Status : " $?
Save / copy the above into -> /usr/local/bin/x11vnc_start.sh
Make it executable:

Code: Select all

sudo chmod +x /usr/local/bin/x11vnc_start.sh
and to restart x11vnx run as:

Code: Select all

sudo x11vnc_start.sh
In addition - just a small fine tuned variation for the rc.local method, regarding defined exit status:

Code: Select all

#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# x11vnc
/usr/bin/x11vnc -xkb -noxrecord -noxfixes -noxdamage -auth /var/run/lightdm/root/:0 -auth guess -rfbauth /etc/x11vnc.pass || exit 0

exit 0
This make sure rc.local will always finish successfully, regardless of the success to setup x11vnc.

klein

Re: permission systemd x11vnc.service

#13 Post by klein »

fehlix that also worked .

thanks fehlix Richard

sinux

Re: permission systemd x11vnc.service solved  [Solved]

#14 Post by sinux »

Thank you very much @fehlix your answer solved my issue as well wanted to find a working way to run x11vnc on boot. Tried everything google showed me but none worked, thank you very much again.

Post Reply

Return to “Software / Configuration”