From 9777a441e9842ac0004bdbf26a21faf1be4bc289 Mon Sep 17 00:00:00 2001 From: Guillermo Ramos <0xwille@gmail.com> Date: Fri, 27 Jan 2023 23:59:45 +0100 Subject: [PATCH] dist: add openrc service file closes https://github.com/zrepl/zrepl/pull/664 --- dist/openrc/zrepl | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100755 dist/openrc/zrepl diff --git a/dist/openrc/zrepl b/dist/openrc/zrepl new file mode 100755 index 0000000..01d9c31 --- /dev/null +++ b/dist/openrc/zrepl @@ -0,0 +1,23 @@ +#!/sbin/openrc-run + +command='/usr/local/bin/zrepl' +command_args='daemon' +command_background='true' +pidfile="/run/${RC_SVCNAME}.pid" +output_log="/var/log/${RC_SVCNAME}.log" +error_log="/var/log/${RC_SVCNAME}.log" + +zrepl_runtime_dir='/var/run/zrepl' + +start() { + mkdir -p "$zrepl_runtime_dir/stdinserver" + chmod -R 0700 "$zrepl_runtime_dir" + default_start +} + +stop() { + rm -rf "$zrepl_runtime_dir" + default_stop +} + +# vi: noet sw=8 sts=0