Page 1 of 1
permission systemd x11vnc.service solved
Posted: Thu Sep 27, 2018 9:49 am
by klein
hi
i have just installed mx17.01 32bit on an old hp dx2000.
i updated the system and tried setting up x11vnc with systemd,
so it will let me login headless.
i'v done this on ubuntu and sparky but it seems to me i'm having a
permission problem in mx :
Failed to add /run/systemd/ask-password to directory watch: No such file or directory
Failed to start x11vnc.service: Unknown unit: x11vnc.service
i do not wont it to ask for a password , i would like it to start automatically .
could someone point me in the right direction.
i created the file :
/etc/systemd/system/x11vnc.service
Code: Select all
[Unit]
Description=x11vnc
Requires=display-manager.service
After=display-manager.service
[Service]
ExecStart=/usr/bin/x11vnc -xkb -noxrecord -noxfixes -noxdamage -auth /var/run/lightdm/root/:0 -auth guess -rfbauth /etc/x11vnc.pass
ExecStop=/usr/bin/killall x11vnc
Restart=on-failure
Restart-sec=2
[Install]
WantedBy=multi-user.target
then i did in a terminal :
Code: Select all
$ chown root:root /etc/systemd/system/x11vnc.service
Code: Select all
$ chmod 700 /etc/systemd/system/x11vnc.service
Failed to add /run/systemd/ask-password to directory watch: No such file or directory
Failed to start x11vnc.service: Unknown unit: x11vnc.service
Re: permission systemd x11vnc.service
Posted: Thu Sep 27, 2018 10:21 am
by dolphin_oracle
have you booted up in systemd mode? MX boots sysvinit by default, but there is the option under the "Advanced" tab in the grub boot menu.
Re: permission systemd x11vnc.service
Posted: Thu Sep 27, 2018 10:25 am
by fehlix
Would you mind editing your post and wrap the file text-content into [code] [/code]
for better readability by marking/highlight the text-part with the cursor and pressing </> above the editor window.
Thanks
Re: permission systemd x11vnc.service
Posted: Thu Sep 27, 2018 10:30 am
by fehlix
dolphin_oracle wrote: Thu Sep 27, 2018 10:21 am
have you booted up in systemd mode? MX boots sysvinit by default, but there is the option under the "Advanced" tab in the grub boot menu.
Exactly, that's the error message you get when running privileged systemctl commands within booted SysVinit MX17:
Code: Select all
Failed to add /run/systemd/ask-password to directory watch: No such file or directory
Re: permission systemd x11vnc.service
Posted: Thu Sep 27, 2018 11:10 am
by dolphin_oracle
fehlix wrote: Thu Sep 27, 2018 10:30 am
dolphin_oracle wrote: Thu Sep 27, 2018 10:21 am
have you booted up in systemd mode? MX boots sysvinit by default, but there is the option under the "Advanced" tab in the grub boot menu.
Exactly, that's the error message you get when running privileged systemctl commands within booted SysVinit MX17:
Code: Select all
Failed to add /run/systemd/ask-password to directory watch: No such file or directory
as expected, since systemd isn't running. if you want to do things with .service files, which are a systemd beast, then you need to boot in systemd mode to test them.
Re: permission systemd x11vnc.service
Posted: Thu Sep 27, 2018 2:16 pm
by klein
hi
fehlix i'm unsure of how to edit my first post on this forum, but i will try .
dolphin_oracle i was unaware that mx did not run systemd at time of my first post.
i checked for the dir for systemd, i have no love for systemd !
i was reading mx17.1 pdf and hadn't gotten to the part about systemd.
init.d is the startup that mx is using ?
at this point i'm reading about SysVinit
i would like to have the x11vnc server running at the login page, so i can login head less
Re: permission systemd x11vnc.service [Solved]
Posted: Thu Sep 27, 2018 2:48 pm
by fehlix
klein wrote: Thu Sep 27, 2018 2:16 pm
hi
fehlix i'm unsure of how to edit my first post on this forum, but i will try .
dolphin_oracle i was unaware that mx did not run systemd at time of my first post.
i checked for the dir for systemd, i have no love for systemd !
i was reading mx17.1 pdf and hadn't gotten to the part about systemd.
init.d is the startup that mx is using ?
at this point i'm reading about SysVinit
i would like to have the x11vnc server running at the login page, so i can login head less
To edit you first post just click the left pencil-icon at right upper corner of the post.
The default is SysVInit (init.d) start is used by MX. With in the Grub submenu
you'll find a systemd boot option. The main idea is just incase
to offer this for those who need or who prefer to have systemd running.
Their might be some glitches with systemd as it is not main focus of MX.
You'll find some statement about systemd and MX with the manual and the wiki.
The service file you created need just to be "converted" to a init.d file.
If you have checked that the command above with the service file will work,
for the start I might look and see I post a simple template for a init.d startup file.
With further instruction how to start...

Re: permission systemd x11vnc.service
Posted: Thu Sep 27, 2018 8:27 pm
by klein
hi
does mx17.1 use init.d System-V or upstart?
Re: permission systemd x11vnc.service
Posted: Thu Sep 27, 2018 8:55 pm
by fehlix
klein wrote: Thu Sep 27, 2018 8:27 pm
hi
does mx17.1 use init.d System-V or upstart?
MX default is SysVinit.
You can look in to the existing init.d scripts at /etc/init.d.
An alternative simple solution to have your vnc daemon up and running
would be to add your vnc-start -line into /etc/rc.local, so it would run at the end of the runlevel.
e.g. like this:
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
Might be this is already a working solution for you.

Re: permission systemd x11vnc.service
Posted: Thu Sep 27, 2018 8:56 pm
by Richard
MX Linux uses SysV init by default.
It makes use of the systemd shim and installs basic systemd for compatibility
with some apps that are hard-wired for systemd against all logic.
Apps are supposed to be indifferent to init system used, but (some apps) & systemd break this --hence systemd-shim.
Re: permission systemd x11vnc.service
Posted: Thu Sep 27, 2018 9:30 pm
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
Re: permission systemd x11vnc.service
Posted: Fri Sep 28, 2018 6:35 am
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:
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.
Re: permission systemd x11vnc.service
Posted: Fri Sep 28, 2018 10:27 am
by klein
fehlix that also worked .
thanks fehlix Richard
Re: permission systemd x11vnc.service solved
Posted: Mon Sep 02, 2019 10:41 pm
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.