From 54f659c03f3b85a3247ef354540050923b122a21 Mon Sep 17 00:00:00 2001 From: Solderpunk Date: Wed, 1 Jul 2020 17:00:18 +0200 Subject: [PATCH] Add example OpenRC script, and put all init examples in a contrib directory. --- README.md | 11 ++++++++--- contrib/init/molly-brown.openrc.example | 12 ++++++++++++ .../init/molly-brown.service.example | 0 3 files changed, 20 insertions(+), 3 deletions(-) create mode 100644 contrib/init/molly-brown.openrc.example rename molly-brown.service.example => contrib/init/molly-brown.service.example (100%) diff --git a/README.md b/README.md index 432af7f..ed20e69 100644 --- a/README.md +++ b/README.md @@ -117,8 +117,9 @@ it on system boot. #### Systemd An example systemd unit file for Molly Brown, named -`molly-brown.service.example`, can be found in the source directory. -After copying this file to `/etc/systemd/system/molly-brown.service` +`molly-brown.service.example`, can be found in the `contrib/init` +directory of the Molly Brown source directory. After copying this +file to `/etc/systemd/system/molly-brown.service` or `/usr/lib/systemd/system/molly-brown.service` (consult your system's documentation for the appropriate choice) and making any necessary changes for your environment, you can run the follow @@ -133,7 +134,11 @@ automatically on system boot. #### OpenRC -Instructions coming soon. +An example OpenRC initscript for Molly Brown, named +`molly-brown.openrc.example`, can be found in the `contrib/init` +directory of the Molly Brown source directory. + +More detailed instructions on OpenRC setup are welcome! ## Configuration Options diff --git a/contrib/init/molly-brown.openrc.example b/contrib/init/molly-brown.openrc.example new file mode 100644 index 0000000..472baf0 --- /dev/null +++ b/contrib/init/molly-brown.openrc.example @@ -0,0 +1,12 @@ +#!/sbin/openrc-run + +command="/usr/sbin/molly-brown" +command_user="gemini" +command_background="yes" +pidfile="/run/$RC_SVCNAME/$RC_SVCNAME.pid" + + +start_pre() { + checkpath --directory --owner $command_user:$command_user --mode 0775 \ + /run/$RC_SVCNAME /var/log/molly +} diff --git a/molly-brown.service.example b/contrib/init/molly-brown.service.example similarity index 100% rename from molly-brown.service.example rename to contrib/init/molly-brown.service.example