commit e63180e008f4b878c017fa8ba642aabd1ad4efb4 Author: Warren Togami warren@slickage.com Date: Wed Jul 9 04:26:08 2014 -1000
Add systemd notify support
...hdb-0013-Add-systemd-notification-support.patch | 34 ++++++++++++++++++++ couchdb.service | 2 +- couchdb.spec | 13 ++++++-- 3 files changed, 45 insertions(+), 4 deletions(-) --- diff --git a/couchdb-0013-Add-systemd-notification-support.patch b/couchdb-0013-Add-systemd-notification-support.patch new file mode 100644 index 0000000..f650849 --- /dev/null +++ b/couchdb-0013-Add-systemd-notification-support.patch @@ -0,0 +1,34 @@ +From 2969091a2ba903b9329739db886326528bfbecbe Mon Sep 17 00:00:00 2001 +From: Peter Lemenkov lemenkov@gmail.com +Date: Mon, 7 Jul 2014 21:32:43 +0400 +Subject: [PATCH 13/13] Add systemd notification support + +Signed-off-by: Peter Lemenkov lemenkov@gmail.com + +Load module first + +Function erlang:function_exported/3 looks only for modules already +loaded. So we have to load module first. We can do it either implicitly +by calling any function from the module (and catch for possible +exceptions if no such module available) or explicitly. + +Signed-off-by: Peter Lemenkov lemenkov@gmail.com +--- + src/couchdb/couch_server_sup.erl | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/src/couchdb/couch_server_sup.erl b/src/couchdb/couch_server_sup.erl +index 39a5568..2d25220 100644 +--- a/src/couchdb/couch_server_sup.erl ++++ b/src/couchdb/couch_server_sup.erl +@@ -108,6 +108,7 @@ start_server(IniFiles) -> + + Ip = couch_config:get("httpd", "bind_address"), + io:format("Apache CouchDB has started. Time to relax.~n"), ++ {module, sd_notify} == code:load_file(sd_notify) andalso sd_notify:sd_notify(0, "READY=1"), + Uris = [get_uri(Name, Ip) || Name <- [couch_httpd, https]], + [begin + case Uri of +-- +1.9.3 + diff --git a/couchdb.service b/couchdb.service index d092eb9..9e37bae 100644 --- a/couchdb.service +++ b/couchdb.service @@ -5,7 +5,7 @@ After=network.target [Service] User=couchdb Group=couchdb -Type=simple +Type=notify StandardOutput=journal StandardError=journal Restart=always diff --git a/couchdb.spec b/couchdb.spec index 9a5ca62..5731a47 100644 --- a/couchdb.spec +++ b/couchdb.spec @@ -7,7 +7,7 @@
Name: couchdb Version: 1.6.0 -Release: 8%{?dist} +Release: 9%{?dist} Summary: A document database server, accessible via a RESTful JSON API
Group: Applications/Databases @@ -31,6 +31,7 @@ Patch9: couchdb-0009-README-was-renamed.patch Patch10: couchdb-0010-Use-_DEFAULT_SOURCE-instead-of-obsolete-_BSD_SOURCE.patch Patch11: couchdb-0011-Silence-redundant-logging-to-stdout-stderr.patch Patch12: couchdb-0012-Expand-.d-directories-in-erlang.patch +Patch13: couchdb-0013-Add-systemd-notification-support.patch
BuildRequires: autoconf BuildRequires: autoconf-archive @@ -62,6 +63,7 @@ Requires: erlang-kernel%{?_isa} Requires: erlang-mochiweb%{?_isa} Requires: erlang-oauth%{?_isa} Requires: erlang-os_mon%{?_isa} +Requires: erlang-sd_notify%{?_isa} Requires: erlang-snappy%{?_isa} Requires: erlang-ssl%{?_isa} # Error:erlang(unicode:characters_to_binary/1) in R12B and earlier @@ -108,10 +110,12 @@ JavaScript acting as the default view definition language. %endif %patch9 -p1 -b .renamed %if 0%{?fedora} > 20 +# Workaround hard-coded Makefile.am assumptions %patch10 -p1 -b .default_instead_of_bsd %endif %patch11 -p1 -b .redundant_logging %patch12 -p1 -b .expands_d +%patch13 -p1 -b .sd_notify
#gzip -d -k ./share/doc/build/latex/CouchDB.pdf.gz
@@ -239,7 +243,10 @@ fi
%changelog -* Sun Jul 06 2014 Warren Togami wtogami@gmail.com - 1.6.0-8 +* Wed Jul 09 2014 Warren Togami warren@slickage.com - 1.6.0-9 +- Add systemd notify support + +* Sun Jul 06 2014 Warren Togami warren@slickage.com - 1.6.0-8 - SELinux: Use /usr/libexec/couchdb wrapper for systemd ExecStart, executes as couchdb_t Additional fixes to selinux-policy are required, see latest status http://wtogami.fedorapeople.org/a/2014/couchdb.txt @@ -253,7 +260,7 @@ fi Users can modify local.ini or add new files in local.d/ - CouchDB runtime config changes are written to local.ini
-* Thu Jul 03 2014 Warren Togami wtogami@gmail.com - 1.6.0-6 +* Thu Jul 03 2014 Warren Togami warren@slickage.com - 1.6.0-6 - silence stdout/stderr to prevent redundant flooding of /var/log/messages CouchDB already logs these messages to /var/log/couchdb/couch.log Instead print the log filename to stdout, in case a user who ran it