Bug 1450516 - Login shell with systemd-nspawn
Summary: Login shell with systemd-nspawn
Status: CLOSED ERRATA
Alias: None
Product: Fedora EPEL
Classification: Fedora
Component: mock
Version: epel7
Hardware: All
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: Miroslav Suchý
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Keywords:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-05-12 21:05 UTC by Orion Poplawski
Modified: 2017-07-10 17:45 UTC (History)
8 users (show)

(edit)
Clone Of:
(edit)
Last Closed: 2017-06-25 16:19:52 UTC


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Bugzilla 1461656 None None None Never
Red Hat Bugzilla 1462373 None None None Never

Internal Trackers: 1461656 1462373

Description Orion Poplawski 2017-05-12 21:05:43 UTC
Description of problem:

I have a custom build environment that has relied on installing an /etc/profile.d file to configure the environment for the build:

# Load compiler
config_opts['files']['/etc/profile.d/zz-nwra.sh'] = """
export MODULEPATH=/opt/modulefiles/Core:$MODULEPATH
module load intel
"""

However, with the new systemd-nspawn chroot (which I otherwise like and think is a good idea, so I'd like to use it) this fails because we no longer get a login shell.  It is possible to get one back?  Perhaps by still running:

bash --login -c 'rpmbuild...'

Not sure why this was dropped with nspawn.

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

Comment 1 Orion Poplawski 2017-05-12 21:15:42 UTC
FWIW, dropping bash --login came with:

commit e6017d3ef9f4590c533c63241b2cf28974315b66
Author: Miroslav Suchý <msuchy@redhat.com>
Date:   Mon Oct 6 10:46:35 2014 +0200

    run systemd-nspawn container as specific user [RHBZ# 1132762]

Comment 2 Miroslav Suchý 2017-05-15 14:21:25 UTC
Patch from Orion merged as 
* 826c9d6 (HEAD -> devel, origin/devel) Use bash --login with systemd-nspawn as well (rhbz #1450516)

Comment 3 Fedora Update System 2017-06-19 07:12:51 UTC
mock-1.4.2-1.fc25 has been submitted as an update to Fedora 25. https://bodhi.fedoraproject.org/updates/FEDORA-2017-21b345dd60

Comment 4 Fedora Update System 2017-06-19 07:13:50 UTC
mock-1.4.2-1.fc26 has been submitted as an update to Fedora 26. https://bodhi.fedoraproject.org/updates/FEDORA-2017-3d88d9f8b5

Comment 5 Fedora Update System 2017-06-19 07:14:45 UTC
mock-1.4.2-1.el7 has been submitted as an update to Fedora EPEL 7. https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2017-65be829503

Comment 6 Fedora Update System 2017-06-19 14:52:58 UTC
mock-1.4.2-1.el7 has been pushed to the Fedora EPEL 7 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2017-65be829503

Comment 7 Fedora Update System 2017-06-19 15:52:30 UTC
mock-1.4.2-1.fc25 has been pushed to the Fedora 25 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2017-21b345dd60

Comment 8 Fedora Update System 2017-06-19 19:24:41 UTC
mock-1.4.2-1.fc26 has been pushed to the Fedora 26 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2017-3d88d9f8b5

Comment 9 Fedora Update System 2017-06-25 16:19:52 UTC
mock-1.4.2-1.fc26 has been pushed to the Fedora 26 stable repository. If problems still persist, please make note of it in this bug report.

Comment 10 Fedora Update System 2017-07-04 01:51:49 UTC
mock-1.4.2-1.fc25 has been pushed to the Fedora 25 stable repository. If problems still persist, please make note of it in this bug report.

Comment 11 Fedora Update System 2017-07-06 05:19:24 UTC
mock-1.4.2-1.el7 has been pushed to the Fedora EPEL 7 stable repository. If problems still persist, please make note of it in this bug report.

Comment 12 Jonathan Lebon 2017-07-10 17:28:36 UTC
This seems to have caused a regression in the way the spec file is passed:

https://ci.centos.org/view/Atomic/job/fahc-rdgo/5563/consoleFull

Excerpt:

# /usr/bin/systemd-nspawn -q -M b3832f72993346d9b18be4eb6313d2c0 -D /var/lib/mock/fedora-26-x86_64-mockchain-22882/root --private-network --setenv=LANG=en_GB.UTF-8 --setenv=TERM=vt100 --setenv=SHELL=/bin/bash --setenv=HOSTNAME=mock --setenv=PROMPT_COMMAND=printf "\033]0;<mock-chroot>\007" --setenv=HOME=/builddir --setenv=PATH=/usr/bin:/bin:/usr/sbin:/sbin --setenv=PS1=<mock-chroot> \s-\v\$  -u mockbuild bash --login -c /usr/bin/rpmbuild -bb --target x86_64 --nodeps --define __spec_check_template exit 0;  /builddir/build/SPECS/rpm-ostree.spec

...

16:40:00 error: failed to stat //exit: No such file or directory
16:40:00 Building target platforms: x86_64
16:40:00 Building for target x86_64
16:40:00 bash: /builddir/build/SPECS/rpm-ostree.spec: Permission denied

It looks like it needs another level of quoting to be passed correctly.

Comment 13 Jonathan Lebon 2017-07-10 17:45:40 UTC
Posted potential untested fix here: https://github.com/rpm-software-management/mock/pull/91


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