forked from evolix/ansible-roles
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
|
||||
ExecStart=/usr/share/tomcat7/bin/startup.sh
|
||||
ExecStop=/usr/share/tomcat7/bin/shutdown.sh
|
||||
ExecStopPost=/bin/sh -c date | /usr/bin/mail -s "%H/%u : Shutdown instance" %u
|
||||
Type=forking
|
||||
|
||||
[Install]
|
||||
|
|
|
@ -2,3 +2,6 @@
|
|||
# alias for compatibility
|
||||
|
||||
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