LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Some kind of kiosk. (https://www.linuxquestions.org/questions/linux-newbie-8/some-kind-of-kiosk-4175519199/)

ferite 09-17-2014 02:18 PM

Some kind of kiosk.
 
Hi:

I need to setup my Lubuntu system to serve as a kind of kiosk, where a custom Java application should be run on startup, and it should be avoid that users interact with the desktop environment. Because of this I would like to ask the advice of the community to:

1. Make the system run the custom java application on startup.This application should run as root.
2. Avoid the desktop environment to load.
3. Autologin to the system. The session started can be root. As the custom app is going to be the only UI, there should not be risk in start the session as root.

Thanks for your reading and for the tips you could give me.

szboardstretcher 09-17-2014 02:57 PM

In general, doing this is not complicated. You can do it with any distro you like as a start.

I would use Arch Linux for it.

Then only install what you need, and set up a systemd unit to run the java application on startup.

notKlaatu 09-17-2014 03:03 PM

I did something similar to this on a Raspberry Pi running Fedora. The application I needed to start was Python, not Java, but it's actually pretty easy.

It is detailed here http://makerbox.wordpress.com/2014/0...tric-painting/

However, I have not done exactly what you are looking to do; I did not need a GUI. So I'm thinking out loud here, with some ideas rather than exact instructions:

The way I think I'd go about what you are trying to do is to uninstall the desktop (LXDE) and the session manager (I think Lubuntu uses LightDM). You will probably want to do that from a text console (ctrl-alt-F3, for example).

Then find the systemd startup script that executes the graphical server (X). Modify it such that when the X environment starts, so does your java application.

I'm not sure what *buntu does when no session manager is found, so you might need to enable auto login to your text console. That's detailed in the post.

It will require some experimentation and testing.

If you try this sort of thing, let me know how it goes and what you did to make it happen, and I'll make my responses here less dependent on the external link.

frankbell 09-17-2014 08:33 PM

A search for "ubuntu kiosk mode" turns up so many links that I couldn't pick on one to post here. There are even YouTube tutorials.

They likely won't address your particular application (most of them are about enabling kiosk mode for a browser), but they should get you started.

ferite 09-17-2014 08:49 PM

Quote:

Originally Posted by notKlaatu (Post 5239884)
It is detailed here http://makerbox.wordpress.com/2014/0...tric-painting/


The way I think I'd go about what you are trying to do is to uninstall the desktop (LXDE) and the session manager (I think Lubuntu uses LightDM). You will probably want to do that from a text console (ctrl-alt-F3, for example).

Then find the systemd startup script that executes the graphical server (X). Modify it such that when the X environment starts, so does your java application.

I'm not sure what *buntu does when no session manager is found, so you might need to enable auto login to your text console. That's detailed in the post.

@notKlaatu, actually I googled this, and found that inside /usr/share/xsessions/, I should be able to create a ".desktop" file indicating the system what should be run on stratup. The standard file is some like:

Code:

[Desktop Entry]
# The names/descriptions should really be better
Name=Lubuntu
Comment=Lubuntu - Lightweight X11 desktop environment based on LXDE
Exec=/usr/bin/lxsession -s Lubuntu -e LXDE
# Icon=
Type=Application

By changing "Exec" command, you should be able to execute some script instead of loading the desktop. However I am only asked for login and password. If I give the credentials, the system asks again the login and pass, and so on.

Where should be located getty@.service you mention in the link?.I did not find a file with the same name.

Thanks.

ferite 09-18-2014 08:51 PM

Hi.

I followed this tutorial, where it is given the instruction for, starting from a "text only" system, you install xorg, and nodm to setup the kiosk.

Now, all went well with xorg. If I run:

Code:

$ startx
my ~/.xsession file get executed (I am using leafpad only as simple text):

Code:

#!/usr/bin/env bash
echo "something" > /root/someFile
leafpad

but when I boot the system, all I got is a black screen. It is supposed that nodm should trigger an XSession, but something is happening. My /etc/default/nodm is:

Code:

NODM_ENABLED=true

NODM_USER=root

NODM_FIRST_VT='7'

NODM_XSESSION=/etc/X11/Xsession

NODM_X_OPTIONS='-nolisten tcp'

NODM_MIN_SESSION_TIME=60

I have tried with a different (non root) user, but the result is the same.

I hope I could get some help in this regard.


All times are GMT -5. The time now is 06:53 PM.