Skip to content

Instantly share code, notes, and snippets.

@tingletech
Last active March 11, 2020 05:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tingletech/e1ca0dbdac4f365d3835ed77a80024d7 to your computer and use it in GitHub Desktop.
Save tingletech/e1ca0dbdac4f365d3835ed77a80024d7 to your computer and use it in GitHub Desktop.
[Unit]
Description=Apache httpd 2.4 with mod_wsgi
# When systemd stops or restarts the app.service, the action is propagated to this unit
PartOf=app.service
# Start this unit after the app.service start
After=dsc.service
[Service]
# https://httpd.apache.org/docs/trunk/mod/mod_systemd.html
Type=notify
User=dsc
Group=dsc
SyslogIdentifier=httpd-back
ExecStart=/apps/dsc/servers/monit/bin/monit-wrapper.bash /usr/sbin/httpd -d /apps/dsc/servers/back -D FOREGROUND -k start
ExecReload=/apps/dsc/servers/monit/bin/monit-wrapper.bash /usr/sbin/httpd -d /apps/dsc/servers/back -D FOREGROUND -k graceful
KillMode=mixed
[Install]
# This unit should start when app.service is starting
WantedBy=dsc.service
[Unit]
Description=Apache httpd 2.4 with mod_proxy
# When systemd stops or restarts the app.service, the action is propagated to this unit
PartOf=app.service
# Start this unit after the app.service start
After=dsc.service
[Service]
# https://httpd.apache.org/docs/trunk/mod/mod_systemd.html
Type=notify
User=dsc
Group=dsc
SyslogIdentifier=httpd-front
ExecStart=/apps/dsc/servers/monit/bin/monit-wrapper.bash /usr/sbin/httpd -d /apps/dsc/servers/front -D FOREGROUND -k start
ExecReload=/apps/dsc/servers/monit/bin/monit-wrapper.bash /usr/sbin/httpd -d /apps/dsc/servers/front -D FOREGROUND -k graceful
KillMode=mixed
[Install]
# This unit should start when app.service is starting
WantedBy=dsc.service
[Unit]
Description=Apache Tomcat j2ee server
# When systemd stops or restarts the app.service, the action is propagated to this unit
PartOf=app.service
# Start this unit after the app.service start
After=dsc.service
[Service]
# https://jdebp.eu/FGA/systemd-house-of-horror/tomcat.html
User=dsc
Group=dsc
SyslogIdentifier=tomcat
ExecStart=/apps/dsc/servers/monit/bin/monit-wrapper.bash /apps/dsc/java/tomcat/bin/catalina.sh run
[Install]
# This unit should start when app.service is starting
WantedBy=dsc.service
[Unit]
Description=Online Archive of California (DSC)
After=network.target remote-fs.target nss-lookup.target
[Service]
# The dummy program will exit
# http://alesnosek.com/blog/2016/12/04/controlling-a-multi-service-application-with-systemd/
Type=oneshot
# Execute a dummy program
ExecStart=/bin/true
# This service shall be considered active after start
RemainAfterExit=yes
[Install]
# Components of this application should be started at boot time
WantedBy=multi-user.target
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment