Results 1 to 7 of 7
hi
I want to run c/c++ console (using ncurses) application as autorun application in a text mode.So what command i shld write in a inittab file.which settings I shld i ...
- 11-19-2007 #1Just Joined!
- Join Date
- Sep 2007
- Posts
- 46
using inittab
hi
I want to run c/c++ console (using ncurses) application as autorun application in a text mode.So what command i shld write in a inittab file.which settings I shld i hv to make in a directory...
Please explain me in detail.
Thanks & Regards
vineeta7
- 11-19-2007 #2
I've never done this, but it shouldn't be too difficult.
Do this at the command line:
When you are familiar with the content of that man page, look at your inittab file. See how it sets up something on various virtual terminals. Choose one of those virtual terminals and replace the command in that line with a command that runs a script. It would probably not be a good idea to use virtual terminal 1 for this. In environments with which I am familiar, anything from 2 through 6 would be ok.Code:man inittab
In this script should be the name of a script that you write. Be sure to enter the full path name of that script, beginning with "/".
In your script, you should do three things.
First, the script is running as root, so use "su" to change your user ID to whichever one will be running the application.
Second, set all the environment variables you need. You may not be aware of any particular ones. To get the list of environment variabls you should probably set, take the ones you already know about and add to them most of the ones you get by doing this at the command line:
If you don't know whether you can leave out a particular environment variable, include it.Code:env | sort | less
The third thing your script should do is run the program itself. Be sure to name the program using its full path name, starting with "/".
I know this is general, but you can learn much about Linux by rolling up your sleeves and getting your fingernails dirty.
Hope this helps.--
Bill
Old age and treachery will overcome youth and skill.
- 11-19-2007 #3Linux Guru
- Join Date
- Nov 2004
- Posts
- 6,110
You should probably be looking to put this in /etc/profile rather than inittab.
- 11-19-2007 #4
Quoth bigtomrodney:
Good point. The question is this, vinetta7:You should probably be looking to put this in /etc/profile rather than inittab.
- Do you want this to run automatically when you log in as a certain user?
- Or do you want it to run without logging in at all, when you boot the system?
If (1), then you want /etc/profile. If (2), then you want the inittab file, and of course you'd better be root, or have root as your friend.
My assumption, since you had specifically mentioned the inittab file, was that you wanted (2).--
Bill
Old age and treachery will overcome youth and skill.
- 11-20-2007 #5Just Joined!
- Join Date
- Sep 2007
- Posts
- 46
yes I want to run it before login...
till I am not getting exactly...Please tell me what command i shld write in inittab.... which folder i shld put my execuable file?????
Please reply
vineeta7
- 11-20-2007 #6
Sorry to go off-topic but wje: check your private messages.
- 11-20-2007 #7
The command in inittab should be the full pathname of the script which sets your environment variables, changes your user ID, and runs your program.
Since this script is run as root, and since root can read anything it wants, you can put that script anywhere you want, and use that full pathname as the command to put into inittab.
Your user program should be put in a directory that the user who is to run the program can use. The command within your script which runs that program should ordinarily provide the full pathname of that command.--
Bill
Old age and treachery will overcome youth and skill.


Reply With Quote