cmogstored dev/user discussion/issues/patches/etc
 help / color / mirror / code / Atom feed
From: Eric Wong <e@80x24.org>
To: cmogstored-public@bogomips.org
Subject: [PATCH] doc: add example systemd config files
Date: Wed, 11 Nov 2015 04:01:04 +0000	[thread overview]
Message-ID: <20151111040104.GA581@dcvr.yhbt.net> (raw)
In-Reply-To: <20151111024017.4786-1-e@80x24.org>

Since we'll support systemd, it's not a bad idea to include
reasonable example files for users.
---
 Makefile.am                  |  3 ++-
 examples/cmogstored.socket   | 11 +++++++++++
 examples/cmogstored@.service | 27 +++++++++++++++++++++++++++
 3 files changed, 40 insertions(+), 1 deletion(-)
 create mode 100644 examples/cmogstored.socket
 create mode 100644 examples/cmogstored@.service

diff --git a/Makefile.am b/Makefile.am
index 69b347e..5860f9c 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -224,7 +224,8 @@ EXTRA_DIST = $(RB_TESTS) $(RL_CGEN) $(RL_ALL) $(PERL_TESTS) $(extra_doc) \
   tests/.gitignore \
   $(top_srcdir)/.version $(top_srcdir)/.gnulib-version \
   test/valgrind.supp nostd/README \
-  $(tap_support)
+  $(tap_support) \
+  examples/cmogstored.socket examples/cmogstored@.service
 
 TESTS_ENVIRONMENT = PATH=$(top_builddir):$$PATH TMPDIR=$(test_tmpdir)
 
diff --git a/examples/cmogstored.socket b/examples/cmogstored.socket
new file mode 100644
index 0000000..852fd3a
--- /dev/null
+++ b/examples/cmogstored.socket
@@ -0,0 +1,11 @@
+# ==> /etc/systemd/system/cmogstored.socket <==
+[Unit]
+Description = cmogstored sockets
+
+[Socket]
+ListenStream = 127.0.0.1:7500
+ListenStream = 127.0.0.1:7501
+Service = cmogstored@1.service
+
+[Install]
+WantedBy = sockets.target
diff --git a/examples/cmogstored@.service b/examples/cmogstored@.service
new file mode 100644
index 0000000..2361a98
--- /dev/null
+++ b/examples/cmogstored@.service
@@ -0,0 +1,27 @@
+# ==> /etc/systemd/system/cmogstored@.service <==
+# Since SIGUSR2 upgrades do not work under systemd, this service file
+# allows starting two simultaneous services during upgrade time
+# (e.g. cmogstored@1 cmogstored@2) with the intention that they take
+# turns running in-between upgrades.  This should allow upgrading
+# without downtime
+
+[Unit]
+Description = cmogstored storage server %i
+Wants = cmogstored.socket
+After = cmogstored.socket
+
+[Service]
+ExecStart = /usr/local/bin/cmogstored \
+	    --httplisten=127.0.0.1:7500 \
+	    --mgmtlisten=127.0.0.1:7501 \
+	    --docroot=/var/mogdata
+Sockets = cmogstored.socket
+KillSignal = SIGQUIT
+User = mogstored
+Group = nogroup
+LimitNOFILE = 10000
+# some clients are slow, give them time before SIGKILL
+TimeoutStopSec = 7200
+
+[Install]
+WantedBy = multi-user.target
-- 
EW


      parent reply	other threads:[~2015-11-11  4:01 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-11  2:40 [PATCH] support systemd-style socket activation via environment Eric Wong
2015-11-11  3:38 ` [PATCH] set TCP listener options on inherited sockets Eric Wong
2015-11-11  4:01 ` Eric Wong [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://yhbt.net/cmogstored/README

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20151111040104.GA581@dcvr.yhbt.net \
    --to=e@80x24.org \
    --cc=cmogstored-public@bogomips.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://yhbt.net/cmogstored.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).