metal mark
Posts: 81
Joined: Tue Apr 17, 2012 4:44 pm

Can linux be made to service one application.

Thu May 09, 2013 7:05 pm

This may be a stupid question but is it possible to make Linux service only one application. If there is only one .exe file to be run is it possible to tell Linux to stop polling round, for want of a better word, looking to see if anything else requires service. I am new to Linux and its distro,s so it may well be a stupid question.
Regards Mark

shuckle
Posts: 565
Joined: Sun Aug 26, 2012 11:49 am
Location: Finland

Re: Can linux be made to service one application.

Thu May 09, 2013 7:15 pm

No. Linux is multiuser multiprocess by nature.

SimonSmall
Posts: 220
Joined: Tue Oct 09, 2012 8:13 pm

Re: Can linux be made to service one application.

Thu May 09, 2013 7:30 pm

If you have your application, you can make the Pi start that when it boots. If you can make the Pi shutdown when you exit the application (also part of the start script) it might do what you want it to. You can stop some of the services to cut down the drain on CPU / memory. Although Linux is multiuser by design, you can login with only one user

Note that Linux programs are not .exe's as these are Windows only

Add a few details for a more comprehensive answer

User avatar
tedhale
Posts: 114
Joined: Thu Sep 20, 2012 4:52 pm
Location: Williamsburg, VA, USA
Contact: Website

Re: Can linux be made to service one application.

Thu May 09, 2013 7:31 pm

The best you can do is load a minimal system with all un-needed services disabled.
Several people have posted links to minimal Raspian images on this board.
- Ted B. Hale
http://raspberrypihobbyist.blogspot.com

metal mark
Posts: 81
Joined: Tue Apr 17, 2012 4:44 pm

Re: Can linux be made to service one application.

Thu May 09, 2013 7:50 pm

Thanks for your comments. I have written a Lazarus program that runs fine on the RPI , however it is useing the GPIO to monitor real time events from IR beams. It is not as yet useing interrupts only monitoring loops. I have put "application.processmessages" lines in the code at points that I expect the program to be simply waiting for the next event in the hope that Linux will do its thing in responce to these lines and less likely to be wanting to do something when my code is active. There will only be the one Lazarus .exe file running. Hope that may help.
Regards Mark

User avatar
jojopi
Posts: 3085
Joined: Tue Oct 11, 2011 8:38 pm

Re: Can linux be made to service one application.

Thu May 09, 2013 8:01 pm

metal mark wrote:This may be a stupid question but is it possible to make Linux service only one application.
The literal answer is yes. If you add " init=/path/to/your/program" to cmdline.txt, then at boot the kernel will start your application and no others.

Some programs will not function without the assistance of the normal background daemons, however. And even if there are no other user processes to schedule there will still be hardware interrupts and kernel threads, so you cannot guarantee to get exclusive access to the CPU for long periods.

If you just want high scheduling priority for short periods, then see "man chrt".

metal mark
Posts: 81
Joined: Tue Apr 17, 2012 4:44 pm

Re: Can linux be made to service one application.

Thu May 09, 2013 8:44 pm

Thank you all for your replies , I now have a few things to try out.
Many thanks.
Kind regards MM

Return to “General discussion”