LinuxQuestions.org
Review your favorite Linux distribution.
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, 10: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, 10:14 AM   #2
tuxrules
Senior Member
 
Registered: Jun 2004
Location: Chicago
Distribution: Slackware64 -current
Posts: 1,144

Rep: Reputation: 56
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, 10:15 AM   #3
camorri
LQ Guru
 
Registered: Nov 2002
Location: Somewhere inside 9.9 million sq. km. Canada
Distribution: Slackware 14.1, 14.2
Posts: 5,090

Rep: Reputation: 483Reputation: 483Reputation: 483Reputation: 483Reputation: 483
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, 10: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, 05: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, 07: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, 09: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


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


All times are GMT -5. The time now is 10:42 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration