Bug 2082886 - Review Request: nagios-plugins-systemd - Nagios plugin to check systemd
Summary: Review Request: nagios-plugins-systemd - Nagios plugin to check systemd
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: Package Review
Version: rawhide
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Otto Liljalaakso
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2022-05-08 08:03 UTC by Till Hofmann
Modified: 2022-11-17 01:27 UTC (History)
3 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2022-11-17 01:27:24 UTC
Type: ---
Embargoed:
otto.liljalaakso: fedora-review+


Attachments (Terms of Use)

Description Till Hofmann 2022-05-08 08:03:44 UTC
Spec URL: https://thofmann.fedorapeople.org/python-nagios-plugins-check_systemd.spec
SRPM URL: https://thofmann.fedorapeople.org/python-nagios-plugins-check_systemd-2.3.1-1.fc35.src.rpm

Description:
This systemd check for nagios compatible monitoring systems will report a
degraded systemd to your monitoring solution. It can also be used to monitor
individual systemd services and timers units.

Fedora Account System Username: thofmann

COPR: https://copr.fedorainfracloud.org/coprs/thofmann/nagios-plugins/
koji scratch build: https://koji.fedoraproject.org/koji/taskinfo?taskID=86792294
fedora-review run on COPR: https://download.copr.fedorainfracloud.org/results/thofmann/nagios-plugins/fedora-rawhide-x86_64/04378861-python-nagios-plugins-check_systemd/fedora-review/

Comment 2 Otto Liljalaakso 2022-10-03 21:21:59 UTC
Could you build this again for current Rawhide?
I get an error when I try 'fedpkg mockbuild':

    + /usr/bin/python3 -m tox --current-env -q --recreate -e py311
    .S..Traceback (most recent call last):
      File "/builddir/build/BUILDROOT/python-nagios-plugins-check_systemd-2.3.1-2.fc38.x86_64//usr/lib64/nagios/plugins/check_systemd", line 5, in <module>
        from check_systemd import main
    ModuleNotFoundError: No module named 'check_systemd'
    F.....................................
    ======================================================================
    FAIL: test_entry_point (test_subprocess.TestCli.test_entry_point)
    ----------------------------------------------------------------------
    Traceback (most recent call last):
      File "/builddir/build/BUILD/check_systemd-2.3.1/test/test_subprocess.py", line 288, in test_entry_point
        self.assertEqual(process.returncode, 0)
    AssertionError: 1 != 0

    ----------------------------------------------------------------------
    Ran 42 tests in 2.614s

    FAILED (SKIP=1, failures=1)
    ERROR: InvocationError for command /usr/bin/nosetests --nocapture (exited with code 1)
    ___________________________________ summary ____________________________________
    ERROR:   py311: commands failed

Since an importable module is involved,
should you be using %pyproject_save_files in the specfile?

Other than that, two comments from reading the specfile:

> License:        LGPLv2+

Since recently, new packages must use SPDX license identifiers.
Thus, this should be "LGPL-2.1-or-later".

Reference: https://docs.fedoraproject.org/en-US/packaging-guidelines/LicensingGuidelines/#_valid_license_short_names

Additionally, where did you get the "+"?
Looking at the repo, it looks like the license is "LGPL-2.1-only".

> Summary:        Nagios plugin to check systemd

Would it make sense to use %{summary} here?
You are already doing a similar thing for descriptions.
(This comment is not review blocking.)

Comment 3 Till Hofmann 2022-10-04 11:44:47 UTC
Spec URL: https://thofmann.fedorapeople.org/python-nagios-plugins-check_systemd.spec
SRPM URL: https://thofmann.fedorapeople.org/python-nagios-plugins-check_systemd-2.3.1-5.fc38.src.rpm

I did not realize that the SPDX change was already in place, thanks for pointing this out! I've also changed it to LGPL-2.1-only.

I also fixed the test, it should now build on rawhide. The problem was that the python module is not in the standard python module path but instead in the nagios plugins dir. It seems like previously, PATH was also considered when looking for modules, but not anymore. I've added the plugins dir to PYTHONPATH, which fixed the issue.

I've also switched to using %_summary, as you suggested.

Comment 4 Otto Liljalaakso 2022-10-05 22:52:41 UTC
Thank you for the update, now it builds!
I now managed to run fedora-review,
I have only two comments:

> [!]: Package must own all directories that it creates.
>     Note: Directories without known owners: /usr/lib64/nagios/plugins,
>     /usr/lib64/nagios

Either own them in this package, or Require: nagios-common.
Reference: https://docs.fedoraproject.org/en-US/packaging-guidelines/#_file_and_directory_ownership
The reference is terribly unclearly written, unfortunately,
but it boils down to
"if some dependency of yours does not own it, you have to own it yourself."

> [ ]: Package is named according to the Package Naming Guidelines.

Inspecting the output of 'dnf -C search nagios-plugin',
it seems to me that the name of this package should be 'nagios-plugins-systemd'.
There is a large set of others that dropp the 'check_' part from the package name.
(This comment is not release blocking.)

Comment 5 Mohamed El Morabity 2022-10-05 23:08:14 UTC
Since this package is not a Python library, its name shouldn't be prefixed by python*-:
    https://docs.fedoraproject.org/en-US/packaging-guidelines/Python/#_application_naming

For consistency with other Nagios plugins available in the Fedora repos, I'd rename this package to nagios-plugins-check-systemd:
    $ dnf list nagios-plugins-\*

Comment 6 Till Hofmann 2022-10-07 11:53:32 UTC
Spec URL: https://thofmann.fedorapeople.org/nagios-plugins-systemd.spec
SRPM URL: https://thofmann.fedorapeople.org/nagios-plugins-systemd-2.3.1-2.fc38.src.rpm

Thank you for the suggestions! I've renamed the package to nagios-plugins-systemd, this seems to be the most common naming scheme for nagios plugins.
I've also added a Requires: for the plugin dir.

Comment 7 Otto Liljalaakso 2022-10-07 21:15:38 UTC
> Summary:        Nagios plugin to check systemd

Many existing Nagios plugins seem to use the following convention:
"Nagios Plugin - check_systemd".
Maybe it would make sense to use it here as well,
so that 'dnf search check_systemd' would find it.
(This comment is not review blocking.)

> [!]: No file requires outside of /etc, /bin, /sbin, /usr/bin, /usr/sbin.
>     Note: Incorrect Requires : /usr/lib64/nagios/plugins
>     See: https://docs.fedoraproject.org/en-US/packaging-
>     guidelines/#_file_and_directory_dependencies

Your solution for depending on the directory itself makes sense,
but unfortunately, the Packaging Guidelines say you SHOULD NOT have a file dependency
outside of certain fixed paths.
So please just do Requires: nagios-common.

Reference is included above.

> [!]: Spec file according to URL is the same as in SRPM.
>      Note: Spec file as given by url is not the same as in SRPM (see
>      attached diff).
>      See: (this test has no URL)

This is just an incompatibility between  'fedpkg srpm', fedora-review and rpmautospec.
No action needed, just remember not to do 'fedpkg import' with that srpm.

> Provides
> --------
> nagios-plugins-systemd:
>     python3.11dist(check-systemd)
>     python3dist(check-systemd)

I actually find it quite strange that this plugin is marked as an installed Python package.
It does not provide anything that is available for anything else to use,
and we already discovered with the problem in %check.

Unfortunately, I am not good enough with Python to say,
if it would make sense to suggest upstream to install the main content to a module in site-packages.

 (This comment is not release blocking.)

Since there is only one review blocking comment left,
and that one is very simple to correct,
I do not think it makes sense to strecth the review any longer.
Package accepted.

Comment 8 Otto Liljalaakso 2022-10-07 21:15:52 UTC
Package Review
==============

Legend:
[x] = Pass, [!] = Fail, [-] = Not applicable, [?] = Not evaluated



===== MUST items =====

Generic:
[x]: Package is licensed with an open-source compatible license and meets
     other legal requirements as defined in the legal section of Packaging
     Guidelines.
[x]: License field in the package spec file matches the actual license.
     Note: Checking patched sources after %prep for licenses. Licenses
     found: "Unknown or generated", "GNU Lesser General Public License,
     Version 2.1", "*No copyright* GNU Library General Public License,
     Version 2.0". 43 files have unknown license. Detailed output of
     licensecheck in
     /home/otto/src/Jakelut/Fedora/Katselmointi/2082886-nagios-plugins-
     systemd/licensecheck.txt
[x]: %build honors applicable compiler flags or justifies otherwise.
[x]: Package contains no bundled libraries without FPC exception.
[x]: Changelog in prescribed format.
[x]: Sources contain only permissible code or content.
[x]: Package contains desktop file if it is a GUI application.
[-]: Development files must be in a -devel package
[x]: Package uses nothing in %doc for runtime.
[x]: Package consistently uses macros (instead of hard-coded directory
     names).
[x]: Package is named according to the Package Naming Guidelines.
[x]: Package does not generate any conflict.
[x]: Package obeys FHS, except libexecdir and /usr/target.
[-]: If the package is a rename of another package, proper Obsoletes and
     Provides are present.
[x]: Requires correct, justified where necessary.
[x]: Spec file is legible and written in American English.
[-]: Package contains systemd file(s) if in need.
[-]: Useful -debuginfo package or justification otherwise.
[x]: Package is not known to require an ExcludeArch tag.
[x]: Large documentation must go in a -doc subpackage. Large could be size
     (~1MB) or number of files.
     Note: Documentation size is 10240 bytes in 1 files.
[x]: Package complies to the Packaging Guidelines
[x]: Package successfully compiles and builds into binary rpms on at least
     one supported primary architecture.
[x]: Package installs properly.
[x]: Rpmlint is run on all rpms the build produces.
     Note: There are rpmlint messages (see attachment).
[x]: If (and only if) the source package includes the text of the
     license(s) in its own file, then that file, containing the text of the
     license(s) for the package is included in %license.
[x]: Package requires other packages for directories it uses.
[x]: Package must own all directories that it creates.
[x]: Package does not own files or directories owned by other packages.
[x]: Package uses either %{buildroot} or $RPM_BUILD_ROOT
[x]: Package does not run rm -rf %{buildroot} (or $RPM_BUILD_ROOT) at the
     beginning of %install.
[x]: Macros in Summary, %description expandable at SRPM build time.
[x]: Dist tag is present.
[x]: Package does not contain duplicates in %files.
[x]: Permissions on files are set properly.
[x]: Package must not depend on deprecated() packages.
[x]: Package use %makeinstall only when make install DESTDIR=... doesn't
     work.
[x]: Package is named using only allowed ASCII characters.
[x]: Package does not use a name that already exists.
[x]: Package is not relocatable.
[x]: Sources used to build the package match the upstream source, as
     provided in the spec URL.
[x]: Spec file name must match the spec package %{name}, in the format
     %{name}.spec.
[x]: File names are valid UTF-8.
[x]: Packages must not store files under /srv, /opt or /usr/local

===== SHOULD items =====

Generic:
[!]: No file requires outside of /etc, /bin, /sbin, /usr/bin, /usr/sbin.
     Note: Incorrect Requires : /usr/lib64/nagios/plugins
     See: https://docs.fedoraproject.org/en-US/packaging-
     guidelines/#_file_and_directory_dependencies
[ ]: If the source package does not include license text(s) as a separate
     file from upstream, the packager SHOULD query upstream to include it.
[ ]: Final provides and requires are sane (see attachments).
[ ]: Package functions as described.
[ ]: Latest version is packaged.
[ ]: Package does not include license text files separate from upstream.
[ ]: Sources are verified with gpgverify first in %prep if upstream
     publishes signatures.
     Note: gpgverify is not used.
[ ]: Package should compile and build into binary rpms on all supported
     architectures.
[ ]: %check is present and all tests pass.
[ ]: Packages should try to preserve timestamps of original installed
     files.
[x]: Reviewer should test that the package builds in mock.
[x]: Buildroot is not present
[x]: Package has no %clean section with rm -rf %{buildroot} (or
     $RPM_BUILD_ROOT)
[x]: Packager, Vendor, PreReq, Copyright tags should not be in spec file
[x]: Sources can be downloaded from URI in Source: tag
[x]: SourceX is a working URL.
[x]: Spec use %global instead of %define unless justified.

===== EXTRA items =====

Generic:
[!]: Spec file according to URL is the same as in SRPM.
     Note: Spec file as given by url is not the same as in SRPM (see
     attached diff).
     See: (this test has no URL)
[x]: Rpmlint is run on all installed packages.
     Note: No rpmlint messages.
[x]: Large data in /usr/share should live in a noarch subpackage if package
     is arched.


Rpmlint
-------
Cannot parse rpmlint output:


Rpmlint (installed packages)
----------------------------
============================ rpmlint session starts ============================
rpmlint: 2.4.0
configuration:
    /usr/lib/python3.11/site-packages/rpmlint/configdefaults.toml
    /etc/xdg/rpmlint/fedora-legacy-licenses.toml
    /etc/xdg/rpmlint/fedora-spdx-licenses.toml
    /etc/xdg/rpmlint/fedora.toml
    /etc/xdg/rpmlint/scoring.toml
    /etc/xdg/rpmlint/users-groups.toml
    /etc/xdg/rpmlint/warn-on-functions.toml
checks: 31, packages: 1

 1 packages and 0 specfiles checked; 0 errors, 0 warnings, 0 badness; has taken 0.0 s 



Source checksums
----------------
https://github.com/Josef-Friedrich/check_systemd/archive/v2.3.1/nagios-plugins-systemd-2.3.1.tar.gz :
  CHECKSUM(SHA256) this package     : 4e583a9a78b2182705a2f806f745eccf90055bb995bd282c84f5bc86d24221d4
  CHECKSUM(SHA256) upstream package : 4e583a9a78b2182705a2f806f745eccf90055bb995bd282c84f5bc86d24221d4


Requires
--------
nagios-plugins-systemd (rpmlib, GLIBC filtered):
    /usr/bin/python3
    /usr/lib64/nagios/plugins
    python(abi)
    python3.11dist(nagiosplugin)



Provides
--------
nagios-plugins-systemd:
    nagios-plugins-systemd
    nagios-plugins-systemd(x86-64)
    python3.11dist(check-systemd)
    python3dist(check-systemd)



Diff spec file in url and in SRPM
---------------------------------
--- /home/otto/src/Jakelut/Fedora/Katselmointi/2082886-nagios-plugins-systemd/srpm/nagios-plugins-systemd.spec	2022-10-07 23:05:19.468812839 +0300
+++ /home/otto/src/Jakelut/Fedora/Katselmointi/2082886-nagios-plugins-systemd/srpm-unpacked/nagios-plugins-systemd.spec	2022-10-07 14:49:59.000000000 +0300
@@ -1,2 +1,11 @@
+## START: Set by rpmautospec
+## (rpmautospec version 0.3.0)
+%define autorelease(e:s:pb:n) %{?-p:0.}%{lua:
+    release_number = 2;
+    base_release_number = tonumber(rpm.expand("%{?-b*}%{!?-b:1}"));
+    print(release_number + base_release_number - 1);
+}%{?-e:.%{-e*}}%{?-s:.%{-s*}}%{!?-n:%{?dist}}
+## END: Set by rpmautospec
+
 %global nagiospluginsdir %{_libdir}/nagios/plugins
 Name:           nagios-plugins-systemd
@@ -56,3 +65,7 @@
 
 %changelog
-%autochangelog
+* Fri Oct 07 2022 Till Hofmann <thofmann> 2.3.1-2
+- Require the package that owns the plugin dir
+
+* Fri Oct 07 2022 Till Hofmann <thofmann> 2.3.1-1
+- Rename package to nagios-plugins-systemd


Generated by fedora-review 0.9.0 (6761b6c) last change: 2022-08-23
Command line :/usr/bin/fedora-review --bug 2082886
Buildroot used: fedora-rawhide-x86_64
Active plugins: Shell-api, Generic
Disabled plugins: Ruby, R, PHP, Perl, Python, SugarActivity, Haskell, fonts, Java, C/C++, Ocaml
Disabled flags: EPEL6, EPEL7, DISTTAG, BATCH, EXARCH

Comment 9 Jens Petersen 2022-11-07 12:08:01 UTC
(fedscm-admin):  The Pagure repository was created at https://src.fedoraproject.org/rpms/nagios-plugins-systemd

Comment 10 Fedora Update System 2022-11-08 18:28:33 UTC
FEDORA-2022-69fb181ee2 has been submitted as an update to Fedora 37. https://bodhi.fedoraproject.org/updates/FEDORA-2022-69fb181ee2

Comment 11 Fedora Update System 2022-11-08 18:28:34 UTC
FEDORA-2022-c1372db834 has been submitted as an update to Fedora 36. https://bodhi.fedoraproject.org/updates/FEDORA-2022-c1372db834

Comment 12 Fedora Update System 2022-11-09 09:17:39 UTC
FEDORA-2022-69fb181ee2 has been pushed to the Fedora 37 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf install --enablerepo=updates-testing --refresh --advisory=FEDORA-2022-69fb181ee2 \*`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2022-69fb181ee2

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 13 Fedora Update System 2022-11-09 11:35:37 UTC
FEDORA-2022-c1372db834 has been pushed to the Fedora 36 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf install --enablerepo=updates-testing --refresh --advisory=FEDORA-2022-c1372db834 \*`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2022-c1372db834

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 14 Fedora Update System 2022-11-17 01:27:24 UTC
FEDORA-2022-c1372db834 has been pushed to the Fedora 36 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 15 Fedora Update System 2022-11-17 01:27:35 UTC
FEDORA-2022-69fb181ee2 has been pushed to the Fedora 37 stable repository.
If problem still persists, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.