EPrints Technical Mailing List Archive
See the EPrints wiki for instructions on how to join this mailing list and related information.
Message: #09810
< Previous (by date) | Next (by date) > | < Previous (in thread) | Next (in thread) > | Messages - Most Recent First | Threads - Most Recent First
[EP-tech] Ubuntu - Indexer as a service
- To: eprints-tech@ecs.soton.ac.uk
- Subject: [EP-tech] Ubuntu - Indexer as a service
- From: James Kerwin <jkerwin2101@gmail.com>
- Date: Wed, 7 Aug 2024 16:00:18 +0100
CAUTION: This e-mail originated outside the University of Southampton.
Hi everyone,
Wondering if anyone can check if this is a sane thing to do.
This has been bugging me for some time since we upgraded from Ubuntu 14 to 20/22 (I've lost track at the moment).
Whenever the server was restarted the eprints Indexer would stall. Then after an hour or so say "Indexer has stopped..."
I've been learning about systemd and turning /opt/eprints3/epindexer into a service.
I wanted it to be bound to Apache, which hasn't quite worked. I got it to a point where issuing: systemctl [stop/start] epindexer on the command line would give the desired action. When Apache stopped the indexer would stop (e.g. the indexer.pid file in /opt/eprints3/var would disappear). Unfortunately it didn't restart when Apache was started (although it did at least tell me it wasn't running, which is a help in itself).I did think of binding it to MySQL since that seems to restart without a problem after Apache goes down-up.
I've now got it to a point where Apache can be restarted, the indexer.pid file remains in place, but the indexer resumes its actions when Apache is back up. This is the service file I've made in /etc/systemd/system/epindexer.service:
Whenever the server was restarted the eprints Indexer would stall. Then after an hour or so say "Indexer has stopped..."
I've been learning about systemd and turning /opt/eprints3/epindexer into a service.
I wanted it to be bound to Apache, which hasn't quite worked. I got it to a point where issuing: systemctl [stop/start] epindexer on the command line would give the desired action. When Apache stopped the indexer would stop (e.g. the indexer.pid file in /opt/eprints3/var would disappear). Unfortunately it didn't restart when Apache was started (although it did at least tell me it wasn't running, which is a help in itself).I did think of binding it to MySQL since that seems to restart without a problem after Apache goes down-up.
I've now got it to a point where Apache can be restarted, the indexer.pid file remains in place, but the indexer resumes its actions when Apache is back up. This is the service file I've made in /etc/systemd/system/epindexer.service:
[Unit]Description=EP Indexer ServiceAfter=network.target apache2.service
[Service]Type=forkingExecStart=/usr/bin/perl -T /opt/eprints3/bin/epindexer startExecStop=/usr/bin/perl -T /opt/eprints3/bin/epindexer stopPIDFile=/opt/eprints3/var/indexer.pidRestart=alwaysUser=rootGroup=root
It did previously have either "BindsTo=apache2.service" or "PartOf=apache2.service" on line 4, but this appeared to hinder more than help. I have just realised that depending on how I start the indexer the indexer.pid and indexer.tick have different owners (eprints from command line and www-data when I click the button. Both files have rw-rw-r-- permissions and eprints is in the www-data group and www-data is in the eprints group - I don't know if I'm on to something with this - maybe change the user in epindexer to www-data?).[Install]WantedBy=multi-user.target
Does this look sufficient? It's only on a Test server at the moment, but would look to put this on the live server if it doesn't raise any red flags. If any fellow Ubuntu users have had success with this I am all ears.
Appreciate this is not exactly EPrints, but it's such a niche question I thought it right to ask here.
Thanks,
James
- Follow-Ups:
- Re: [EP-tech] Ubuntu - Indexer as a service
- From: Alex Ball <ab318@bath.ac.uk>
- Re: [EP-tech] Ubuntu - Indexer as a service
- From: David R Newman <drn@ecs.soton.ac.uk>
- Re: [EP-tech] Ubuntu - Indexer as a service
- Prev by Date: Re: [EP-tech] search with Combining Diacritical Marks return noting
- Next by Date: Re: [EP-tech] Ubuntu - Indexer as a service
- Previous by thread: [EP-tech] search with Combining Diacritical Marks return noting
- Next by thread: Re: [EP-tech] Ubuntu - Indexer as a service
- Index(es):