[PATCH] Create missing directories for config_opts['files'] elements
by Paul Howarth
If I attempt to use:
config_opts['files']['some/file'] = ...
to create a file in a directory that's not already created as part of
the chroot "skeleton" in mock, it crashes out with a "No such file or
directory" error like this:
$ mock -r city-fan-fedora-11-x86_64 libssh2-1.2.5-2.0.cf.fc12.src.rpm
INFO: mock.py version 1.0.7 starting...
State Changed: init plugins
State Changed: start
INFO: Start(libssh2-1.2.5-2.0.cf.fc12.src.rpm)
Config(city-fan-fedora-11-x86_64)
State Changed: lock buildroot
State Changed: clean
State Changed: init
State Changed: lock buildroot
Mock Version: 1.0.7
INFO: Mock Version: 1.0.7
INFO: mounting tmpfs.
INFO: enabled root cache
INFO: enabled yum cache
State Changed: cleaning yum metadata
INFO: enabled ccache
INFO: unmounting tmpfs.
ERROR: Exception(libssh2-1.2.5-2.0.cf.fc12.src.rpm)
Config(city-fan-fedora-11-x86_64) 0 minutes 0 seconds
INFO: Results and/or logs in: /var/lib/mock/city-fan-fedora-11-x86_64/result
ERROR: [Errno 2] No such file or directory:
'/var/lib/mock/city-fan-fedora-11-x86_64/root/selinux/enforce'
Traceback (most recent call last):
File "/usr/sbin/mock", line 693, in <module>
main(retParams)
File "/usr/sbin/mock", line 635, in main
do_rebuild(config_opts, chroot, args)
File "<peak.util.decorators.rewrap wrapping __main__.do_rebuild at
0x01655230>", line 3, in do_rebuild
def do_rebuild(config_opts, chroot, srpms): return
__decorated(config_opts, chroot, srpms)
File "/usr/lib/python2.6/site-packages/mock/trace_decorator.py", line
70, in trace
result = func(*args, **kw)
File "/usr/sbin/mock", line 371, in do_rebuild
chroot.init()
File "<peak.util.decorators.rewrap wrapping mock.backend.init at
0x0164D9B0>", line 3, in init
def init(self): return __decorated(self)
File "/usr/lib/python2.6/site-packages/mock/trace_decorator.py", line
70, in trace
result = func(*args, **kw)
File "/usr/lib/python2.6/site-packages/mock/backend.py", line 163, in
init
self._init()
File "<peak.util.decorators.rewrap wrapping mock.backend._init at
0x0164DDE8>", line 3, in _init
def _init(self): return __decorated(self)
File "/usr/lib/python2.6/site-packages/mock/trace_decorator.py", line
70, in trace
result = func(*args, **kw)
File "/usr/lib/python2.6/site-packages/mock/backend.py", line 270, in
_init
fo = open(p, 'w+')
IOError: [Errno 2] No such file or directory:
'/var/lib/mock/city-fan-fedora-11-x86_64/root/selinux/enforce'
This is because mock doesn't create any missing parent directories for
the file. The attached patch addresses this.
Incidentally, what I was doing was:
config_opts['files']['selinux/enforce'] = "0"
This is sufficient to fool libselinux-using applications in the chroot
into believing they're running in permissive mode, allowing for instance
an OpenSSH server to run on localhost on a high port and accept
connections as part of a package's test suite (libssh2 in this case).
This might be a useful thing to have by default, but that's a different
discussion.
Paul.
13 years, 10 months
Koji special permissions for --runas
by Greg Trahair
Hi,
I'm trying to use the --runas parameter and get the following error:
AuthError: /C=blah/ST=blah/O=blah/OU=blah/CN=<user>/emailAddress=blah is
not authorized to login other users
The user that I'm trying to submit the build from is kojiadmin (with
admin permissions).
The reason that I'd like this, is that I want to use a post-commit
trigger to submit a build using the kojiadmin user, but still submitting
the build as the user that committed the change to SVN.
In auth.py:364 I see some mention of a proxyuser, but I don't know how
to use it.
Can anyone help?
Regards,
Greg
13 years, 11 months
useradd -N/-n bit me, Fedora hosted koji
by Michael Cronenworth
I have been able to build RHEL packages with koji hosted on a Fedora 11
box until today.
root.log
DEBUG util.py:280: Executing command: /usr/sbin/useradd -o -m -u 495 -g
491 -d /builddir -N mockbuild
DEBUG util.py:256: /usr/sbin/useradd: invalid option -- N
DEBUG util.py:319: Child returncode was: 2
DEBUG util.py:98: kill orphans
The only thing that changed was the syncing of RHEL 5.5 packages this
morning so I guess that did it.
mock-1.0.5-1.fc11.noarch
koji-1.3.2-1.fc11.noarch
Since it is my understanding kojid builds a mock config on the fly,
there isn't a way to tell koji/mock to use the correct mock config is there?
13 years, 11 months
Mock: Permission denied
by Eric Zhong
What's wrong?
=========================================================
[eric@wenjia ~]$ ll -d /var/lib/mock/dist-foo-build-42-21/root/builddir/
drwx------ 2 torrent mock 4096 03-29 11:08
/var/lib/mock/dist-foo-build-42-21/root/builddir/
=========================================================
[root.log]
......
DEBUG util.py:60: creating dir:
/var/lib/mock/dist-foo-build-42-21/root/builddir/build/RPMS
ERROR util.py:63: Could not create dir
/var/lib/mock/dist-foo-build-42-21/root/builddir/build/RPMS. Error:
[Errno 13] Permission denied:
'/var/lib/mock/dist-foo-build-42-21/root/builddir/build'
Traceback (most recent call last):
File "/usr/lib/python2.6/site-packages/mock/util.py", line 61, in
mkdirIfAbsent
os.makedirs(dirName)
File "/usr/lib/python2.6/os.py", line 150, in makedirs
makedirs(head, mode)
File "/usr/lib/python2.6/os.py", line 157, in makedirs
mkdir(name, mode)
OSError: [Errno 13] Permission denied:
'/var/lib/mock/dist-foo-build-42-21/root/builddir/build'
DEBUG util.py:98: kill orphans
13 years, 11 months