LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices



Reply
 
Search this Thread
Old 03-04-2004, 10:30 PM   #1
Red Squirrel
Member
 
Registered: Dec 2003
Distribution: FC9 on main server
Posts: 823

Rep: Reputation: 36
make stuff run at startup (in a seperate console)


I was told I can edit the /root/.rcbash file or whatever to run stuff at startup, but the problem with that is it uses the "main" console. So let's say I logon to ssh, any started programs will be there. I want it to run as a seperate process, and maybe even popup a console on the server or something as if I would have manually opened it. In windows I would simply drag a shortcut to the program in the startup folder and bang, done. So when I would get into windows, a console or the program would come up, but not take over windows either.

How can I do this in linux? Thanks.
 
Old 03-04-2004, 10:42 PM   #2
lsmith
Member
 
Registered: Feb 2004
Posts: 40

Rep: Reputation: 15
In general, stuff doesn't run in terminals if it is to run at boot time. It runs as a regular process, and has a log file that it prints the output to. You then read the file to see the output. This way it won't stop when you close the terminal.

Also, you need to understand that XFree86 is not the core of linux, it is just another program. If you get something to start at boot, then it will start before XFree86 does, so it can't pop a window up. If you (say) had a database server, then you would not run X on it because that would make the database slower....
 
Old 03-04-2004, 10:47 PM   #3
Red Squirrel
Member
 
Registered: Dec 2003
Distribution: FC9 on main server
Posts: 823

Original Poster
Rep: Reputation: 36
Oh, the process and log idea seems even better. How would I set that up?
 
Old 03-04-2004, 11:00 PM   #4
lsmith
Member
 
Registered: Feb 2004
Posts: 40

Rep: Reputation: 15
There is no one answer.

Assuming you are running Red Hat, I suggest you find and read documentation specific to that distribution, in particular documentation about how redhat boots. You need to understand it before you can really start changing stuff. You will need to write scripts.....

Mysql may even have documentation to this effect.
 
Old 03-04-2004, 11:07 PM   #5
Red Squirrel
Member
 
Registered: Dec 2003
Distribution: FC9 on main server
Posts: 823

Original Poster
Rep: Reputation: 36
It's that complicated? Isint there like an "autoexec.bat" equivalent or something?
 
Old 03-04-2004, 11:13 PM   #6
lsmith
Member
 
Registered: Feb 2004
Posts: 40

Rep: Reputation: 15
OK. The simplest way is to put the command into this file:

/etc/rc.d/rc.local

This file is run everytime the system is started, after all other initialization scripts have run. However this won't take care of nicely stopping the database when you shut down or switch run levels. You will need to learn how the System V init stuff works for that....
 
Old 03-04-2004, 11:24 PM   #7
Red Squirrel
Member
 
Registered: Dec 2003
Distribution: FC9 on main server
Posts: 823

Original Poster
Rep: Reputation: 36
But will it allow me to output to file? So if I go:

/path/to/program >/path/to/file.txt

Will it work, and allow me to open the file in realtime? That's really all I need to do, is have the program run and be able to monitor it. Later on I might want more advanced stuff though.
 
Old 03-04-2004, 11:25 PM   #8
lsmith
Member
 
Registered: Feb 2004
Posts: 40

Rep: Reputation: 15
You can execute any command you like. mysql probably already has a log file though, if thats what you are going to start....
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to make xinetd run at startup on SuSE ??? cwolf78 Linux - Software 2 04-22-2005 06:13 PM
make a command run at startup? cheater1034 Linux - General 2 09-12-2004 06:51 AM
How to Run Win32 Console App in linux Console Lokie Linux - Software 2 08-12-2004 11:00 PM
how to make/run startup scripts/commands ViN86 Slackware 3 04-24-2004 11:02 AM
Any way to make every program start in seperate process Squall Linux - General 3 02-03-2004 06:22 PM


All times are GMT -5. The time now is 11:46 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration