From 80a6b39f7fb1203a6ec1626885b8d37a11163821 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Otto=20Kek=C3=A4l=C3=A4inen?= Date: Fri, 27 Dec 2019 10:52:19 +0200 Subject: [PATCH 1/3] Include systemd service definition in Debian packaging --- debian/galera-arbitrator-4.garb.service | 1 + debian/galera-arbitrator-4.install | 1 + debian/rules | 3 +++ 3 files changed, 5 insertions(+) create mode 120000 debian/galera-arbitrator-4.garb.service diff --git a/debian/galera-arbitrator-4.garb.service b/debian/galera-arbitrator-4.garb.service new file mode 120000 index 0000000..05cd333 --- /dev/null +++ b/debian/galera-arbitrator-4.garb.service @@ -0,0 +1 @@ +../garb/files/garb.service \ No newline at end of file diff --git a/debian/galera-arbitrator-4.install b/debian/galera-arbitrator-4.install index 436ef14..39f0ffc 100644 --- a/debian/galera-arbitrator-4.install +++ b/debian/galera-arbitrator-4.install @@ -1 +1,2 @@ garb/garbd usr/bin +garb/files/garb-systemd usr/bin diff --git a/debian/rules b/debian/rules index b0e892c..bccfec8 100755 --- a/debian/rules +++ b/debian/rules @@ -64,5 +64,8 @@ override_dh_auto_build: override_dh_installinit-arch: dh_installinit -n --name=garb -- defaults 18 22 +override_dh_installsystemd: + dh_installsystemd --name=garb + %: dh $@ -- GitLab From e7878f7167b4edd691b0a2aad463fc54a216cb74 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Otto=20Kek=C3=A4l=C3=A4inen?= Date: Sat, 4 Jan 2020 23:22:38 +0200 Subject: [PATCH 2/3] Add man page for garb-systemd --- debian/additions/garb-systemd.8 | 16 ++++++++++++++++ debian/galera-arbitrator-4.manpages | 1 + 2 files changed, 17 insertions(+) create mode 100644 debian/additions/garb-systemd.8 diff --git a/debian/additions/garb-systemd.8 b/debian/additions/garb-systemd.8 new file mode 100644 index 0000000..add754c --- /dev/null +++ b/debian/additions/garb-systemd.8 @@ -0,0 +1,16 @@ +.TH GARB-SYSTEMD "8" "January 2020" "garb-systemd" "System Administration Utilities" +.SH NAME +garb-systemd \- systemd start helper for arbitrator daemon +.SH SYNOPSIS +.B garb-systemd +{\fI\,start\/\fR} +.SH "DESCRIPTION" +This is a simple wrapper for garbd written in shell script, which facilitates starting garbd via systemd. While starting garbd, settings are applied from /etc/sysconfig/garb or from environment variables GALERA_NODES, GALERA_GROUP, GALERA_PORT, GALERA_OPTIONS and LOG_FILE. + +For more information, view the source code and read more at https://galeracluster.com/library/documentation/arbitrator.html + +.SH BUGS +See Galera bug tracker at https://github.com/codership/galera + +.SH AUTHOR +Codership Oy diff --git a/debian/galera-arbitrator-4.manpages b/debian/galera-arbitrator-4.manpages index c881ff7..db629fd 100644 --- a/debian/galera-arbitrator-4.manpages +++ b/debian/galera-arbitrator-4.manpages @@ -1 +1,2 @@ +debian/additions/garb-systemd.8 man/garbd.8 -- GitLab From 96e9ef4e5d167ce472feb0ecb1c8596ed157cea7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Otto=20Kek=C3=A4l=C3=A4inen?= Date: Sat, 4 Jan 2020 23:55:24 +0200 Subject: [PATCH 3/3] Add minor systemd service definition fixes --- debian/patches/series | 2 ++ debian/patches/systemd-documentation.patch | 33 +++++++++++++++++++ debian/patches/systemd-obsolete-target.patch | 34 ++++++++++++++++++++ 3 files changed, 69 insertions(+) create mode 100644 debian/patches/systemd-documentation.patch create mode 100644 debian/patches/systemd-obsolete-target.patch diff --git a/debian/patches/series b/debian/patches/series index d7987b4..1430728 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -3,3 +3,5 @@ 526.patch 527.patch disable-sporadic-failing-tests.patch +systemd-obsolete-target.patch +systemd-documentation.patch diff --git a/debian/patches/systemd-documentation.patch b/debian/patches/systemd-documentation.patch new file mode 100644 index 0000000..3277b27 --- /dev/null +++ b/debian/patches/systemd-documentation.patch @@ -0,0 +1,33 @@ +From 968b03ea08c9c50a3946c0c3926e450ecedcdcfa Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Otto=20Kek=C3=A4l=C3=A4inen?= +Date: Sat, 4 Jan 2020 23:48:24 +0200 +Subject: [PATCH] Add Documentation keys to systemd service definition + +Documentation for systemd service files can be automatically viewed using +'systemctl help servicename' if this field is present. + +See also: +https://lintian.debian.org/tags/systemd-service-file-missing-documentation-key.html +--- + garb/files/garb.service | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/garb/files/garb.service b/garb/files/garb.service +index 198755c0c..45cb7db05 100644 +--- a/garb/files/garb.service ++++ b/garb/files/garb.service +@@ -2,6 +2,8 @@ + + [Unit] + Description=Galera Arbitrator Daemon ++Documentation=man:garbd(8) ++Documentation=https://galeracluster.com/library/documentation/arbitrator.html + After=network.target + + [Install] +@@ -19,5 +21,3 @@ KillSignal=SIGINT + + TimeoutSec=2m + PrivateTmp=false +- +- diff --git a/debian/patches/systemd-obsolete-target.patch b/debian/patches/systemd-obsolete-target.patch new file mode 100644 index 0000000..d0d4588 --- /dev/null +++ b/debian/patches/systemd-obsolete-target.patch @@ -0,0 +1,34 @@ +From 416222e6e76484323002d316d261a6c3b0056044 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Otto=20Kek=C3=A4l=C3=A4inen?= +Date: Sat, 4 Jan 2020 23:47:00 +0200 +Subject: [PATCH] Remove obsolete target 'syslog' from systemd service + definition + +Declaring After=syslog.target is unnecessary by now because syslog is +socket-activated and will therefore be started when needed. + +Having network.target is enough, and that is e.g. how the MariaDB systemd +service defines it. + +This change is safe on the Galera 4.x branch since it most likely will not +target very old Linux distros anymore. + +See also: +https://lintian.debian.org/tags/systemd-service-file-refers-to-obsolete-target.html +--- + garb/files/garb.service | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/garb/files/garb.service b/garb/files/garb.service +index 9bd9ddaa7..198755c0c 100644 +--- a/garb/files/garb.service ++++ b/garb/files/garb.service +@@ -2,7 +2,7 @@ + + [Unit] + Description=Galera Arbitrator Daemon +-After=network.target syslog.target ++After=network.target + + [Install] + WantedBy=multi-user.target -- GitLab