![]() |
persistent x11vnc server
Okay, so my biggest problem with x11vnc on the N900 is it's tendency to crash or exit when you go offline or change network connections. Not a bug with the application per say, it's just not really optimized for usage on a mobile device that's hopping networks all day.
So I think I've got a solution: I've placed the following script (called vncs) in: /etc/network/if-up.d What this does is first off, starts a vnc server on the N900 whenever a network connection is established. Secondly, it will kill any vnc server that is already running so you don't end up with a boatload of vnc server processes running if you connect to several networks throughout the day. script follows: APPCHK=$(ps aux | grep -c x11vnc) if [ $APPCHK = '0' ]; then /usr/bin/nohup /usr/bin/x11vnc -forever & else /usr/bin/pkill x11vnc;/usr/bin/nohup /usr/bin/x11vnc -forever & fi I guess to have a truly persistent server you should change the "else" statement to do nothing. This should leave any running VNC server up and not start a new one when you start a new network connection. I prefer the above so that the VNC that's running is kicked off by the latest network connection, be that gprs or Wi-Fi, and not by a network connection that was established previously, but each to his own. |
Re: persistent x11vnc server
Hey. I'm interested in this piece of script, but what extension should it have? .py ?
Also, what libraries are needed to run this? Could you post a noob guide here? Thanks! |
Re: persistent x11vnc server
get root and then:
first, install the program: apt-get install x11vnc leafpad second, make the script leafpad /etc/network/if-up.d/vncs and copy the script. no extension. next: add at the top of the script: #!/bin/sh this is needed so linux can see what sort of file it is (instead of a exstension) hope this helps, BTW: you don't need to worry about libraries, as the package manager (apt) does. |
Re: persistent x11vnc server
I installed leafpad and x11vnc, I created the vncs file in /etc/network/if-up.d/
I added the following code and saved it: Code:
#!/bin/sh Any help? |
Re: persistent x11vnc server
I got this working after a lot of testing.
change if [ $APPCHK = '0' ]; to if [ $APPCHK = '1' ]; You might also want to add a terminate app script on if-post-down.d Hope it helps. |
Re: persistent x11vnc server
it's still the same for me :(
|
Re: persistent x11vnc server
How do you get information about the current connection?
i would like to test for a name (for wireless). |
All times are GMT. The time now is 06:13. |
vBulletin® Version 3.8.8