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 1110675 - Running in chroot, ignoring request -- exit code 0
Summary: Running in chroot, ignoring request -- exit code 0
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: systemd
Version: 7.0
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Michal Sekletar
QA Contact: qe-baseos-daemons
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-06-18 08:52 UTC by Jan Pazdziora
Modified: 2015-06-16 13:17 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-07-02 18:53:00 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Jan Pazdziora 2014-06-18 08:52:45 UTC
Description of problem:

Related to bug 1080532 comment 7, we find that systemctl exit code is 0 when it also says Running in chroot, ignoring request, in anaconda / kickstart.

Looking at LSB section 20.2, the exit code in such situation probably should be

4	program or service status is unknown

not

0	program is running or service is OK

Version-Release number of selected component (if applicable):

systemd-208-11.el7.x86_64

How reproducible:

Assume deterministic.

Steps to Reproduce:
1. In kickstart, run /bin/systemctl is-active chronyd.service
2. Check the exit status.

Actual results:

Message Running in chroot, ignoring request.
Exit status 0.

Expected results:

Message Running in chroot, ignoring request.
Exit status 4.

Additional info:

Comment 1 Michal Sekletar 2014-06-23 11:41:32 UTC
Seems reasonable. However I revisited the initial idea to return status code 4. systemctl shouldn't play any games here and just simply tell user sorry can't do what you have asked for, log sensible error message and return EXIT_FAILURE. I submitted following [0] patch upstream. Will be back-ported to rhel-7.1 if applied upstream.

[0] http://lists.freedesktop.org/archives/systemd-devel/2014-June/020411.html

Comment 2 Lennart Poettering 2014-06-23 14:37:49 UTC
Hmm, I am pretty sure I don't think this should be changed.

The idea is that inside of chroots the various systmctl start/stop/restart invocations become NOPs, so that package tools don't trip up on failing postinst scripts when installing packages like that. 

It is intended by design that these operations hence return success when running in a chroot(), and your suggested change would be diametrically against that.

Comment 3 Jan Pazdziora 2014-06-23 15:28:14 UTC
(In reply to Lennart Poettering from comment #2)
> 
> The idea is that inside of chroots the various systmctl start/stop/restart
> invocations become NOPs, so that package tools don't trip up on failing
> postinst scripts when installing packages like that. 

So in effect systemctl misguides the package tools and their postinst scripts about the state of the system, instead of giving them a chance to act accordingly when systemctl did not provide the information (or did not run the action) it was asked for.

Reopening for reconsideration.

Comment 4 Michal Sekletar 2014-07-02 18:53:00 UTC
(In reply to Jan Pazdziora from comment #3)
> (In reply to Lennart Poettering from comment #2)
> > 
> > The idea is that inside of chroots the various systmctl start/stop/restart
> > invocations become NOPs, so that package tools don't trip up on failing
> > postinst scripts when installing packages like that. 
> 
> So in effect systemctl misguides the package tools and their postinst
> scripts about the state of the system, instead of giving them a chance to
> act accordingly when systemctl did not provide the information (or did not
> run the action) it was asked for.
> 
> Reopening for reconsideration.

Sorry we will not change the current behaviour, because we think it'd bring more ill than good. If you decide to reopen *please* do send an email to either tech-list or even better fedora-devel, so packagers can express their opinion, because I think that discussed change would hurt them most.

Comment 5 Michael Shigorin 2014-12-01 13:07:43 UTC
Side note: in short, misguiding is considered "less ill".
I wonder if some kind of WHITE_IS_WHITE env var would get things straight.


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