Optionally use systemd service files WIP
authorBill Erickson <berickxx@gmail.com>
Wed, 14 Jun 2017 16:55:35 +0000 (12:55 -0400)
committerBill Erickson <berickxx@gmail.com>
Wed, 14 Jun 2017 16:55:35 +0000 (12:55 -0400)
Signed-off-by: Bill Erickson <berickxx@gmail.com>
extras/service-files/evergreen-reporter.service.j2 [new file with mode: 0644]
extras/service-files/opensrf.service.j2 [new file with mode: 0644]
extras/service_files/opensrf.service.j2 [deleted file]
extras/services.yml

diff --git a/extras/service-files/evergreen-reporter.service.j2 b/extras/service-files/evergreen-reporter.service.j2
new file mode 100644 (file)
index 0000000..02b9c26
--- /dev/null
@@ -0,0 +1,18 @@
+[Unit]
+Description=Evergreen Reporter
+After=opensrf.service
+BindsTo=opensrf.service
+
+[Service]
+User=opensrf
+Group=opensrf
+Type=forking
+Environment=PATH=/openils/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
+#ExecStartPre=/bin/sleep 2
+
+# TODO: -c template variable
+ExecStart=/openils/bin/clark-kent.pl --daemon
+ExecStopPost=/bin/rm /tmp/reporter-LOCK
+
+#[Install]
+#WantedBy=multi-user.target
diff --git a/extras/service-files/opensrf.service.j2 b/extras/service-files/opensrf.service.j2
new file mode 100644 (file)
index 0000000..ede746b
--- /dev/null
@@ -0,0 +1,29 @@
+# TODO: 'Before' and 'After' reflect a single-server setup.
+# Make these configurable for cases where certain services 
+# (e.g. memcache) are not run on the same machine.
+
+[Unit]
+Description=Open Service Request Framework
+After=ejabberd.service memcached.service
+Before=apache2.service apache2-websockets.service
+Requries=memcached.service
+BindsTo=ejabberd.service
+
+[Service]
+User=opensrf
+Group=opensrf
+Type=oneshot
+RemainAfterExit=yes
+Environment=PATH=/openils/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
+Environment=LD_LIBRARY_PATH=/openils/lib:/usr/local/lib:/usr/local/lib/dbd:$LD_LIBRARY_PATH
+#ExecStartPre=/bin/sleep 5
+ExecStart=/openils/bin/osrf_control -l --start-all
+#ExecStartPost=/bin/sleep 10
+#ExecStartPost=-/bin/systemctl restart apache2.service
+#ExecStartPost=-/bin/systemctl restart apache2-websockets.service
+ExecStop=/openils/bin/osrf_control -l --stop-all
+
+#[Install]
+#WantedBy=multi-user.target
+#Alias=opensrf.service
+
diff --git a/extras/service_files/opensrf.service.j2 b/extras/service_files/opensrf.service.j2
deleted file mode 100644 (file)
index ede746b..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-# TODO: 'Before' and 'After' reflect a single-server setup.
-# Make these configurable for cases where certain services 
-# (e.g. memcache) are not run on the same machine.
-
-[Unit]
-Description=Open Service Request Framework
-After=ejabberd.service memcached.service
-Before=apache2.service apache2-websockets.service
-Requries=memcached.service
-BindsTo=ejabberd.service
-
-[Service]
-User=opensrf
-Group=opensrf
-Type=oneshot
-RemainAfterExit=yes
-Environment=PATH=/openils/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
-Environment=LD_LIBRARY_PATH=/openils/lib:/usr/local/lib:/usr/local/lib/dbd:$LD_LIBRARY_PATH
-#ExecStartPre=/bin/sleep 5
-ExecStart=/openils/bin/osrf_control -l --start-all
-#ExecStartPost=/bin/sleep 10
-#ExecStartPost=-/bin/systemctl restart apache2.service
-#ExecStartPost=-/bin/systemctl restart apache2-websockets.service
-ExecStop=/openils/bin/osrf_control -l --stop-all
-
-#[Install]
-#WantedBy=multi-user.target
-#Alias=opensrf.service
-
index 48d5a21..e60af8a 100644 (file)
@@ -1,11 +1,19 @@
 - name: Install OpenSRF Service File
   become: true
   template: 
-    src: extras/service_files/opensrf.service.j2
+    src: extras/service-files/opensrf.service.j2
     dest: /lib/systemd/system/opensrf.service 
     owner: root
     group: root
     mode: 0644
+- name: Install Evergreen Reporter Service File
+  become: true
+  template: 
+    src: extras/service-files/evergreen-reporter.service.j2
+    dest: /lib/systemd/system/evergreen-reporter.service 
+    owner: root
+    group: root
+    mode: 0644
 - name: Reload Systemd Configs
   become: true
   shell: systemctl daemon-reload