This forum has been archived. All content is frozen. Please use KDE Discuss instead.

KRFB Remote desktop as daemon

Tags: None
(comma "," separated)
User avatar
mbnoimi
Registered Member
Posts
216
Karma
0
OS

KRFB Remote desktop as daemon

Tue Apr 16, 2013 6:57 am
I'm using KRFB as remote desktop server in my Linux Mint KDE.
It works fine as usual remote desktop server but I've to log-in then run it manually (or at start up)

How can I run KRFB as daemon without need to log-in at first?

PS
As I know "upstart" for CLI not for GUI applications.
User avatar
google01103
Manager
Posts
6668
Karma
25

Re: KRFB Remote desktop as daemon

Tue Apr 16, 2013 12:24 pm
Google'ing returns:

http://linux.die.net/man/1/daemonize
http://software.clapper.org/daemonize/

no experience with this but sounds appropriate


OpenSuse Leap 42.1 x64, Plasma 5.x

User avatar
mbnoimi
Registered Member
Posts
216
Karma
0
OS

Re: KRFB Remote desktop as daemon

Tue Apr 16, 2013 3:16 pm
google01103 wrote:Google'ing returns:

http://linux.die.net/man/1/daemonize
http://software.clapper.org/daemonize/

no experience with this but sounds appropriate


I open my post after gave up from google :( "daemonize" just like "upstart" both of them run the applications as daemon but those applications have to be CLI not GUI. KRFB is GUI based so upstart can't run it as daemon.
User avatar
google01103
Manager
Posts
6668
Karma
25

Re: KRFB Remote desktop as daemon

Tue Apr 16, 2013 6:30 pm
maybe you can't, maybe you need to setup a vnc or nx server to run as a daemon

seems like to use krfb you'd need to autologin when the server was booted then autostart the app

might be better to start a thread with something like "graphically accessing a remote machine at boot"


OpenSuse Leap 42.1 x64, Plasma 5.x

User avatar
mbnoimi
Registered Member
Posts
216
Karma
0
OS

Re: KRFB Remote desktop as daemon

Tue Apr 16, 2013 10:48 pm
google01103 wrote:maybe you can't, maybe you need to setup a vnc or nx server to run as a daemon

seems like to use krfb you'd need to autologin when the server was booted then autostart the app


The problem with auto-login is the security, because it needs some minutes until activating system locking.

If any one guide me to a way for locking the system in duration less than 1min this will fix the whole issue.
User avatar
bcooksley
Administrator
Posts
19765
Karma
87
OS

Re: KRFB Remote desktop as daemon

Wed Apr 17, 2013 3:11 am
If you are looking to be able to login as different users on the system then you need to setup VNC / NX as mentioned previously to achieve the desired goal.

If however, you are just looking to work as a single user on the system, then KRFB should work for your purposes.
To enable automatic lock on login, set "DESKTOP_LOCKED=1" as part of the environment when the user logs in.

The easiest way to do this is by creating a executable script file in "~/.kde4/env/". If you do not have a ~/.kde4/ directory but do have ~/.kde/ then it belongs in ~/.kde/env/ instead. This file must have a .sh extension, and the environment variable in question should be exported.


KDE Sysadmin
[img]content/bcooksley_sig.png[/img]
User avatar
mbnoimi
Registered Member
Posts
216
Karma
0
OS

Re: KRFB Remote desktop as daemon

Wed Apr 17, 2013 11:43 am
I create executable locking.sh file in "~/.kde/env/" and I noticed that this file is added to KDE's Autostart
http://img819.imageshack.us/img819/9444/snapshot04.png

The content of locking.sh:
Code: Select all
#!/bin/bash

export DESKTOP_LOCKED=1


Energy Saving configurations:
http://img441.imageshack.us/img441/5452/snapshot05.png
User avatar
bcooksley
Administrator
Posts
19765
Karma
87
OS

Re: KRFB Remote desktop as daemon

Fri Apr 19, 2013 6:43 am
Yes, that is to be expected, as the script file you added (assuming it is executable) is invoked as part of the KDE startup process - which is how it works. Did adding that have the desired affect of locking the desktop on login?


KDE Sysadmin
[img]content/bcooksley_sig.png[/img]
User avatar
mbnoimi
Registered Member
Posts
216
Karma
0
OS

Re: KRFB Remote desktop as daemon

Fri Apr 19, 2013 10:25 am
bcooksley wrote:Yes, that is to be expected, as the script file you added (assuming it is executable) is invoked as part of the KDE startup process - which is how it works. Did adding that have the desired affect of locking the desktop on login?

Actually it didn't affect at all although I set it as executable.
User avatar
bcooksley
Administrator
Posts
19765
Karma
87
OS

Re: KRFB Remote desktop as daemon

Sat Apr 20, 2013 6:10 am
Ah, i've just checked the code. It turns out the variable is only "DESKTOP_LOCKED" to a point before where those environment variable scripts are sourced - it changes to "dl", and then sources those scripts.

Please adapt your script to set "dl" instead of "DESKTOP_LOCKED" - hopefully this will fix it.


KDE Sysadmin
[img]content/bcooksley_sig.png[/img]
User avatar
mbnoimi
Registered Member
Posts
216
Karma
0
OS

Re: KRFB Remote desktop as daemon  Topic is solved

Sun Apr 21, 2013 12:11 am
bcooksley wrote:Ah, i've just checked the code. It turns out the variable is only "DESKTOP_LOCKED" to a point before where those environment variable scripts are sourced - it changes to "dl", and then sources those scripts.

Please adapt your script to set "dl" instead of "DESKTOP_LOCKED" - hopefully this will fix it.

Thanks a lot for your suggestion but I discovered that GUI system settings offers that option without creating any .sh files manually (Lock Session).... Voila ;D

See this screenshot
http://img109.imageshack.us/img109/7422/snapshot07.png


Bookmarks



Who is online

Registered users: Bing [Bot], Google [Bot], Yahoo [Bot]