Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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
    
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
add comment

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

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

2 Answers

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
add comment

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
add comment

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