[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

First-time mock user



I'm trying to use mock for the first time in order to do a package
review.  I've hit a few snags that I thought I should point out on
this list.  Let me know what I can do to help resolve them.

First, the SHOULD item on this page:
  http://fedoraproject.org/wiki/Packaging/ReviewGuidelines
that refers to mock should probably link to this page:
  http://fedoraproject.org/wiki/PackageMaintainers/MockTricks
I have edit rights on the wiki, so if nobody objects I can make that
change.  As it was, I had to hunt for information on how to use mock.

So I read the MockTricks page and the mock man page.  MockTricks tells
me to use '-r <config>' to select a config file.  The mock man page
says that if you don't select one, you get whatever
/etc/mock/default.cfg links to.  That's great, except that there is no
such link as /etc/mock/default.cfg after installing mock.  Should
there be?  If not, the text on the MockTricks page should perhaps be
expanded a bit to note this and explain why not.

Next I created the "build" user as described on the MockTricks page.
Then I did "su - build", just like it says to do.  It wants a
password.  The null password doesn't work.  My password doesn't work.
Fortunately, I am root on my box, so I can "su -" and then "su -
build", but what is supposed to work here?

I also noted that MockTricks says to do "mock rebuild <SRPM>", but the
mock man page says that usage is deprecated.  It's supposed to be
"mock --rebuild <SRPM>" now.

So I kicked off the mock build ... and setroubleshoot pops up to tell
me about AVC denials.  These are NOT the SELinux problems described on
the MockTricks page.  I got the following:

1) /usr/sbin/groupadd (groupadd_t) cannot "write" to /dev/null (var_lib_t).
2) /usr/sbin/groupadd (groupadd_t) cannot "ioctl" to /dev/null (var_lib_t).
3) /usr/sbin/useradd (useradd_t) cannot "ioctl" to /dev/null (var_lib_t).
4) /usr/sbin/useradd (useradd_t) cannot "read write" to (var_log_t).
5) /usr/sbin/useradd (useradd_t) cannot "write" to /dev/null (var_lib_t).

I just updated to selinux-policy-3.0.8-58.fc8 shortly before
installing and running mock.  Are these failures expected?  If so,
MockTricks should warn me about them.  If not, against what do I file
a bug?

So the mock build failed.  I expected that, since I was pretty sure I
had identified a missing BuildRequires.  I went to the log files to
verify that my guess was right, and found that build.log is empty.
OK, so I'll try root.log.  No sign of a missing BuildRequires there;
but I do see some scary looking stuff:

2007-11-30 12:35:46,634 - DEBUG util.py, Line: 234:  tar:
./usr/lib/locale/locale-archive: file changed as we read it
2007-11-30 12:35:46,638 - DEBUG trace_decorator.py, Line: 27:
EXCEPTION: Command(tar czf
/var/lib/mock/cache/fedora-8-x86_64/root_cache/cache.tar.gz -C
/var/lib/mock/fedora-8-x86_64/root .) failed. See logs for output.
Traceback (most recent call last):
  File "/usr/lib/python2.5/site-packages/mock/trace_decorator.py",
line 24, in trace
    result = f(*args, **kw)
  File "/usr/lib/python2.5/site-packages/mock/util.py", line 260, in do
    raise mock.exception.Error, "Command(%s) failed. See logs for
output." % command
Error: Command(tar czf
/var/lib/mock/cache/fedora-8-x86_64/root_cache/cache.tar.gz -C
/var/lib/mock/fedora-8-x86_64/root .) failed. See logs for output.
2007-11-30 12:35:46,648 - DEBUG trace_decorator.py, Line: 30:  LEAVE
do --> EXCEPTION RAISED

[repeats several times with the word after "LEAVE" changing each time]

When I try that tar command myself, I get this:

[build localhost ~]$ tar czf
/var/lib/mock/cache/fedora-8-x86_64/root_cache/cache.tar.gz -C
/var/lib/mock/fedora-8-x86_64/root .
tar: ./root: Cannot open: Permission denied
tar: ./sbin/unix_update: Cannot open: Permission denied
tar: ./lib64/dbus-1/dbus-daemon-launch-helper: Cannot open: Permission denied
tar: ./usr/sbin/groupmod: Cannot open: Permission denied
tar: ./usr/sbin/groupdel: Cannot open: Permission denied
tar: ./usr/sbin/userdel: Cannot open: Permission denied
tar: ./usr/sbin/groupadd: Cannot open: Permission denied
tar: ./usr/sbin/tzdata-update: Cannot open: Permission denied
tar: ./usr/sbin/groupmems: Cannot open: Permission denied
tar: ./usr/sbin/build-locale-archive: Cannot open: Permission denied
tar: ./usr/sbin/usermod: Cannot open: Permission denied
tar: ./usr/sbin/useradd: Cannot open: Permission denied
tar: ./usr/sbin/glibc_post_upgrade.x86_64: Cannot open: Permission denied
tar: ./usr/libexec/pt_chown: Cannot open: Permission denied
tar: ./usr/bin/chfn: Cannot open: Permission denied
tar: ./usr/bin/chsh: Cannot open: Permission denied
tar: ./etc/securetty: Cannot open: Permission denied
tar: ./etc/.pwd.lock: Cannot open: Permission denied
tar: ./etc/security/opasswd: Cannot open: Permission denied
tar: ./etc/group-: Cannot open: Permission denied
tar: ./etc/libaudit.conf: Cannot open: Permission denied
tar: ./etc/default/useradd: Cannot open: Permission denied
tar: ./etc/passwd-: Cannot open: Permission denied
tar: ./var/log/maillog: Cannot open: Permission denied
tar: ./var/log/secure: Cannot open: Permission denied
tar: ./var/log/tallylog: Cannot open: Permission denied
tar: ./var/log/btmp: Cannot open: Permission denied
tar: ./var/log/spooler: Cannot open: Permission denied
tar: ./var/log/faillog: Cannot open: Permission denied
tar: ./var/log/messages: Cannot open: Permission denied
tar: ./var/cache/ldconfig: Cannot open: Permission denied
tar: ./var/spool/mail/vcsa: Cannot open: Permission denied
tar: ./var/spool/mail/dbus: Cannot open: Permission denied
tar: ./var/spool/mail/rpm: Cannot open: Permission denied
tar: Error exit delayed from previous errors

Sure enough, the root directory has 0750 permissions and is owned by
root:root, so my build:mock user cannot read it.  Likewise with the
other directories on that list.  How is this supposed to work?

I hope we can work together to make this less confusing and
frustrating for the next mock newbie.  Regards,
-- 
Jerry James
http://loganjerry.googlepages.com/


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]