Re: Restarting a process

Bryan Armstrong <bryan.armstrong-6tN4nzCoH/[email protected]>
Newsgroups gmane.comp.hardware.microcontrollers.tini
Message-ID <[email protected]>
Vic wrote:
> I have a a serial line  monitor (sermon.tini) which is
> started during a TINI boot (an entry in etc/.startup)
> however my monitor exits when there is a exception, I
> would like to create another "guardian" program which
> will monitor this sermon.tini, if the program stops,
> the guardian restarts it.
> 
> I have looked into TINIOS class, it has option to kill
> task or monitor task by process id, but has no way to
> get a process ID by the name of the program or task.  

Once you have started an executable with java.lang.Runtime.exec(), you 
receive a Process object which you can use to get information on the 
child process.  Use the waitFor() or exitValue() function to determine 
the status of the child process.

-- 
--
Bryan Armstrong
bryan.armstrong-6tN4nzCoH/[email protected]


_______________________________________________
TINI mailing list
TINI-6tN4nzCoH/[email protected]
To UNSUBSCRIBE, edit your profile, or see list archives:
http://lists.dalsemi.com/mailman/listinfo/tini
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.