tomcat-instance: send mail in shell script not in systemd unit

This commit is contained in:
Victor LABORIE 2017-02-24 14:35:56 +01:00
parent 3fb04d177a
commit cb037d9d91
2 changed files with 3 additions and 1 deletions

View file

@ -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]

View file

@ -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 %}