Browse Source

etherpad systemd

lesion 2 years ago
parent
commit
cbe9cd6946

+ 1 - 1
roles/stable/etherpad/defaults/main.yml

@@ -7,7 +7,7 @@ log_level: "INFO"
 database_password: "{{lookup('community.general.passwordstore', '{{passwordstore_path}}/etherpad_{{ansible_hostname}}/db_password create=True nosymbols=true')}}"
 pad_admin_password: "{{lookup('community.general.passwordstore', '{{passwordstore_path}}/etherpad_{{ansible_hostname}}/admin_password create=True nosymbols=true')}}"
 
-plugins: ['ep_headings2', 'ep_table_of_contents', 'ep_comments_page', 'ep_align', 'ep_delete_after_delay_lite']
+plugins: ['ep_headings2', 'ep_table_of_contents', 'ep_comments_page', 'ep_align']
 
 pad_lang: 'it-IT'
 

+ 6 - 4
roles/stable/etherpad/tasks/main.yml

@@ -26,14 +26,16 @@
   become_user: "etherpad"
   register: repository
 
-- name: ensure etherpad init.d is latest
+- name: ensure etherpad service is latest
   become: yes
   template:
-    src: etherpad.initd.j2
-    dest: /etc/init.d/etherpad
+    src: etherpad.service.j2
+    src: etherpad.service.j2
+    dest: /etc/systemd/system/etherpad.service
     owner: root
     group: root
-    mode: 0500
+    mode: 0644
+  notify: systemd reload
 
 - name: copy etherpad settings.json
   become: yes

+ 0 - 77
roles/stable/etherpad/templates/etherpad.initd.j2

@@ -1,77 +0,0 @@
-#!/bin/sh
-
-### BEGIN INIT INFO
-# Provides:          etherpad-lite
-# Required-Start:    $local_fs $remote_fs $network $syslog
-# Required-Stop:     $local_fs $remote_fs $network $syslog
-# Default-Start:     2 3 4 5
-# Default-Stop:      0 1 6
-# Short-Description: starts etherpad lite
-# Description:       starts etherpad lite using start-stop-daemon
-### END INIT INFO
-
-PATH="/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/opt/node/bin"
-LOGFILE="/srv/etherpad/etherpad/etherpad-lite.log"
-EPLITE_DIR="/srv/etherpad/etherpad"
-EPLITE_BIN="bin/safeRun.sh"
-USER="etherpad"
-GROUP="etherpad"
-DESC="Etherpad Lite"
-NAME="etherpad-lite"
-
-set -e
-
-. /lib/lsb/init-functions
-
-start() {
-  echo "Starting $DESC... "
-
-    start-stop-daemon --start --chuid "$USER:$GROUP" --background --make-pidfile --pidfile /var/run/$NAME.pid --exec $EPLITE_DIR/$EPLITE_BIN -- $LOGFILE || true
-  echo "done"
-}
-
-#We need this function to ensure the whole process tree will be killed
-killtree() {
-    local _pid=$1
-    local _sig=${2-TERM}
-    for _child in $(ps -o pid --no-headers --ppid ${_pid}); do
-        killtree ${_child} ${_sig}
-    done
-    kill -${_sig} ${_pid}
-}
-
-stop() {
-  echo "Stopping $DESC... "
-   while test -d /proc/$(cat /var/run/$NAME.pid); do
-    killtree $(cat /var/run/$NAME.pid) 15
-    sleep 0.5
-  done
-  rm /var/run/$NAME.pid
-  echo "done"
-}
-
-status() {
-  status_of_proc -p /var/run/$NAME.pid "" "etherpad-lite" && exit 0 || exit $?
-}
-
-case "$1" in
-  start)
-      start
-      ;;
-  stop)
-    stop
-      ;;
-  restart)
-      stop
-      start
-      ;;
-  status)
-      status
-      ;;
-  *)
-      echo "Usage: $NAME {start|stop|restart|status}" >&2
-      exit 1
-      ;;
-esac
-
-exit 0

+ 0 - 8
roles/stable/etherpad/templates/settings.json.j2

@@ -545,14 +545,6 @@
       ]
     },
 
-    "ep_delete_after_delay_lite": {
-      "delay": 86400, // one day, in seconds
-      "loop": true,
-      "loopDelay": 3600, // one hour, in seconds
-      "deleteAtStart": true,
-      "text": "{{pad_default_text|replace("\n","\\n")}}"
-    },
-
     "ep_toc": {
       "disable_by_default": true
     }