Help starting Handle server automatically after reboot?

454 views
Skip to first unread message

Night Librarian

unread,
Aug 18, 2023, 12:18:32 PM8/18/23
to DSpace Technical Support
Greetings!

I have DSpace 7.4 on Ubuntu 20.04.  Handle server is running fine, but after a system reboot it doesn't come up automatically, so I have to start it manually.  I looked at a suggestion  by Mohammad S. AlMutairi from an older conversation and edited my  /etc/systemd/system/handle-server.service to looks like this:

===============================
[Unit]
Description=Handle Service
After=network.target tomcat9.service

[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=/dspace/bin/start-handle-server
ExecStop=/bin/kill $MAINPID
User=tomcat
Group=tomcat

[Install]
WantedBy=multi-user.target
===============================

However, after the system reboot, handle-server still doesn't come up by itself.  I must add that I need to add "sudo" in order to start Handle server manually:

 sudo /dspace/bin/start-handle-server

Did I mess the handle-server.service file or is there something else I need to do with permissions or otherwise?

Night Librarian

unread,
Aug 25, 2023, 11:50:32 AM8/25/23
to DSpace Technical Support
Perhaps someone knows the answer to this question or could nudge me in a right direction?

Mohammad S. AlMutairi

unread,
Aug 26, 2023, 5:48:56 PM8/26/23
to DSpace Technical Support
Hi Night Librarian,

Before you begin just make sure the handle server is down and just copy and paste the text you see in red below into the terminal and do the other steps to enable the service and start it. Also, make sure the owner and the group permissions on the dspace and the handle-server folders ( ls -ld /opt/dspace /opt/dspace/handle-server/ ) match the user you run the tomcat9 service with in your server ( cat /usr/lib/systemd/system/tomcat9.service ).
 

1) sudo -i

2) 
cat << EOF > /usr/lib/systemd/system/handle-server.service
[Unit]
Description=Handle Service
After=network.target tomcat9.service

[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=/opt/dspace/bin/start-handle-server

ExecStop=/bin/kill \$MAINPID
User=tomcat
Group=tomcat

[Install]
WantedBy=multi-user.target

EOF

2) systemctl daemon-reload
3) systemctl enable handle-server.service
4) systemctl start handle-server.service
5) systemctl status handle-server.service

***  If you succussed in running the service manually as in step 4 above then the handle service should be started during the boot time. Check /opt/dspace/handle-server/logs/error.log-* for any hints about what's going on.

Hoe it helps.

BR,

Mo.
Reply all
Reply to author
Forward
0 new messages