Bug #5492
closedscripts installing into /usr/usr/sbin (with --prefix=/usr)
0%
Description
At least in some cases, scripts (ceph-disk*, ceph-create-keys) installing into /usr/usr/sbin. This happened while "ceph_sbindir = $(prefix)$(sbindir)" in src/Makefile.am and "./configure --prefix=/usr ..." (Gentoo's default configure call). I don't dig too deep, but IMHO it can be result of "prefix=" & "exec_prefix=" disorder. Fixed for me by "ceph_sbindir = $(sbindir)" (I don't try other configure behaviors, but looks universal).
I use and suggest attached patch.
Files
Updated by Sage Weil almost 11 years ago
- Status changed from New to Fix Under Review
Updated by Sage Weil almost 11 years ago
- Status changed from Fix Under Review to Resolved
Updated by Sage Weil almost 11 years ago
- Status changed from Resolved to 12
the proposed fix breaks the deb builds
Updated by Anonymous almost 11 years ago
- Status changed from 12 to In Progress
- Assignee changed from Danny Al-Gaaf to Anonymous
This fix was temporarily reverted. The ceph build process for debian packages relies on binaries being found in /usr/sbin and the fix results in them being placed in /sbin.
It does not look like GNU autotools provides a clean way to put packages into /usr/sbin with the standard variables (--prefix, ...). The replacement fix will probably need to roll out with a corresponding change to debian packaging.
Updated by Danny Al-Gaaf almost 11 years ago
See my comment at git pull request #389: "... this patch will cause trouble on e.g. SUSE and also Debian. The files get now installed into /sbin and no longer into /usr/sbin as e.g. currently on RPM based SUSE/Fedora and also Debian. I assume the correct fix would be to use $(exec_prefix)$(sbindir) if the files should end in /usr/sbin."
I would open an new pull request for testing.
Updated by Anonymous almost 11 years ago
- Status changed from In Progress to Resolved
Thanks Danny. I tested $(exec_prefix)$(sbindir) on rpm and debian builds and it looks like does the right thing.
Updated by Yixun Lan over 10 years ago
Gary Lowell wrote:
Thanks Danny. I tested $(exec_prefix)$(sbindir) on rpm and debian builds and it looks like does the right thing.
I have problem with this fix (using "$(exec_prefix)$(sbindir)"),
attached file is snip of src/Makefile.
given the following order:
exec_prefix = ${prefix}
sbindir = ${exec_prefix}/sbin
ceph_sbindir = $(exec_prefix)$(sbindir)
final ceph_sbindir = ${prefix}/${prefix}/$(sbindir)
given prefix=/usr then ceph_sbindir = /usr/usr/sbin
also I can reproduce the problem with latest git code (branch: master, commit: 067d5756a8b17af16ce73a487698471c079a2fb6)
with following commmand : ./do_autogen.sh && ./configure --prefix=/usr
hi, Dany, could you tell me what's exactly those varialbes in debian, SUSE/Fedora?
(exec_prefix, sbindir, ceph_sbindir), you can check src/Makefile
Updated by Alan Somers over 10 years ago
- File patch-src-Makefile.am patch-src-Makefile.am added
- File patch-debian.rules patch-debian.rules added
Danny's fix does not resolve the original problem in either Ubuntu 12.04 or FreeBSD 9.1. I think that the real problem is in debian/rules. --sbindir=/sbin directs ceph-disk and friends to be installed in /sbin instead of $PREFIX/sbin. That's done so that mkcephfs and mount.ceph will be under /sbin instead of /usr/sbin. It seems that the problem is that autotools doesn't offer a clean way to put some programs in /sbin and others in /usr/sbin. With the attached patch, people can build ceph directly from sources and get the expected file layout. The debian build should also work, though I haven't tried it yet. FreeBSD users can get their expected file layout by adding an extra variable at the "make install" stage:
MAKE_FLAGS+= su_sbindir=${PREFIX}/sbin
The commit that added --sbindir
https://github.com/ceph/ceph/commit/38f96c658dee3e7e26a68a3c57eec2a5d8758e17
configure-stamp:
dh_testdir
./autogen.sh
./configure --prefix=/usr --sbindir=/sbin --localstatedir=/var \
--sysconfdir=/etc $(extraopts) $(confflags) \
$(CEPH_EXTRA_CONFIGURE_ARGS)
touch $@