[DRBD-user] compiling 8.3.6, sane configure defaults

Florian Haas florian.haas at linbit.com
Fri Nov 20 08:25:01 CET 2009


On 11/19/2009 03:53 PM, Eelco Jepkema wrote:
> Hi,
> 
> With 8.3.5 source tarball I could just do 'make; make install' and
> everything would be fine. I would get sane defaults, files in expected
> locations (config in /etc, libs in /usr/lib/drbd, man pages in
> /usr/share/man, local state in /var/lib/drbd etc.).

Except that few if any of these defaults were FHS compliant, not to
mention that they weren't configurable.

> With 8.3.6 however you'll need to run the configure script. Doing this
> it's really hard to get the defaults of before back and just running
> './configure' will forget or not create certain directories.

"Certain directories" isn't helping much here. Be specific. Which ones?

> Attached is the output for just running ./configure without any options
> and the config.log that belongs to that.

Both of which look fine.

> I am running Debian Lenny and I don't have enough of an idea how other
> distributions handle installations and the location of certain files so
> I can only speak for myself and my own experience when talking about
> expecting files at a certain location. Please keep that in mind if you
> read through my comments.
> 
> 
> It seems to me that some default install actions in Makefile.in and
> consequently Makefile are wrong. The ones i can find that actually break
> things are:
> 
> running 'make -C user install':
> mkdir -p //usr/local/var/lib/drbd

#1, you're not supposed to do that. Using "make -C user install"
installs only the userland binaries which is perfectly fine if you build
an appliance and you know exactly how your home-rolled management
utilities will manage DRBD, but most users will also want the
integration scripts found in scripts/, so you should simply run "make
install" from the top of the extracted tarball. Or, actually "sudo make
install" as it's generally a good idea to not build as root.

#2, that mkdir is fine as it uses a correct default localstatedir path.

> So this creates the directory /usr/local/var/lib/drbd, but the directory
> /var/lib/drbd is mentioned specifically here:
> drbd-8.3.6# grep -r 'var/lib/drbd' *
> drbd/Makefile:# install -d $(DESTDIR)/var/lib/drbd

That's a comment.

> Binary file user/drbdmeta matches
> Binary file user/drbdadm matches
> Binary file user/drbdadm_usage_cnt.o matches
> user/drbdadm_main.c:    /* if set, use the "cache" in /var/lib/drbd to
> figure out

Comment.

> user/drbdadm_minor_table.c:#define MINOR_TABLE_DIR "/var/lib/drbd/"

Thanks, that should be an easy fix.

> Binary file user/drbdadm_minor_table.o matches
> Binary file user/drbdmeta.o matches
> user/drbdadm_usage_cnt.c:#define DRBD_LIB_DIR "/var/lib/drbd"

This too.

> user/drbdmeta.c: * /var/lib/drbd/md-toc plain file, and some magic block
> on every device
> user/drbdmeta.c:    if (asprintf(&e, "/var/lib/drbd/drbd%lu", minor) <=
> 18) {

And this should probably use a #define too.

> And the make install doesn't create that directory.
> 
> 
> running 'make -C scripts install':
> mkdir -p //usr/local/lib/ocf/resource.d/linbit
> 
> While the correct directory seems to be /usr/lib/ocf/resource.d/ (at
> least on my system).

I'll have to check the OCF standard on that. My hunch is that both
/usr/lib/ocf and /usr/local/lib/ocf are permissible in which case the
default would be correct (being in line with both OCF and FHS), but if
OCF does mandate /usr/lib/ocf specifically, we'll correct this.

> Furthermore, the default for creating a kernel module, WITH_KM, is set
> to no by configure. I'm not sure if having kernel module not compiled by
> default is something users would expect from drbd source.

As you may have noticed, DRBD is headed for being merged into the
mainline kernel, at which point building the out of tree module becomes
obsolete. That's the reason why we created the separate configure
option, and also set its default to "no".

> Ultimately, i'm not a fan of installing to /usr/local/etc et.al because
> i don't believe many tools will be able to use them correctly?

Use --prefix=/usr.

> Debian
> init script fixer update-rc.d for instance won't find the drbd init
> script in /usr/local/etc/init.d/drbd. I would think the defaults for
> this would rather be just normal /etc and /etc/init.d.

Use --sysconfdir=/etc.

Florian


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 260 bytes
Desc: OpenPGP digital signature
URL: <http://lists.linbit.com/pipermail/drbd-user/attachments/20091120/40be822d/attachment.pgp>


More information about the drbd-user mailing list