Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: correct syntax for systemd using Environment variable in ExecStart string ("Executable path is not absolute" and best practice for using ${} to wrap env values)

...

  • Peter St. Onge - University of Toronto

 


grouper-loader.service

Code Block
# For more info about custom unit files, see 
# http://fedoraproject.org/wiki/Systemd
#
# Look for #How_do_I_customize_a_unit_file.2F_add_a_custom_unit_file.3F
#
# This is a unit file for systemd, to allow the grouper loader daemon to
# be started when the server starts, and shutdown as needed.
#
# this is an early attempt, and will likely fail in interesting and novel manners.
#
# This file should live as /etc/systemd/system/grouper-loader.service
#
# The gsh.sh file in
# /opt/grouper/grouper-2.3.0/grouper.apiBinary-2.3.0/bin/ should have
# the splat-bang line (#!/bin/bash) added to the top of the file.
#
# Remember to run 'systemctl enable grouper-loader.service' once this is
# done so that the loader comes up at boot time.
#
#
[Unit]
Description=Grouper Loader daemon for Grouper 2.3.0
After=syslog.target
After=network.target
After=postgresql-9.6.service
# If the LDAP server is on the same box, you'll probably want to
# reference that here as an 'After' stanza

[Service]

Environment=GROUPER_HOME=/opt/grouper/grouper-2.3.0/grouper.apiBinary-2.3.0
#ExecStart=/opt/grouper/grouper-2.3.0/grouper.apiBinary-2.3.0/bin/gsh.sh -loader
ExecStart=$GROUPER/usr/bin/env ${GROUPER_HOME}/bin/gsh.sh -loader

[Install]
WantedBy=multi-user.target

...


grouper-tomcat.service

Code Block
# For more info about custom unit files, see 
# http://fedoraproject.org/wiki/Systemd
#
# Look for #How_do_I_customize_a_unit_file.2F_add_a_custom_unit_file.3F
#
# This is a unit file for systemd, to allow the tomcat server (that runs
# the Grouper web UI) to be started when the server starts, and shutdown
# as needed.
#
# this is an early attempt, and will likely fail in interesting and novel manners.
#
# This file should live as /etc/systemd/system/grouper-tomcat.service
#
# Remember to run 'systemctl enable grouper-tomcat.service' once this is
# done so that the loader comes up at boot time.
#
#


[Unit]
Description=Apache Tomcat Web Application Container for Grouper 2.3.0
After=network.target
After=shibd.service
After=httpd.service
After=postgresql-9.6.service
Requires=shibd.service
Requires=httpd.service
Requires=postgresql-9.6.service
PartOf=shibd.service
PartOf=httpd.service

[Service]
Type=forking
ExecStart=/opt/grouper/grouper-2.3.0/apache-tomcat-6.0.35/bin/startup.sh
ExecStop=/opt/grouper/grouper-2.3.0/apache-tomcat-6.0.35/bin/shutdown.sh

[Install]
WantedBy=multi-user.target