Commit e388a1c5 authored by Oyvind.Gjesdal's avatar Oyvind.Gjesdal
Browse files

add handle server, wip

parent d41a5216
---
# defaults file for clarin-dspace
\ No newline at end of file
# defaults file for clarin-dspace
- name: "set base for CLARIN repo"
set_fact:
clarin_home: "/dspace/{{ clarin_dspace_name }}"
- name: "set base facts for CLARIN_repo"
set_fact:
script_dir: "{{ clarin_dspace_script_dir | default(clarin_home + '/source/utilities/project_helpers/scripts/')}}"
......
- name: "template handle service"
template:
src: "handle-server.service.j2"
dest: "/etc/systemd/system/handle-server.service"
- name: "enable and start handle service"
systemd:
name: "handle-server"
daemon_reload: "yes"
enabled: true
state: "started"
......@@ -9,5 +9,9 @@
- import_tasks: "build.yml"
- import_tasks: "handle-server.yml"
become: true
when: "handle_server_enabled | default(false) | bool"
- import_tasks: "cron.yml"
become: true
Systemd Unit file for Handle Service used by DSpace
# retrieved and edited from https://gist.github.com/cwilper/cd1fe3525edba1cc7a32340327a359ed
# On hosts that use systemd, like RHEL7, this can be used to auto-start
# the handle service and provide the familiar "servicectl start|status|stop"
# commands for controlling execution.
#
# To install:
#
# 1) As dspace:
# REQUIRED:
# - Rename dspace/bin/start-handle-server to run-handle-server,
# and remove "nohup" and the trailing ampersand from the last line.
# OPTIONAL:
# - Create start-handle-server, with the following lines, not indented:
# #!/bin/sh
# sudo systemctl start handle
# ..and make sure it's executable (e.g. chmod 755 start-handle-server)
# 2) As root:
# REQUIRED:
# - Copy this file into /etc/systemd/system and change the path for
# ExecStart's value as appropriate.
# - Run the following to install and make it start at system startup:
# systemctl daemon-reload
# systemctl enable handle
# OPTIONAL:
# - Modify /etc/sudoers (using visudo) to allow the dspace user
# to run "sudo systemctl start|stop|status handle" with no password:
# dspace ALL=(root) NOPASSWD: /bin/systemctl start handle
# dspace ALL=(root) NOPASSWD: /bin/systemctl stop handle
# dspace ALL=(root) NOPASSWD: /bin/systemctl status handle
[Unit]
Description=Handle Service
After=syslog.target network.target
[Service]
Type=simple
ExecStart={{ build_dir }}/bin/start-handle-server && /usr/bin/fg
ExecStop=/bin/kill $MAINPID
User={{ dspace_clarin_handle_user | default('tomcat') }}
Group={{ dspace_clarin_handle_group | default('tomcat') }}
[Install]
WantedBy=multi-user.target
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment