In message
<CAGfjSCP7eBy4r9f=tXNqhXuUttTQhm2_AwMF5L_Jb9ZUD=2...@mail.gmail.com> ,
Risto Vaarandi writes:
>thanks for the comment. The only aspect which made me consider this are
>tools which receive data from sec over named pipes. Prior to the 2.7
>version, sec 'write' action opened and closed the pipe at each write which
>was not very efficient. In the current major release, sec keeps its output
>files (and sockets, which appeared in 2.7) constantly open, until:
>1) sec terminates
>2) a signal is received which forces outputs to be closed and reopened
>(SIGHUP, SIGABRT or SIGUSR2)
>
>If the pipe is closed, the reading end will see EOF in the pipe. By
>default, a number of UNIX commandline tools (like cat and logger) terminate
>on EOF. This creates an opportunity to control the lifetime of such
>processes not only via SIGTERM, but also through a pipe. For example, the
>following rule keeps the /bin/logger tool running during sec's lifetime, so
>that the process shuts down when sec terminates, and a new process is
>spawned when a signal closes /var/log/pipe and takes down the process:
>
>type=Single
>ptype=regexp
>pattern=^(SEC_STARTUP|SEC_RESTART|SEC_SOFTRESTART|SEC_LOGROTATE)$
>context=SEC_INTERNAL_EVENT
>desc=(Re)start a process on pipe which logs its input to syslog
>action=shellcmd /usr/bin/logger -f /var/log/pipe -p user.notice
>
>(this ruleset uses the new SEC_LOGROTATE internal event which is
>implemented in the 2.7.4 test version and is issued on the reception of
>SIGUSR2)
>
>In principle, SIGTERM is not really needed for such processes. As far as I
>know, common syslog server implementations generally don't support signals
>for managing child processes and solely rely on EOF-on-pipe approach. And
>that made me thinking whether it is reasonable to retain the current
>default if there is now also an alternative. (Of course, by far not all
>processes have a pipe connection to sec, and SIGTERM is really the only way
>to terminate such processes at shutdown.)
>
>I hope my reasoning about alternatives makes sense :)

Yeah I figured it was related to the change in pipe handling. As long
as the exit process is:

  close all pipes
  wait a few (milli, centi) seconds for children to exit on EOF
  reap any such children
  TERM any remaining children

I think you are fine letting SEC term any children. If the TERM comes
before the EOF, I would change it to allow the more graceful shutdown
using EOF first.

--
                                -- rouilj
John Rouillard
===========================================================================
My employers don't acknowledge my existence much less my opinions.

------------------------------------------------------------------------------
This SF.net email is sponsored by Windows:

Build for Windows Store.

http://p.sf.net/sfu/windows-dev2dev
_______________________________________________
Simple-evcorr-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/simple-evcorr-users

Reply via email to