Page 1 of 1

load x11vnc on startup

Posted: Mon Apr 13, 2020 9:24 am
by martinN
what have i done:

sudo pkg install x11vnc
sudo x11vnc -storepasswd /etc/x11vnc.pass
sudo x11vnc -display :0 -rfbauth /etc/x11vnc.pass

and it works fine.

But i can't find a working solution for a startup script for FreeBSD or GhostBSD.
All other Linux scripts are not working here.

Example: sudo systemctl enable x11vnc.service

how can i enable that in GhostBSD?

Re: load x11vnc on startup

Posted: Mon Apr 13, 2020 5:17 pm
by slughorn
I hop that the man pages will bring you a step further:
https://www.freebsd.org/cgi/man.cgi?que ... ormat=html

Re: load x11vnc on startup

Posted: Mon Apr 13, 2020 6:24 pm
by ericbsd
There is no service for x11vnc in FreeBSD and GhostBSD also systemctl command will not be find on FreeBSD systems.

Re: load x11vnc on startup

Posted: Tue Apr 14, 2020 3:58 am
by martinN
Hi ericbsd,
did You mean, there is no way to start x11vnc on boot?
And it is waisting time to follow slughorn?

Re: load x11vnc on startup

Posted: Tue Apr 14, 2020 4:45 am
by martinN
Hi slughorn,
thanks for the link. I know about this and similar pages. I use those pages when i want to optimise some exsisting routines.
But in this case i am just a primary schoolboy. I don't know, how to start with building a startup routines for BSD.
I can read text, i can write it to a terminal and then i cont on it to work.
I found a lot of posts with some rc.d-scripting and i think that is the way i have to go.
I found this: https://www.freebsd.org/doc/en_US.ISO88 ... index.html
and i tried point 3, the dummy script, and it worked (after a reboot).
But i have no idea how i get this: "x11vnc -display :0 -rfbauth /etc/x11vnc.pass" to work with a rc.d-script.
I tried this:

#!/bin/sh

. /etc/rc.subr

name="runx11"
start_cmd="${name}_start"
stop_cmd=":"

runx11_start()
{
x11vnc -display :0 -rfbauth /etc/x11vnc.pass
}

load_rc_config $name
run_rc_command "$1"

but that doesn't work.

In this case i need some help.

Re: load x11vnc on startup

Posted: Wed Apr 15, 2020 2:38 pm
by slughorn
There are some rules. Please read here https://wiki.ghostbsd.org/index.php/OpenRC

Re: load x11vnc on startup

Posted: Thu Apr 16, 2020 4:16 pm
by martinN
Hi slughorn,
thanks for the additional informations, but it is really too much for me.
There is only one command line (it works perfect when i type it manually):
"x11vnc -display :0 -rfbport 5900 -localhost -bg -rfbauth /etc/x11vnc.pass"
I found some examples and i edited them, but i had no success.
Is this so ununsual what i'm trying? Or is there a better way to connect to the desktop with a VNC-Viewer?

Re: load x11vnc on startup

Posted: Sat Apr 18, 2020 1:15 pm
by slughorn
I'm not a developer yet. But if your command works on the cli, I would try the following steps:
1. Make a shell script "foo" (foo ist a replacement for your script name] and test it
2. Save this skript in the dirctory

Code: Select all

/usr/local/etc/init.d
(There are some examples too, take as an example cupsd in this directory)
3. Make

Code: Select all

chmod +x foo
4. Take [https://wiki.ghostbsd.org/index.php/Rc-update rc-update] and make

Code: Select all

rc-update add foo
With rc-update you can safely add the new service
5. Report me please, if it works