Start x11vnc at boot

Everything about external control, apps, VNC, etc goes here.

Moderators: marcelr, TheHogNL, Toonz

Post Reply
Erik007
Starting Member
Starting Member
Posts: 16
Joined: Thu Feb 14, 2019 12:31 pm

Start x11vnc at boot

Post by Erik007 »

Maybe handy for someone else.
I created a rc.local
( rc.local can be used to do some things after boot)
and a startupfile for x11vnc



I wanted x11vnc to start at boot and did the following:

touch rc.local
ln -s /etc/rc.local /etc/rc5.d/S99rc

vi /etc/rc.local
======
#!/bin/sh
set -e
/usr/bin/startx11.sh &

exit 0
======
chmod 755 /etc/rc.local


vi /usr/bin/startx11.sh
======
#!/bin/sh
set PATH="/bin:/usr/bin:/usr/local/bin:/sbin:/usr/sbin:/usr/local/sbin"

exec 2> /tmp/startx11.log
exec 1>&2

su - root -c "/usr/bin/x11vnc :0 &" &
=======
chmod 755 /usr/bin/startx11.sh
mAiden
Member
Member
Posts: 330
Joined: Mon Jul 10, 2017 10:22 am

Re: Start x11vnc at boot

Post by mAiden »

Will advise you to use x11vnc only when you need it.
On Toon1, this actually eats processor space, and you just need this space to let Toon run properly, without having to restart itself.
That's my opinion. :)
Member of the Toon Software Collective
Erik007
Starting Member
Starting Member
Posts: 16
Joined: Thu Feb 14, 2019 12:31 pm

Re: Start x11vnc at boot

Post by Erik007 »

Here some data:

5 minuten na startup - met starten x11vnc - tigervnc not connected

Mem: 109748K used, 16448K free, 128K shrd, 0K buff, 38160K cached
CPU: 3.5% usr 5.1% sys 0.0% nic 91.2% idle 0.0% io 0.0% irq 0.0% sirq
Load average: 0.43 0.66 0.32 1/140 1629

5 minuten na startup - met x11vnc - met tigervnc connected

Mem: 113532K used, 12664K free, 128K shrd, 0K buff, 38624K cached
CPU: 7.3% usr 3.1% sys 0.0% nic 89.5% idle 0.0% io 0.0% irq 0.0% sirq
Load average: 1.64 0.81 0.46 1/140 2180

5 minuten na startup - zonder x11vnc te starten

Mem: 105412K used, 20784K free, 120K shrd, 0K buff, 37428K cached
CPU: 4.1% usr 5.1% sys 0.0% nic 90.6% idle 0.0% io 0.0% irq 0.0% sirq
Load average: 0.64 0.57 0.29 1/139 1679

So as you can see;
memory for loading program, about 4000K
with tigervnc connected another 4000K
Processor usage with 0.32; without about 0.29 -- 0.03 not a very big difference
Processor usage with tigervnc, about -- 0.17

So, unless you need that 4000K extra memory ..
Toonz
Forum Moderator
Forum Moderator
Posts: 1873
Joined: Mon Dec 19, 2016 1:58 pm

Re: Start x11vnc at boot

Post by Toonz »

Erik007 wrote:So, unless you need that 4000K extra memory ..
Especially on a Toon1 with lot of custom apps installed, this could mean the difference between stable operations and spontaneous reboots because of lack of RAM
member of the Toon Software Collective
mAiden
Member
Member
Posts: 330
Joined: Mon Jul 10, 2017 10:22 am

Re: Start x11vnc at boot

Post by mAiden »

Toonz wrote:
Erik007 wrote:So, unless you need that 4000K extra memory ..
Especially on a Toon1 with lot of custom apps installed, this could mean the difference between stable operations and spontaneous reboots because of lack of RAM
This is what I meant, Toon1 only has 128MB DDR on 133Mhz (and 128MB NAND flash). Especially with many custom apps installed, he really needs this space.
On Toon2 is this not a issue, then we talk about it 512Mb DDR3 @ 800Mhz (and 4Gb eMMC Flash, support up to 8GB)
Member of the Toon Software Collective
NLKris
Starting Member
Starting Member
Posts: 33
Joined: Sat Jan 26, 2019 4:16 am

Re: Start x11vnc at boot

Post by NLKris »

I've tried this on a Toon 1. My Toon did not start up futher than +/- 15%. Thank god that dropbear is one of the first things to start. After connecting with SSH and deleting the files i've made in the steps on top of this, its back alive.
PeJeWe
Member
Member
Posts: 80
Joined: Thu Apr 25, 2019 6:51 am

Re: Start x11vnc at boot

Post by PeJeWe »

how can we shutdown x11vnc manually?
Rooted Toon 1, Domoticz running on a RPI3b+, RFXCOM XL, RFLINK.
mAiden
Member
Member
Posts: 330
Joined: Mon Jul 10, 2017 10:22 am

Re: Start x11vnc at boot

Post by mAiden »

PeJeWe wrote:how can we shutdown x11vnc manually?
First do:

Code: Select all

ps x
This will give you a list with all the process al running on Toon.
Then look up for VNC, and hes PID, it stands at the beginning.

then run:

Code: Select all

kill -9 PID
Member of the Toon Software Collective
PeJeWe
Member
Member
Posts: 80
Joined: Thu Apr 25, 2019 6:51 am

Re: Start x11vnc at boot

Post by PeJeWe »

mAiden wrote:
PeJeWe wrote:how can we shutdown x11vnc manually?
First do:

Code: Select all

ps x
This will give you a list with all the process al running on Toon.
Then look up for VNC, and hes PID, it stands at the beginning.

then run:

Code: Select all

kill -9 PID
i get an error

Code: Select all

eneco-001-289077:~# ps --x
ps: unrecognized option '--x'
BusyBox v1.27.2 (2017-10-03 14:20:01 CEST) multi-call binary.

Usage: ps

Show list of processes

        w       Wide output
        l       Long output
        T       Show threads
i get no list
Rooted Toon 1, Domoticz running on a RPI3b+, RFXCOM XL, RFLINK.
mAiden
Member
Member
Posts: 330
Joined: Mon Jul 10, 2017 10:22 am

Re: Start x11vnc at boot

Post by mAiden »

You did it wrong.

You did: ps - -x

Most be: ps x
Member of the Toon Software Collective
PeJeWe
Member
Member
Posts: 80
Joined: Thu Apr 25, 2019 6:51 am

Re: Start x11vnc at boot

Post by PeJeWe »

mAiden wrote:You did it wrong.

You did: ps - -x

Most be: ps x

Code: Select all

eneco-001-289077:~# ps x
ps: invalid option -- 'x'
BusyBox v1.27.2 (2017-10-03 14:20:01 CEST) multi-call binary.

Usage: ps

Show list of processes

        w       Wide output
        l       Long output
        T       Show threads
eneco-001-289077:~# 
Did not work also.

Edit:

I rebooted my toon, now it is offline.
Rooted Toon 1, Domoticz running on a RPI3b+, RFXCOM XL, RFLINK.
Post Reply

Return to “Toon external control”