RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1524640 - systemd-analyze must not succeed on failures in verify command
Summary: systemd-analyze must not succeed on failures in verify command
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: systemd
Version: 7.5
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: rc
: ---
Assignee: systemd-maint
QA Contact: qe-baseos-daemons
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-12-11 19:15 UTC by Tomas Dolezal
Modified: 2021-02-15 07:34 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2021-02-15 07:34:00 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github systemd systemd issues 11651 0 None open RFE: optionally, make "systemd-analyze verify" fail if an unknown setting is encountered (or any other unit file parsing... 2021-01-22 11:04:00 UTC

Description Tomas Dolezal 2017-12-11 19:15:11 UTC
Description of problem:
(1) when systemd-analyze is presented with wrong unitfile, it sometimes reports success even if there are errors making the unitfile work badly.

(2) Also, it shows results for files in current directory if not asked to. It doesn't reflect the tests status via EXITCODE in this case though.

Version-Release number of selected component (if applicable):
systemd-219-49.el7.x86_64

How reproducible:
always

Steps to Reproduce:
all invocations bellow show also results for adjacent unit files in CWD
do `systemd-analyze verify mysvc.service` and see (a)
 * exitcode is zero, failure on dependencies detected (syntax)
do `systemd-analyze verify user.slice` and see (b)
 * from example in manpage
 * fails obviously, with exitcode 1
do `systemd-analyze verify mysvc.service user.slice` and see (c)
 * fails with exitcode 1

Actual results:
(a) systemd-analyze verify mysvc.service; echo EC=$?
[/root/mytests/user.slice:2] Unknown lvalue 'WhatIsThis' in section 'Unit'
[/root/mytests/user.slice:6] Unknown section 'Service'. Ignoring.
[/usr/lib/systemd/system/ip6tables.service:3] Failed to add dependency on syslog.target,iptables.service, ignoring: Invalid argument
[/root/mytests/mysvc.service:2] Failed to add dependency on syslog.target,network.service, ignoring: Invalid argument
EC=0

(b) systemd-analyze verify user.slice; echo EC=$?
[/root/mytests/user.slice:2] Unknown lvalue 'WhatIsThis' in section 'Unit'
[/root/mytests/user.slice:6] Unknown section 'Service'. Ignoring.
[/usr/lib/systemd/system/ip6tables.service:3] Failed to add dependency on syslog.target,iptables.service, ignoring: Invalid argument
Error: org.freedesktop.systemd1.NoSuchUnit: Unit not found.
Failed to create user.slice/start: No such file or directory
user.slice: man nosuchfile(1) command failed with code 16
EC=1

(c) systemd-analyze verify user.slice mysvc.service; echo EC=$?
[/root/mytests/user.slice:2] Unknown lvalue 'WhatIsThis' in section 'Unit'
[/root/mytests/user.slice:6] Unknown section 'Service'. Ignoring.
[/usr/lib/systemd/system/ip6tables.service:3] Failed to add dependency on syslog.target,iptables.service, ignoring: Invalid argument
[/root/mytests/mysvc.service:2] Failed to add dependency on syslog.target,network.service, ignoring: Invalid argument
Error: org.freedesktop.systemd1.NoSuchUnit: Unit not found.
Failed to create user.slice/start: No such file or directory
user.slice: man nosuchfile(1) command failed with code 16
EC=1
Expected results:
non-zero exitcode in all scenarios above

Additional info:
>cat mysvc.service 
[Unit]
After=syslog.target,network.service

[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=/usr/bin/true
ExecStop=/usr/bin/true

[Install]
WantedBy=basic.target

>cat user.slice 
[Unit]
WhatIsThis=11
Documentation=man:nosuchfile(1)
Requires=different.service

[Service]
Desription=x

Comment 2 Tomas Dolezal 2017-12-11 19:18:03 UTC
severity medium because automated checks are useless if not observing the output.
wrongly specified dependencies cause ugly bugs in other components

Comment 5 RHEL Program Management 2021-02-15 07:34:00 UTC
After evaluating this issue, there are no plans to address it further or fix it in an upcoming release.  Therefore, it is being closed.  If plans change such that this issue will be fixed in an upcoming release, then the bug can be reopened.


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