Bonsoir,
j'essaye de monter un environnement de build avec mock et j'ai quelques soucis de droits :
mon user est build du group mock :
uid=1088(build) gid=1018(mock) groupes=1018(mock)
Mon arborescence de chroot :
ls -la /data/mock/
total 16
drwxr-xr-x  4 build mock 4096 31 août  18:56 .
drwxr-xr-x. 7 root  root 4096 31 août  18:55 ..
drwxr-xr-x  3 build mock 4096 31 août  20:51 base
drwxr-xr-x  3 build mock 4096 31 août  19:08 cache
[build@osc-kb ~]$ mock --init -v -r fedora-15-x86_64
Vous essayez d'exécuter « mock » qui nécessite des privilèges du super-utilisateur. Des informations supplémentaires sont requises pour cette opération.
Authentification en tant que « root »
Mot de passe : 
INFO: mock.py version 1.1.12 starting...
State Changed: init plugins
DEBUG: ensuring that dir exists: /data/mock/cache//fedora-15-x86_64/yum_cache/
INFO: selinux disabled
State Changed: start
DEBUG: mock final configuration:
DEBUG:     scm:  False
DEBUG:     resultdir:  %(basedir)s/%(root)s/result
DEBUG:     legal_host_arches:  ('x86_64',)
DEBUG:     dist:  fc15
DEBUG:     internal_setarch:  True
DEBUG:     scm_opts:  {'write_tar': False, 'svn_get': 'svn co file:///srv/svn/SCM_PKG/SCM_BRN SCM_PKG', 'method': 'git', 'git_get': 'git clone SCM_BRN git://localhost/SCM_PKG.git SCM_PKG', 'cvs_get': 'cvs -d /srv/cvs co SCM_BRN SCM_PKG', 'ext_src_dir': '/dev/null', 'spec': 'SCM_PKG.spec'}
DEBUG:     use_host_resolv:  True
DEBUG:     more_buildreqs:  {}
DEBUG:     createrepo_command:  /usr/bin/createrepo -d -q -x *.src.rpm
DEBUG:     yum.conf:  
[main]
cachedir=/var/cache/yum
debuglevel=1
reposdir=/dev/null
logfile=/var/log/yum.log
retries=20
obsoletes=1
gpgcheck=0
assumeyes=1
syslog_ident=mock
syslog_device=
# grub/syslinux on x86_64 need glibc-devel.i386 which pulls in glibc.i386, need to exclude all
# .i?86 packages except these.
#exclude=[0-9A-Za-fh-z]*.i?86 g[0-9A-Za-km-z]*.i?86 gl[0-9A-Za-hj-z]*.i?86 gli[0-9A-Zac-z]*.i?86 glib[0-9A-Za-bd-z]*.i?86
# The above is not needed anymore with yum multilib policy of "best" which is the default in Fedora.

# repos

[fedora]
name=fedora
mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=fedora-15&arch=x86_64
failovermethod=priority

[updates-released]
name=updates
mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=updates-released-f15&arch=x86_64
failovermethod=priority

[local]
name=local
baseurl=http://kojipkgs.fedoraproject.org/repos/dist-f15-build/latest/x86_64/
cost=2000
enabled=0

DEBUG:     cleanup_on_failure:  False
DEBUG:     plugins:  ['tmpfs', 'root_cache', 'yum_cache', 'bind_mount', 'ccache', 'selinux']
DEBUG:     chrootuid:  1088
DEBUG:     root_log_fmt_str:  %(levelname)s %(filename)s:%(lineno)d:  %(message)s
DEBUG:     state_log_fmt_str:  %(asctime)s - %(message)s
DEBUG:     chroothome:  /builddir
DEBUG:     basedir:  /data/mock/base/
DEBUG:     internal_dev_setup:  True
DEBUG:     macros:  {'%_rpmfilename': '%%{NAME}-%%{VERSION}-%%{RELEASE}.%%{ARCH}.rpm', '%_topdir': '/builddir/build'}
DEBUG:     version:  1.1.12
DEBUG:     online:  True
DEBUG:     build_log_fmt_name:  unadorned
DEBUG:     chrootgid:  493
DEBUG:     files:  {}
DEBUG:     rpmbuild_arch:  x86_64
DEBUG:     log_config_file:  logging.ini
DEBUG:     rpmbuild_timeout:  0
DEBUG:     cleanup_on_success:  False
DEBUG:     chroot_setup_cmd:  groupinstall buildsys-build
DEBUG:     useradd:  /usr/sbin/useradd -o -m -u %(uid)s -g %(gid)s -d %(home)s -n %(user)s
DEBUG:     root_log_fmt_name:  detailed
DEBUG:     chroot_name:  fedora-15-x86_64
DEBUG:     plugin_conf:  {'yum_cache_opts': {'max_metadata_age_days': 30, 'root': 'fedora-15-x86_64', 'basedir': '/data/mock/base/fedora-15-x86_64', 'cachedir': '/data/mock/cache/fedora-15-x86_64', 'online': True, 'cache_topdir': '/data/mock/cache/', 'max_age_days': 30, 'dir': '%(cache_topdir)s/%(root)s/yum_cache/'}, 'bind_mount_opts': {'dirs': [], 'basedir': '/data/mock/base/fedora-15-x86_64', 'root': 'fedora-15-x86_64', 'cachedir': '/data/mock/cache/fedora-15-x86_64', 'cache_topdir': '/data/mock/cache/'}, 'root_cache_enable': True, 'selinux_opts': {'basedir': '/data/mock/base/fedora-15-x86_64', 'root': 'fedora-15-x86_64', 'cachedir': '/data/mock/cache/fedora-15-x86_64', 'cache_topdir': '/data/mock/cache/'}, 'ccache_opts': {'basedir': '/data/mock/base/fedora-15-x86_64', 'max_cache_size': '4G', 'cachedir': '/data/mock/cache/fedora-15-x86_64', 'cache_topdir': '/data/mock/cache/', 'root': 'fedora-15-x86_64', 'dir': '%(cache_topdir)s/%(root)s/ccache/'}, 'bind_mount_enable': True, 'selinux_enable': True, 'yum_cache_enable': True, 'tmpfs_enable': False, 'tmpfs_opts': {'basedir': '/data/mock/base/fedora-15-x86_64', 'required_ram_mb': 900, 'cache_topdir': '/data/mock/cache/', 'cachedir': '/data/mock/cache/fedora-15-x86_64', 'max_fs_size': None, 'root': 'fedora-15-x86_64'}, 'ccache_enable': True, 'root_cache_opts': {'compress_program': 'pigz', 'extension': '.gz', 'root': 'fedora-15-x86_64', 'basedir': '/data/mock/base/fedora-15-x86_64', 'cachedir': '/data/mock/cache/fedora-15-x86_64', 'cache_topdir': '/data/mock/cache/', 'max_age_days': 15, 'dir': '%(cache_topdir)s/%(root)s/root_cache/'}}
DEBUG:     config_paths:  ['/etc/mock/site-defaults.cfg', '/etc/mock/fedora-15-x86_64.cfg']
DEBUG:     build_log_fmt_str:  %(message)s
DEBUG:     state_log_fmt_name:  state
DEBUG:     plugin_dir:  /usr/lib/python2.6/site-packages/mock/plugins
DEBUG:     clean:  True
DEBUG:     createrepo_on_rpms:  False
DEBUG:     cache_topdir:  /data/mock/cache/
DEBUG:     root:  fedora-15-x86_64
DEBUG:     target_arch:  x86_64
DEBUG: Unsharing. Flags: 131072
State Changed: lock buildroot
State Changed: clean
DEBUG: kill orphans
DEBUG: remove tree: /data/mock/base/fedora-15-x86_64.tmp
INFO: chroot (/data/mock/base/fedora-15-x86_64) unlocked and deleted
State Changed: unlock buildroot
State Changed: init
DEBUG: ensuring that dir exists: /data/mock/base/fedora-15-x86_64
DEBUG: creating dir: /data/mock/base/fedora-15-x86_64
DEBUG: ensuring that dir exists: /data/mock/base/fedora-15-x86_64/root/
DEBUG: creating dir: /data/mock/base/fedora-15-x86_64/root/
DEBUG: ensuring that dir exists: /data/mock/base//fedora-15-x86_64/result
DEBUG: creating dir: /data/mock/base//fedora-15-x86_64/result
ERROR: Could not create dir /data/mock/base//fedora-15-x86_64/result. Error: [Errno 13] Permission denied: '/data/mock/base//fedora-15-x86_64/result'
Traceback (most recent call last):
  File "/usr/lib/python2.6/site-packages/mock/util.py", line 61, in mkdirIfAbsent
    os.makedirs(dirName)
  File "/usr/lib64/python2.6/os.py", line 157, in makedirs
    mkdir(name, mode)
OSError: [Errno 13] Permission denied: '/data/mock/base//fedora-15-x86_64/result'
ERROR: Could not create dir /data/mock/base//fedora-15-x86_64/result. Error: [Errno 13] Permission denied: '/data/mock/base//fedora-15-x86_64/result'
DEBUG: kill orphans
A juste titre, le répertoire créé /data/mock/base/fedora-15-x86_64/root/ est drwxrwxr-x 2 root root

Merci

EDIT : mode bidouille : ça fonctionne en ajoutant mock au groupe root 🙁
ll -d /data/mock? il faut que le repertoire soit sgid (chmod g+s /data/mock). il y a peut être d'autres joyeuseries dans le genre.
Cool , en ajoutant -R, c'est OK.

Merci 😉