From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-2.9 required=3.0 tests=ALL_TRUSTED,AWL,BAYES_00, URIBL_BLOCKED shortcircuit=no autolearn=unavailable version=3.3.2 X-Original-To: cmogstored-public@bogomips.org Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id 16AEE1F4CF; Wed, 11 Nov 2015 04:01:05 +0000 (UTC) Date: Wed, 11 Nov 2015 04:01:04 +0000 From: Eric Wong To: cmogstored-public@bogomips.org Subject: [PATCH] doc: add example systemd config files Message-ID: <20151111040104.GA581@dcvr.yhbt.net> References: <20151111024017.4786-1-e@80x24.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20151111024017.4786-1-e@80x24.org> List-Id: 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