Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

This question already has an answer here:

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?

share|improve this question

marked as duplicate by jasonwryan, Renan, Gilles, rahmu, Michael Mrozek Feb 12 '13 at 4:51

This question was marked as an exact duplicate of an existing question.

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 Feb 11 '13 at 23:37
up vote 0 down vote accepted

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..

share|improve this answer

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.

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.