Results 1 to 5 of 5

Thread: mkdir: cannot create directory Permission denied

  1. #1

    Default mkdir: cannot create directory Permission denied

    Hello!

    I'm new to the build-service and have read many docs on the server, but I cannot solve this problem:

    My program compiles fine, but the make install fails:
    + exit 0
    Executing(%install): /bin/sh -e /var/tmp/rpm-tmp.31996
    + umask 022
    + cd /usr/src/packages/BUILD
    + cd ourDicom-0.0.20080919
    + make DESTDIR=/var/tmp/ourDicom-0.0.20080919-build install
    mkdir: cannot create directory `/usr/share/ourDicom/': Permission denied
    make: *** [install_target] Error 1
    error: Bad exit status from /var/tmp/rpm-tmp.31996 (%install)

    I defined in my .pro file there to install the files (the startscript ourDicom.sh in /usr/bin
    and the other in /urs/shar/ourDicom/

    I even defined the dir seperately in the spec-file but it doesn't help.

    Thanks for any help.

  2. #2
    ab@novell.com NNTP User

    Default Re: mkdir: cannot create directory Permission denied

    -----BEGIN PGP SIGNED MESSAGE-----
    Hash: SHA1

    Are you running as a user with rights to create a directory in
    /usr/share? That would most likely be the 'root' user only.
    'configure' and 'make' are just to build stuff, but 'make install'
    actually puts files in the filesystem typically and if those files go
    somewhere that root alone has access you need to do it as an
    appropriately-powerful user.

    Good luck.





    Vrenn wrote:
    > Hello!
    >
    > I'm new to the build-service and have read many docs on the server, but
    > I cannot solve this problem:
    >
    > My program compiles fine, but the make install fails:
    > + exit 0
    > Executing(%install): /bin/sh -e /var/tmp/rpm-tmp.31996
    > + umask 022
    > + cd /usr/src/packages/BUILD
    > + cd ourDicom-0.0.20080919
    > + make DESTDIR=/var/tmp/ourDicom-0.0.20080919-build install
    > mkdir: cannot create directory `/usr/share/ourDicom/': Permission
    > denied
    > make: *** [install_target] Error 1
    > error: Bad exit status from /var/tmp/rpm-tmp.31996 (%install)
    >
    > I defined in my .pro file there to install the files (the startscript
    > ourDicom.sh in /usr/bin
    > and the other in /urs/shar/ourDicom/
    >
    > I even defined the dir seperately in the spec-file but it doesn't
    > help.
    >
    > Thanks for any help.
    >
    >

    -----BEGIN PGP SIGNATURE-----
    Version: GnuPG v1.4.2 (GNU/Linux)
    Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

    iD8DBQFI1SXS3s42bA80+9kRAq84AJ9cJFBfksfj25YvYT7b0PJ4LHoXPgCcCzr9
    uq27NGMNarvJ/UZ2dHRXjBo=
    =qw4S
    -----END PGP SIGNATURE-----

  3. #3

    Default Re: mkdir: cannot create directory Permission denied

    That could be the point. But whow do I specify in the spec-file to run the command as a user in the VM of the buildfarm?
    (is there an open sudo-access?)

    And theres a second question:
    I wrote the spec-file for the dcmtk-package (the software was written by other authors)
    This dcmtk- make install creates /usr/share/data and that works!

  4. #4
    Join Date
    Jun 2008
    Location
    Scotland, UK
    Posts
    86

    Default Re: mkdir: cannot create directory Permission denied

    Your problem is that `make install` is not respecting DESTDIR. You have appropriately defined destdir, but then the install is not following that and trying to put files into /usr/share/ourDicom instead of $RPM_BUILD_ROOT/usr/share/ourDicom. You need to tweak your Makefiles (problem is not in the specfile!) to fix that.

    You SHOULD NOT run a build as root except in very exceptional circumstances. This is the perfect example why. If you had run this bugged build as root, instead of installing in a separate safe buildroot, as you would expect, the build system would have overwritten files in your running system. All specfiles should have #norootforbuild defined. The OBS is good for this because it automatically doe that.

  5. #5

    Default Re: mkdir: cannot create directory Permission denied

    Thank you at pointing at my real problem, the DESTDIR variable. I totally agree that I must not install out of the chroot, but when even using the DESTDIR as an path for the installation make install wanted to make a /usr/share/ourDicom.

    Thanks for your help I saw, that qmake (used to make the makefile) hardcoded the path in the makefile, not mentioning the DESTDIR anymore, so I hat to use DESTDIR=%buidroot qmake for it (and not DESTDIR=%buildroot make install).

    Thanks for the help!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •