I wonder, is it possible to compile Unix along with a my custom program so that it runs only my custom program on start up of computer, as if my program starting with boot up?
-
You mean a daemon? – Eddy_Em Feb 11 '13 at 20:55
-
I'm sure you can do that in linux, but you may need to do some research, hot to compile linux distribution and program you want. – blogger Feb 11 '13 at 21:17
-
Yes, this is called a kiosk. – Gilles 'SO- stop being evil' Feb 11 '13 at 23:37
2 Answers
As you say, directly no. The Unix kernel is separate from the userland programs, and is built separately.
But what you want to do is possible. The init program, traditionally the first process to run on Unix, is a (somewhat special) normal user process. So it is certainly possible to set things up so that your program is the only one running on the system. But consider that init traditionally has a lot of other responsibilities (check configuration and set up userland to run, check filesystems if required, ...), so I'd advise against it. The init (and other) machinery required by a modern Unix system is lightweight, and it is much easier to set a "normal" system up o just start your application normally after handling the chores of starting up.
- 18,156
- 2
- 37
- 59
If you mean you only want users to be able to run one program, you can replace the user's shell with the absolute path to the program in the passwd file - assuming a local passwd file..
- 275
- 2
- 2