hi Yuri, my apologies for not answering earlier -- your e-mail landed in my spam folder initially :(
I am suspecting that your application is started in a way which makes it a child process of sec. However, when sec shuts down, it sends the TERM signal to all its child processes by default. If the shell process that is executing the content of /opt/scripts/restart-tomcat.sh is still running, this process will get the TERM signal as well. Therefore, if the application was started with the shell 'exec' directive that replaces the shell process with the application process, it is actually your application which gets the TERM signal. In order to find out whether your application is running as a child process of sec, send the USR1 signal to the sec process which creates the dump file (by default located at /tmp/sec.dump). This file contains detailed information about internal state of sec, and also provides a list of all child processes. If your application is indeed stopping because of the TERM signal from sec, there are couple of workarounds: 1) start sec with the --nochildterm command line option which disables sending TERM to child processes, 2) include a 'trap' statement in /opt/scripts/restart-tomcat.sh that would ignore the TERM signal (e.g., trap '' 15) Also, if your application is terminating for other reasons than TERM signal from sec, can you share the content of /opt/scripts/restart-tomcat.sh? Hope this helps, risto 2016-07-29 13:55 GMT+03:00 Yuri Kazankin <yuni...@yahoo.com>: > Hello! > > I have a problem with sec 2.7.10 > > I created the instance: > # cat /etc/sysconfig/sec > OPTIONS_tomcat="-input=/var/log/tomcat/catalina.out” > > > and configured via systemd > # cat /lib/systemd/system/sec@.service > [Unit] > Description=Simple Event Correlator (instance %I) > After=syslog.target > > [Service] > Type=forking > PIDFile=/run/sec-%I.pid > ExecStart=/usr/bin/sec -detach -pid=/run/sec-%I.pid -conf=/etc/sec/%I.sec > --debug=6 --nochildterm -log=/var/log/sec-%I --nointevents $OPTIONS_%I > EnvironmentFile=/etc/sysconfig/sec > > [Install] > WantedBy=multi-user.target > > > My rules restart the application after the event in the log: > # cat /etc/sec/tomcat.sec > type=SingleWithSuppress > ptype=RegExp > pattern=(^.+OutOfMemoryError.+$) > desc=Tomcat restarted after OutOfMemoryError Exception > action=shellcmd /opt/scripts/restart-tomcat.sh > window=300 > > And it works great! But after the event, if I try to execute a restart of > the instance (systemctl restart sec@tomcat), my application stops((( > I can not understand why this is happening and how to fix it ... > > > -- > WBR > Yuri Kazankin > yuni...@yahoo.com > > > > ------------------------------------------------------------------------------ > _______________________________________________ > Simple-evcorr-users mailing list > Simple-evcorr-users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/simple-evcorr-users >
------------------------------------------------------------------------------
_______________________________________________ Simple-evcorr-users mailing list Simple-evcorr-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/simple-evcorr-users