LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
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 12-19-2005, 09:05 AM   #1
Cipher01
LQ Newbie
 
Registered: Apr 2005
Location: Somewhere
Distribution: Fedora Core 5
Posts: 12

Rep: Reputation: 0
How to start a process when it stops


I have a process running, but every few minutes it stops. Is there some way to make it start again automatically when it stops. Maybe by running it in the background? I have the process ID.
 
Old 12-19-2005, 09:14 AM   #2
tuxrules
Senior Member
 
Registered: Jun 2004
Location: Chicago
Distribution: Slackware64 -current
Posts: 1,158

Rep: Reputation: 62
Quote:
Originally Posted by Cipher01
I have a process running, but every few minutes it stops. Is there some way to make it start again automatically when it stops. Maybe by running it in the background? I have the process ID.
What is the process? If the process is run by the kernel, you don't have to worry about it. If you are running the process and it terminates, you can start the program. Backgrounding won't do anything in this case. Backgrounding is done to detach the process from the shell so that you can continue to use the shell.

Tux,
 
Old 12-19-2005, 09:15 AM   #3
camorri
LQ 5k Club
 
Registered: Nov 2002
Location: Somewhere inside 9.9 million sq. km. Canada
Distribution: Slackware 15.0, current, slackware-arm-currnet
Posts: 6,214

Rep: Reputation: 849Reputation: 849Reputation: 849Reputation: 849Reputation: 849Reputation: 849Reputation: 849
You need to supply more information. What process is it that stops? Why is it stopping? Are there error messages? Have you looked in the logs for any insight to the problem?
 
Old 12-19-2005, 09:34 AM   #4
buwaleed
LQ Newbie
 
Registered: Dec 2005
Location: Michigan
Distribution: Debian 3.1, FC4
Posts: 14

Rep: Reputation: 0
crontab can be set to check if an application is running at a set time, but as previous posts stated .. more info needed
 
Old 12-19-2005, 04:46 PM   #5
Cipher01
LQ Newbie
 
Registered: Apr 2005
Location: Somewhere
Distribution: Fedora Core 5
Posts: 12

Original Poster
Rep: Reputation: 0
The program was made by my friend as a "game" for me. It's a word processor and he wants me to keep it from stopping or restart it immeditaly after it stops. I was hoping I could do the latter. The PID I know because when I ran it, I also used the "ps -A" command and found it running, on the process list it's called "Gwerd". That's about as much as I can tell you.
 
Old 12-19-2005, 06:14 PM   #6
spx2
Member
 
Registered: Dec 2005
Distribution: debian
Posts: 160

Rep: Reputation: 30
you can try doing something like this:
Code:
#!/bin/bash
until  ["1"]; do
. <path to your program>
done
and save it as autorun.sh
do
Code:
chmod +x autorun.sh
and then
run the script with bg autorun.sh
 
Old 12-20-2005, 08:39 AM   #7
Cipher01
LQ Newbie
 
Registered: Apr 2005
Location: Somewhere
Distribution: Fedora Core 5
Posts: 12

Original Poster
Rep: Reputation: 0
Yay! It worked. Thanks for your help.
 
  


Reply



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
Helix Server - Stops during start ovl Linux - Software 1 02-03-2006 09:07 PM
Booting process stops while loading kernel stelmed Slackware 1 05-25-2005 05:25 AM
start date and start time of a process - jiffies Yoko Programming 0 12-04-2004 08:12 AM
Boot process stops after custom kernel build FuzzyDuc Debian 3 11-28-2004 06:47 AM
Mandrake 9.2, Boot process stops at Staring ALSA Version 0.9.6 stever Mandriva 2 02-02-2004 11:47 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 10:44 PM.

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
Open Source Consulting | Domain Registration