[MPICH] start mpd if it has not started
Ralph M. Butler
rbutler at mtsu.edu
Wed Aug 3 13:49:29 CDT 2005
> Date: Wed, 3 Aug 2005 12:53:28 -0400
> From: Kamaraju Kusumanchi <kamaraju at gmail.com>
> To: mpich-discuss at mcs.anl.gov
> Subject: [MPICH] start mpd if it has not started
>
> I can use mpd& to initialize the process management and use mpdallexit
> to close it.
>
> But, I would like to have something like "start mpd only if it has not
> already been started". Can I do this with current mpich2? By default
> mpd is giving the following error when there is already another
> instance of it running.
>
> $mpd &
> [2] 8055
>
> $An mpd is already running with console at /tmp/mpd2.console_rajulocal
> on kusumanchi.
> Start mpd with the -n option for second mpd on same host.
>
> [2]+ Exit 255 mpd
>
> This is very inconvenient for scripting (I can always direct the error
> messages to /dev/null but that is not very elegant).
It depends on your intended usage of course, but you might want to
simply use the -d (--daemon) option, e.g.:
$ mpd --daemon
In this case, you do not need the & for background because mpd
will background itself. If there is an mpd already running, it
will exit silently. Of course, if there is no other mpd running,
but the new one fails for some other reason, that will appear to
be silent also. When running as a daemon, all output goes into
the syslogs.
More information about the mpich-discuss
mailing list