Re: [MTT devel] mtt-relay patch - create pid file when run as daemon

2013-10-02 Thread Jeff Squyres (jsquyres)
It might also be desirable not to chain this functionality to --daemon, but 
rather create a new option, such as --pidfile=FILENAME.  Then you write to that 
FILENAME if --pidfile is specified.

Also -- don't you need to remove the pidfile when mtt-relay exits?  Note that 
this should be done not only when mtt-relay exits normally, but also if 
mtt-relay exits abnormally (e.g., ctrl-c or a local call to exit(), etc.).



On Sep 30, 2013, at 1:57 PM, Mike Dubman  wrote:

> /var/run is only writable to root, but script uses it explicitly.
> maybe it is worse to add fallback if non-root user starts mtt-relay.
> 
> 
> On Mon, Sep 30, 2013 at 2:08 PM, Christoph Niethammer  
> wrote:
> Hello,
> 
> As on many systems init scripts and the handling of services is based on pid 
> files I extended the mtt-relay script as follows:
> 
> If run with the --daemon option
> * Create file /var/run/mtt-relay.pid  if it does not exist and write the pid 
> of the background process into it.
> * exit with return value 1 if /var/run/mtt-relay.pid file exists.
> 
> Patch is attached.
> 
> Best regards
> Christoph Niethammer
> 
> --
> 
> Christoph Niethammer
> High Performance Computing Center Stuttgart (HLRS)
> Nobelstrasse 19
> 70569 Stuttgart
> 
> Tel: ++49(0)711-685-87203
> email: nietham...@hlrs.de
> http://www.hlrs.de/people/niethammer
> ___
> mtt-devel mailing list
> mtt-de...@open-mpi.org
> http://www.open-mpi.org/mailman/listinfo.cgi/mtt-devel
> 
> ___
> mtt-devel mailing list
> mtt-de...@open-mpi.org
> http://www.open-mpi.org/mailman/listinfo.cgi/mtt-devel


-- 
Jeff Squyres
jsquy...@cisco.com
For corporate legal information go to: 
http://www.cisco.com/web/about/doing_business/legal/cri/



Re: [MTT devel] mtt-relay patch - create pid file when run as daemon

2013-09-30 Thread Mike Dubman
/var/run is only writable to root, but script uses it explicitly.
maybe it is worse to add fallback if non-root user starts mtt-relay.


On Mon, Sep 30, 2013 at 2:08 PM, Christoph Niethammer wrote:

> Hello,
>
> As on many systems init scripts and the handling of services is based on
> pid files I extended the mtt-relay script as follows:
>
> If run with the --daemon option
> * Create file /var/run/mtt-relay.pid  if it does not exist and write the
> pid of the background process into it.
> * exit with return value 1 if /var/run/mtt-relay.pid file exists.
>
> Patch is attached.
>
> Best regards
> Christoph Niethammer
>
> --
>
> Christoph Niethammer
> High Performance Computing Center Stuttgart (HLRS)
> Nobelstrasse 19
> 70569 Stuttgart
>
> Tel: ++49(0)711-685-87203
> email: nietham...@hlrs.de
> http://www.hlrs.de/people/niethammer
> ___
> mtt-devel mailing list
> mtt-de...@open-mpi.org
> http://www.open-mpi.org/mailman/listinfo.cgi/mtt-devel
>