Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

make fails after sudo make install #13

Closed
rvernica opened this Issue Apr 14, 2015 · 2 comments

Comments

Projects
None yet
3 participants
Contributor

rvernica commented Apr 14, 2015

When compiling version 3.10.3 from source, after running sudo make install, running make fails due to Permission denied. Here are the steps to reproduce:

$ wget ftp://ftp.pcp.io/projects/pcp/download/pcp-3.10.3.src.tar.gz
...
$ ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var
$ make
$ sudo make install
$ make
...
=== pmieconf ===
gcc -fPIC -fno-strict-aliasing -D_GNU_SOURCE -fstack-protector-all -D_FORTIFY_SOURCE=2 -I../../src/pmie/src -Wall -O2 -g -DPCP_DEBUG -DPCP_VERSION=\"3.10.3\" -I../../src/include -I../../src/include/pcp -o pmieconf  -Wall -L../../src/libpcp/src -L../../src/libpcp_pmda/src   pmieconf.o rules.o io.o     -lpcp  
rm: cannot remove `rules/cpu/load_average': Permission denied
rm: cannot remove `rules/cpu/system': Permission denied
rm: cannot remove `rules/cpu/util': Permission denied
rm: cannot remove `rules/cpu/context_switch': Permission denied
rm: cannot remove `rules/cpu/low_util': Permission denied
rm: cannot remove `rules/global/parameters': Permission denied
rm: cannot remove `rules/global/pcp_actions': Permission denied
rm: cannot remove `rules/pernetif/packets': Permission denied
rm: cannot remove `rules/pernetif/errors': Permission denied
rm: cannot remove `rules/pernetif/util': Permission denied
rm: cannot remove `rules/pernetif/collisions': Permission denied
rm: cannot remove `rules/memory/swap_low': Permission denied
rm: cannot remove `rules/memory/exhausted': Permission denied
rm: cannot remove `rules/filesys/filling': Permission denied
rm: cannot remove `rules/percpu/some_util': Permission denied
rm: cannot remove `rules/percpu/many_util': Permission denied
rm: cannot remove `rules/percpu/system': Permission denied
mkdir: cannot create directory `rules': File exists
make[2]: *** [local] Error 1
make[1]: *** [default_pcp] Error 2
make[1]: Leaving directory `/home/debian/pcp-3.10.3/src'
make: *** [default_pcp] Error 2

I would guess the permissions need to be reset after sudo make install runs.

Contributor

kmcdonell commented Apr 14, 2015

I would strongly recommend NOT trying any recipe based on
$ sudo make install
or variants thereof.

PCP has well defined and well tested packaging support for lots of
distributions, and the preferred recipe uses Makepkgs and is described
in the INSTALL file, from which I've extracted the following relevant
snippet:

== B. Building from source

  1. Preliminaries

    The PCP code base is targeted for many different operating
    systems and many different combinations of related packages,
    so a little planning is needed before launching into a build
    from source.

    Package dependencies come in several flavours:

    (a) hard build dependencies - without these PCP cannot be
    build from source, and the build will fail in various
    ways at the compilation or packaging stages, e.g. gmake,
    autoconf, flex, bison, ...;

    (b) optional build dependences - if these components are not
    installed the build will work, but the resultant packages
    may be missing some features or entire applications, e.g.
    extended authentication, secure connections, service
    discovery, pmwebd, ...;

    (c) QA dependencies - you can ignore these unless you want to
    run the (extensive) PCP QA suite.

    It is strongly recommended that you run the script:
    $ qa/admin/check-vm
    and review the output before commencing a build.

  2. Configure, build and install the package

    The pcp package uses autoconf/configure and expects a GNU build
    environment (your platform must at least have gmake).

    If you just want to spin a .RPM, .DEB, .DMG, .EXE and/or tar
    file, use the Makepkgs script in the top level directory.
    This will configure and build the package for your platform and
    leave binary and src packages in the build/ directory.
    It will also leave binary and source tar file in the build/tar
    directory.

    $ ./Makepkgs --verbose
    

--- 8< --- end snip

This will fix the permissions issue (pollution of the source tree after
a make install run as root), and the pcp:pcp user:group issue in #12.

Contributor

natoscott commented May 13, 2015

As per Kens comments, use Makepkgs. FWIW, the original bug report here has a final "make" after doing the "sudo make install" which wasn't needed (and is the source of the make that failed with EPERM).

@natoscott natoscott closed this May 13, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment