Bug 1110675 - Running in chroot, ignoring request -- exit code 0
Running in chroot, ignoring request -- exit code 0
Status: CLOSED WONTFIX
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: systemd (Show other bugs)
7.0
Unspecified Unspecified
unspecified Severity unspecified
: rc
: ---
Assigned To: Michal Sekletar
qe-baseos-daemons
: Reopened
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2014-06-18 04:52 EDT by Jan Pazdziora
Modified: 2015-06-16 09:17 EDT (History)
6 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2014-07-02 14:53:00 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Jan Pazdziora 2014-06-18 04:52:45 EDT
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 07:41:32 EDT
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 10:37:49 EDT
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 11:28:14 EDT
(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 14:53:00 EDT
(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 08:07:43 EST
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.