diff --git a/roles/install_ngs-pulsar/templates/pulsar.openrc.j2 b/roles/install_ngs-pulsar/templates/pulsar.openrc.j2 new file mode 100644 index 0000000..218dacc --- /dev/null +++ b/roles/install_ngs-pulsar/templates/pulsar.openrc.j2 @@ -0,0 +1,26 @@ +#!/sbin/openrc-run + +name="ngs-pulsar" +description="Enginsight Pulsar Service" + +command="{{ pulsar_install_path }}/{{ pulsar_binary_name }}" +command_args=">> /var/log/enginsight/pulsar.log 2>&1" +command_background="yes" +pidfile="/var/run/${name}.pid" +command_user="root:root" +directory="{{ pulsar_install_path }}" + +depend() { + need net + use logger + after firewall +} + +start_pre() { + checkpath --directory --owner root:root --mode 0755 /var/log/enginsight + checkpath --file --owner root:root --mode 0644 /var/log/enginsight/pulsar.log + [ -x "{{ pulsar_install_path }}/{{ pulsar_binary_name }}" ] || { + eerror "Binary not executable: {{ pulsar_install_path }}/{{ pulsar_binary_name }}" + return 1 + } +} \ No newline at end of file