Project

General

Profile

Actions

Bug #5492

closed

scripts installing into /usr/usr/sbin (with --prefix=/usr)

Added by Denis kaganovich almost 11 years ago. Updated over 10 years ago.

Status:
Resolved
Priority:
High
Assignee:
-
Category:
-
Target version:
-
% Done:

0%

Source:
other
Tags:
Backport:
Regression:
Severity:
3 - minor
Reviewed:
Affected Versions:
ceph-qa-suite:
Pull request ID:
Crash signature (v1):
Crash signature (v2):

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

ceph_sbindir.patch (375 Bytes) ceph_sbindir.patch Denis kaganovich, 07/02/2013 08:53 AM
Makefile (7.4 KB) Makefile Yixun Lan, 08/16/2013 12:29 AM
patch-src-Makefile.am (744 Bytes) patch-src-Makefile.am Alan Somers, 09/13/2013 11:39 AM
patch-debian.rules (387 Bytes) patch-debian.rules Alan Somers, 09/13/2013 11:39 AM
Actions #1

Updated by Ian Colle almost 11 years ago

  • Priority changed from Normal to Urgent
Actions #2

Updated by Sage Weil almost 11 years ago

  • Status changed from New to Fix Under Review
Actions #3

Updated by Sage Weil almost 11 years ago

  • Assignee set to Danny Al-Gaaf
Actions #4

Updated by Sage Weil almost 11 years ago

  • Status changed from Fix Under Review to Resolved
Actions #5

Updated by Sage Weil almost 11 years ago

  • Status changed from Resolved to 12

the proposed fix breaks the deb builds

Actions #6

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.

Actions #7

Updated by Sage Weil almost 11 years ago

  • Priority changed from Urgent to High
Actions #8

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.

Actions #9

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.

Actions #10

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

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 $@

Actions

Also available in: Atom PDF