From 408f8fb031091147d399f1daa064d7e506b54304 Mon Sep 17 00:00:00 2001 From: Jimmy Berry Date: Wed, 7 Nov 2018 22:59:23 -0600 Subject: [PATCH] dist/spec: provide obs-operator subpackage. --- dist/package/openSUSE-release-tools.spec | 26 ++++++++++++++++++++++++ systemd/osrt-obs-operator.service | 10 +++++++++ 2 files changed, 36 insertions(+) create mode 100644 systemd/osrt-obs-operator.service diff --git a/dist/package/openSUSE-release-tools.spec b/dist/package/openSUSE-release-tools.spec index 5221dc27..e6fda47b 100644 --- a/dist/package/openSUSE-release-tools.spec +++ b/dist/package/openSUSE-release-tools.spec @@ -199,6 +199,17 @@ Requires: build Requires: perl-XML-Simple Requires(pre): shadow +%package obs-operator +Summary: Server used to perform staging operations +Group: Development/Tools/Other +BuildArch: noarch +Requires: osc-plugin-staging = %{version} +Requires(pre): shadow + +%description obs-operator +Server used to perform staging operations as a service instead of requiring +the osc staging plugin to be utilized directly. + %description repo-checker Repository checker service that inspects built RPMs from stagings. @@ -367,6 +378,17 @@ if [ -x /usr/bin/systemctl ] && /usr/bin/systemctl is-enabled grafana-server ; t /usr/bin/systemctl try-restart --no-block grafana-server fi +%pre obs-operator +getent passwd osrt-obs-operator > /dev/null || \ + useradd -r -m -s /sbin/nologin -c "user for openSUSE-release-tools-obs-operator" osrt-obs-operator +exit 0 + +%postun obs-operator +%systemd_postun +if [ -x /usr/bin/systemctl ] && /usr/bin/systemctl is-enabled osrt-obs-operator ; then + /usr/bin/systemctl try-restart --no-block osrt-obs-operator +fi + %pre repo-checker getent passwd osrt-repo-checker > /dev/null || \ useradd -r -m -s /sbin/nologin -c "user for openSUSE-release-tools-repo-checker" osrt-repo-checker @@ -544,6 +566,10 @@ exit 0 %{_unitdir}/osrt-metrics-access.service %{_unitdir}/osrt-metrics-access.timer +%files obs-operator +%{_bindir}/osrt-obs_operator +%{_unitdir}/osrt-obs-operator.service + %files repo-checker %defattr(-,root,root,-) %{_bindir}/osrt-repo_checker diff --git a/systemd/osrt-obs-operator.service b/systemd/osrt-obs-operator.service new file mode 100644 index 00000000..a319960a --- /dev/null +++ b/systemd/osrt-obs-operator.service @@ -0,0 +1,10 @@ +[Unit] +Description=openSUSE Release Tools: OBS Operator + +[Service] +User=osrt-obs-operator +ExecStart=/usr/bin/osrt-obs_operator --debug +Restart=on-failure + +[Install] +WantedBy=multi-user.target