tomcat-instance: send mail in shell script not in systemd unit
This commit is contained in:
parent
3fb04d177a
commit
cb037d9d91
|
@ -9,7 +9,6 @@ EnvironmentFile=%h/conf/env
|
||||||
UMask=0002
|
UMask=0002
|
||||||
ExecStart=/usr/share/tomcat7/bin/startup.sh
|
ExecStart=/usr/share/tomcat7/bin/startup.sh
|
||||||
ExecStop=/usr/share/tomcat7/bin/shutdown.sh
|
ExecStop=/usr/share/tomcat7/bin/shutdown.sh
|
||||||
ExecStopPost=/bin/sh -c date | /usr/bin/mail -s "%H/%u : Shutdown instance" %u
|
|
||||||
Type=forking
|
Type=forking
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
|
|
|
@ -2,3 +2,6 @@
|
||||||
# alias for compatibility
|
# alias for compatibility
|
||||||
|
|
||||||
sudo -iu {{ tomcat_instance_name }} systemctl --user stop tomcat
|
sudo -iu {{ tomcat_instance_name }} systemctl --user stop tomcat
|
||||||
|
{% if tomcat_instance_mail is defined %}
|
||||||
|
/bin/sh -c date | /usr/bin/mail -s {{ inventory_hostname }}/{{ tomcat_instance_name }} : Shutdown instance {{ tomcat_instance_mail }}
|
||||||
|
{% endif %}
|
||||||
|
|
Loading…
Reference in a new issue