Nefarious
Nefarious

Reputation: 516

Linux easy embedded application

I am building a simple SDL application, a brewery application, to run in my garage. I am looking for a straight forward way to have my application run at boot and provide no other access to system. If I need to change anything I will be able to use rsh to change things on the board. A friend told me I could do this easily by somehow modifying the lightdm script but haven't found a reference to anything like this.

The device runs ubuntu 14.4.

Any pointers would be appreciated.

Maybe:

Can I go to ~/.xinitrc and just put my application path on the exec line. If My application runs full screen?

Upvotes: 1

Views: 110

Answers (1)

rodrigo
rodrigo

Reputation: 98328

If it is a fullscreen SDL application (kiosk style), then my advice is to go plain X.

That is, do not run any WindowManager or CompositionManager, you don't need them. Do not run any DesktopManager or Greeter, you don't need them either.

When the system boots, just run the X server with your application as if it were the WM. For example from rc.local. I think that Ubuntu 14 supported running it as non-root:

 su - user -c /usr/bin/startx /usr/bin/myapp

Note that you may need to run manually a few applications in the background. It may be a good idea that your myapp be actually a script that runs those applications and then your program.

Alternatively you may run startx without arguments and it will run /home/user/.xinitrc automatically.

In the script you can write there all the backup programs (with &) and the last line should be your program (normally with exec /usr/bin/myapp, without &)

~/.xinitrc

xsetroot -solid gray & #set the background
exec xterm             #run a terminal

For an extended example, you can look at your /etc/X11/xinit/xinitrc, that is the default script if you do not specify any.


Done that, you still have a few hotkeys to access the system. The ones I can think of:

  • Ctrl+Alt+Del
  • Ctrl+Alt+Backspace
  • Ctrl+Alt+Fn
  • Alt+SysRq

But all of those are easily disabled. Anyway, hiding the keyboard and using an all-touchscreen system will be better, if possible. But be aware of any USB port available!

Then there is the boot procedure. You'll need to protect grub to avoid changing the boot options. And the BIOS, with a password, and disable the "Change boot order" option, if available.

And then there is the access to the hardware, (USB ports, screws, power button), but that depends on the security requirements of your installation.

Upvotes: 2

Related Questions