Mock: Permission denied

Paul Howarth paul at city-fan.org
Wed Mar 31 09:12:06 UTC 2010


On 31/03/10 09:57, Eric Zhong wrote:
> HELP!!!
>
> I get this error again !
> I reinstall OS, and build four srpms success.
> when build fifth srpm, i get Error, and after that , all build get  Error!
> What happed ?
>
> SElinux -> Permissive
> space is enough ( more than 20G)
> the /etc/passwd and /etc/group not changed ! I backup them after
> reinstlal OS!
>
> ==============================
>
> Result
>
> BuildError: error building package (arch i386), mock exited with status 1; see build.log for more informatio
>
> ==============================
>
> DEBUG util.py:78:  remove tree: /var/lib/mock/dist-foo-build-18-13/root/builddir
> DEBUG util.py:280:  Executing command: ['/usr/sbin/userdel','-r','mockbuild']
>
> DEBUG util.py:256:  userdel:删除目录 /builddir 时出错
> DEBUG util.py:319:  Child returncode was: 12
> DEBUG util.py:280:  Executing command: ['/usr/sbin/groupdel','mockbuild']
> DEBUG util.py:256:  groupdel:mockbuild 组不存在
>
> DEBUG util.py:319:  Child returncode was: 6
> DEBUG util.py:280:  Executing command: ['/usr/sbin/groupadd','-g','491','mockbuild']
> DEBUG util.py:319:  Child returncode was: 0
> DEBUG util.py:280:  Executing command: /usr/sbin/useradd -m -u 494 -g 491 -d /builddir -n mockbuild
>
> DEBUG util.py:319:  Child returncode was: 0
> DEBUG util.py:280:  Executing command: ['perl','-p','-i','-e','s/^(mockbuild:)!!/$1/;','/etc/passwd']
> DEBUG util.py:319:  Child returncode was: 0
>
> DEBUG util.py:280:  Executing command: ['/bin/cp','-v','/usr/share/zoneinfo/Asia/Shanghai','/etc/localtime']
> DEBUG util.py:256:  “/usr/share/zoneinfo/Asia/Shanghai” ->  “/etc/localtime”
>
> DEBUG util.py:319:  Child returncode was: 0
> DEBUG util.py:57:  ensuring that dir exists: /var/lib/mock/dist-foo-build-18-13/root/builddir/build/RPMS
> DEBUG util.py:60:  creating dir: /var/lib/mock/dist-foo-build-18-13/root/builddir/build/RPMS
>
> ERROR util.py:63:  Could not create dir /var/lib/mock/dist-foo-build-18-13/root/builddir/build/RPMS. Error: [Errno 13] Permission denied:'/var/lib/mock/dist-foo-build-18-13/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-18-13/root/builddir/build'
> DEBUG util.py:98:  kill orphans
>
>
> ==============================
> [eric at wenjia etc]$ ll -d /var/lib/mock/dist-foo-build-
> 18-13/root/builddir
> drwx------. 2 torrent mock 4096 03-31 16:20
> /var/lib/mock/dist-foo-build-18-13/root/builddir
>
> [eric at wenjia build-01]$ cat /etc/passwd | grep koji
> kojibuilder:x:494:490::/builddir:/bin/bash
>
> [eric at wenjia build-01]$ cat /etc/group | grep koji
> mock:x:491:kojibuilder,eric
> kojibuilder:x:490:
>
> [eric at wenjia build-01]$ cat /etc/passwd | grep torrent
> torrent:x:495:492:BitTorrent Seed/Tracker:/var/lib/bittorrent:/sbin/nologin

The /var/lib/mock/dist-foo-build-18-13 directory may be a hangover from 
when things were broken previously. It shouldn't be owned by user "torrent".

I'd do an "ls -l /var/lib/mock" and move any directories owned by user 
"torrent" somewhere else, then try again. If everything then works OK, 
delete the moved directories (mock should re-create these directories as 
needed).

Paul.


More information about the buildsys mailing list