09-23-04 02:22 AM
Hi
thanks for the reply ,,
I found a workaround and thought this could be useful to someone ,, So
here is what i did
just use the command "start-stop-daemon -S -b -x
<path-of-the-executable> -- <Application-settings>"
Examlple: start-stop-daemon -S -b -x /helix/producer/producer -- -vc
/dev/video0 -vp 1 -vco rv9 -sp PASSWORD@10.10.10.97:30001/stream01 -ad
256k -cs 192x144 -vf 0
-dt -da -pid /prod.pid
-S option is to start
-K if you want to stop
-b To push into the background
-x monitors if any copy of the executable is running, and starts a new
one only if a copy of the process is not running.
Its definitely an easy implementation ,,
prakash
Lev Walkin <vlm@lionet.info> wrote in message news:<2qvj4kF14o9l0U1@uni-berlin.de>...
> Vaddina Prakash Rao wrote:
>
>
> Pseudocode:
>
> int
> run_in_background(const char *progname) {
> pid_t child_pid;
>
> /*
> * Fork-off another process.
> */
> child_pid = fork();
> switch(child_pid) {
> case -1:
> return -1; /* error creating a process */
> default:
> /* Forked off child successfully */
> return 0;
> case 0:
> break;
> }
>
> /*
> * This code will be executed only in child.
> */
> execlp(progname, profname, (char *)0);
> _exit(127); /* Could not start program */
> }
[ Post a follow-up to this message ]
|