siqe
10-10-2001, 11:51 PM
I want a program that i'm making to run automatically after I log in. Is there some special folder i can put it in or what? My machine doesn't use X its console only.
|
Click to See Complete Forum and Search --> : Getting a program to run automatically after login. siqe 10-10-2001, 11:51 PM I want a program that i'm making to run automatically after I log in. Is there some special folder i can put it in or what? My machine doesn't use X its console only. bigrigdriver 10-11-2001, 12:12 AM This is probably the easiest way. Once you know that your program works the way you want it to, use your favorite editor, and edit /etc/rc.d/rc.local; it's usually the last of the rc scripts to be run on boot. Open the file and cursor to the end, then write the command that starts the program of interest. Save and exit, then reboot to see if your program starts the way you want it to. Remember: You must put the program somewhere in your path in order to use only the program name to start it. Otherwise, write the entire path and filename to the folder you put the program in. ;) siqe 10-11-2001, 01:14 AM That will run the program when I boot up, but if I don't turn off the computer and just log off and log back on, it doesn't execute that script. scanez 10-11-2001, 02:31 AM Put the command in your shell config script. For bash, put it in .bashrc, for csh/tcsh put it in .cshrc Then it will run everytime a new shell is started Note that this will also run it if you open a new shell in X or something, if you want this then it's all good. If not, I can't remember how to run it only when you first log in. Good luckSC phazeman 10-11-2001, 02:50 AM the easiest way to do it, is to put it under Autostart directory (/home/username/.kde/Autostart) Joeri Sebrechts 10-11-2001, 04:48 AM It depends what you view as logon. .bashrc contains everything to be setup in ALL bash sessions, including ones you open in your xterm without actually logging in. .bash_profile (or some other name with profile in it) will only execute in login shells, in other words, where you type your login and password. .xinitrc will execute when you run "startx" from the shell. Don't forget to place the executable (including path) of your window manager or desktop environment at the end of the file. You need to spawn (with & at the end) everything but the window manager. .xsession (or something like it, depends on the distro) will execute when you login through xdm or an xdm-like program. Again, don't forget to put the window manager line in there at the end. And then there's always the Autostart folder as phazeman mentioned. bdg1983 10-11-2001, 05:08 AM Originally posted by siqe: <STRONG>I want a program that i'm making to run automatically after I log in. Is there some special folder i can put it in or what? My machine doesn't use X its console only.</STRONG> Just reminding those that you use console only. No X. justlinux.com
Copyright Internet.com Inc. All Rights Reserved. |