From: "Joseph C. Lininger" <jbahm@pcdesk.net>
To: <speakup@braille.uwo.ca>
Subject: Re: Question about using pid
Date: Mon, 20 Oct 2003 18:11:15 -0600 [thread overview]
Message-ID: <001701c39767$d8db4420$6700a8c0@morgan> (raw)
In-Reply-To: <Pine.BSF.4.58.0310201611450.1290@server1.shellworld.net>
This works fine, but there is one problem. If something should happen to the
script that is running your process, the process may die two (this depends
on the system) and the process will definitely siece to be restarted
automatically. If it is absolutely critical that the process run, then you
need a solution that is run by init, and so will be restarted if it dies. An
alternative would be to simply put the process you want to run in to init,
but I recommend against this for two reasons. First, this pokes a security
hole in your system depending on what you are running. the other problem is
that processes can not be easily shut down while the system is running if
they are in the inittab file.
--
Joseph C. Lininger
jbahm@pcdesk.net
----- Original Message -----
From: "Luke Davis" <ldavis@shellworld.net>
To: <speakup@braille.uwo.ca>
Sent: Monday, October 20, 2003 3:16 PM
Subject: Re: Question about using pid
> The start-stop-daemon program, might help you with this.
>
> Any kind of do while, while, or similar loop, can do this, as the PID
> doesn't have to matter. If you keep the process in the foreground, the
> shell's next command can not run until the command exits. So, if you put
> it in a while loop, the shell's next command will be to restart the loop,
> thus rerunning the program, and achieving what you want.
>
> If you want to test for fail conditions, put an if test for $? after the
> command, with a break command to be executed if the program returns
> anything other than zero.
>
> Luke
>
>
>
>
> On Mon, 20 Oct 2003, Janina Sajka wrote:
>
> > I have a command that starts a process. Should that process die whilst
> > I'm not at my computer, I want a script to restart it.
> >
> > How do I do this? What doc might I read that would provide examples?
> >
> > I presume I should launch the process so that it's pid is written to a
> > file, and then I can just test for the running pid?
> >
> > But, I don't know how to go forward with this, so would appreciate all
> > advice and direction.
> >
> >
> >
>
> --
> Want a free month of internet access on a great ISP? Go here:
> http://www.tacticus.com/net/
>
> _______________________________________________
> Speakup mailing list
> Speakup@braille.uwo.ca
> http://speech.braille.uwo.ca/mailman/listinfo/speakup
>
next prev parent reply other threads:[~ UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
Janina Sajka
` John covici
` Luke Davis
` Joseph C. Lininger [this message]
` Luke Davis
` Joseph C. Lininger
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='001701c39767$d8db4420$6700a8c0@morgan' \
--to=jbahm@pcdesk.net \
--cc=speakup@braille.uwo.ca \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).