[Archivesspace_Users_Group] Running archivesspace from systemd
Blake Carver
blake.carver at lyrasis.org
Fri Jan 26 13:49:02 EST 2018
Has anyone had any luck with systemd yet?
________________________________________
From: archivesspace_users_group-bounces at lyralists.lyrasis.org <archivesspace_users_group-bounces at lyralists.lyrasis.org> on behalf of Flannon Jackson <flannon at nyu.edu>
Sent: Monday, August 7, 2017 2:01:15 PM
To: Archivesspace Users Group
Subject: [Archivesspace_Users_Group] Running archivesspace from systemd
Hi All,
I'm trying to run the archivesspace daemon from a systemd unit file but I'm getting an odd delay. If I start archivesspace manually by running "$ sudo archivesspace.sh start" things run normally, but when I start archivesspace from systemctl then any operation on port 8080 delays from 10 to 20 seconds before it returns results.
If anyone is running archivesspace from systemctl and can offer any advice it would be appreciated.
The details of my deployment are as follow,
OS : Centos 7.3.10
Java: OpenJDK 1.8.0_141
archivesspace: 2.0.0 | 2.0.1 | 2.1.0 (i've tried all three with the same results)
My unit file is as follows,
[Unit]
Description=Archivesspace Service
After=syslog.target network.target
[Service]
Type=forking
ExecStart=/opt/archivesspace/archivesspace.sh start
PIDFile=/opt/archivesspace/data/.archivesspace.pid
User=aspace
Group=aspace
TimeoutStopSec=10
Restart=on-failure
[Install]
WantedBy=multi-user.target
Initially I tried running it as user aspace. When that didn't work I also tried as root, but that didn't change anything.
Currently I'm running archivesspace 1.5.2 on Centos 6 and the archivesspace daemon gets started from a wrapper script in init.d, so I thought that if I replicated that structure and had a wrapper script to run from the unit fil,e and set the type to either simple, or oneshot or idle, that that might do it. So I tried it like this,
[Unit]
Description=Archivesspace Service
After=syslog.target network.target
[Service]
Type=simple
ExecStart=/opt/archivesspace/aspace-start.sh
PIDFile=/opt/archivesspace/data/.archivesspace.pid
User=root
Group=root
[Install]
WantedBy=multi-user.target
But basically nothing changed -- archivesspace started fine but I still had the crazy delay. I'm thinking at this point that rather than having a unit file that calls archivesspace.sh that I need to write a unit file that replaces the functionality of archivesspace.sh and calls archivesspace directly. As you've probably noticed, archivesspace.sh is not exactly a trivial shell script, so before I get started I wanted to see if anyone else has had any luck getting archivesspace running on systemd.
Thanks,
Flannon
More information about the Archivesspace_Users_Group
mailing list