CollectionSpace Catalog Server Automated Server stop and start script for systemd
Setup instructions for CollectionSpace Catalog Server:
https://collectionspace.atlassian.net/wiki/home
Make sure all environment variables are correctly configured for the cspace user.
In /home/cspace user directory:
startCS.sh:
#!/bin/sh
#$CSPACE_JEESERVER_HOME/bin/startup.sh
/usr/local/share/apache-tomcat-8.5.51/bin/startup.sh
stopCS.sh
#!/bin/sh
#$CSPACE_JEESERVER_HOME/bin/shutdown.sh
/usr/local/share/apache-tomcat-8.5.51/bin/shutdown.sh
cd /etc/systemd/system
vi collectionspace.service
[Unit]
Description=CollectionSpace catalog server for RPG Research and RPG Museum archives
Documentation=https://collectionspace.atlassian.net/wiki/home
After=collectionspace.service
[Service]
User=cspace
Group=cspace
WorkingDirectory=/home/cspace
Type=simple
ExecStart=/home/cspace/startCS.sh
ExecStop=/home/cspace/stopCS.sh
TimeoutStartSec=120
RemainAfterExit=yes
SuccessExitStatus=3 4
RestartForceExitStatus=3 4
[Install]
WantedBy=multi-user.target
systemctl enable collectionspace.service
systemctl enable collectionspace.service
Synchronizing state of collectionspace.service with SysV service script with /lib/systemd/systemd-sysv-install.
Executing: /lib/systemd/systemd-sysv-install enable collectionspace
systemctl start collectionspace.service
systemctl status collectionspace.service
systemctl status collectionspace.service
● collectionspace.service - CollectionSpace catalog server for RPG Research and RPG Museum archives
Loaded: loaded (/etc/systemd/system/collectionspace.service; enabled; vendor preset: enabled)
Active: active (exited) since Mon 2021-06-21 09:25:23 PDT; 4s ago
Docs: https://collectionspace.atlassian.net/wiki/home
Process: 9138 ExecStart=/home/cspace/startCS.sh (code=exited, status=0/SUCCESS)
Main PID: 9138 (code=exited, status=0/SUCCESS)
Tasks: 20 (limit: 65000)
CGroup: /system.slice/collectionspace.service
└─9158 /usr/bin/java -Djava.util.logging.config.file=/usr/local/share/apache-tomcat-8.5.51/conf/logging.properties -Djava.util.logging.manager=org.apache.juli.Cl
Jun 21 09:25:23 rpgrhip1 systemd[1]: Started CollectionSpace catalog server for RPG Research and RPG Museum archives.
Jun 21 09:25:23 rpgrhip1 startCS.sh[9138]: Tomcat started.
systemctl stop collectionspace.service