Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: DRBD: Users

compiling 8.3.6, sane configure defaults

 

 

DRBD users RSS feed   Index | Next | Previous | View Threaded


eelco at procolix

Nov 19, 2009, 6:53 AM

Post #1 of 6 (984 views)
Permalink
compiling 8.3.6, sane configure defaults

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.).

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.

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

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

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
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
user/drbdadm_minor_table.c:#define MINOR_TABLE_DIR "/var/lib/drbd/"
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"
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 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).


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.

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? 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.

Best regards,
Eelco Jepkema
Attachments: config.log (8.68 KB)
  configure.output (1.54 KB)
  make_install.output (2.97 KB)


rasto.levrinc at linbit

Nov 19, 2009, 9:33 AM

Post #2 of 6 (951 views)
Permalink
Re: compiling 8.3.6, sane configure defaults [In reply to]

On Thu, November 19, 2009 3: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.).
>
>
> 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.
>
>

As far as I can tell, this should install everything in the same places as
8.3.5.

./configure --prefix=/usr --with-km --localstatedir=/var --sysconfdir=/etc

make && make install DESTDIR=/

Rasto

--
: Dipl-Ing Rastislav Levrinc
: DRBD-MC http://www.drbd.org/mc/management-console/
: DRBD/HA support and consulting http://www.linbit.com/
DRBD(R) and LINBIT(R) are registered trademarks of LINBIT, Austria.


_______________________________________________
drbd-user mailing list
drbd-user [at] lists
http://lists.linbit.com/mailman/listinfo/drbd-user


florian.haas at linbit

Nov 19, 2009, 11:25 PM

Post #3 of 6 (936 views)
Permalink
Re: compiling 8.3.6, sane configure defaults [In reply to]

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
Attachments: signature.asc (0.25 KB)


eelco at procolix

Nov 20, 2009, 12:41 AM

Post #4 of 6 (917 views)
Permalink
Re: compiling 8.3.6, sane configure defaults [In reply to]

Florian Haas wrote:
> On 11/19/2009 03:53 PM, Eelco Jepkema wrote:
>> 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.

True, i don't want to go back :).

>> 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?

Those would be the ones noted below.

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

You are right if you mean by fine, it did its work without an error
message. However, if you do this you end up with a drbdadm that gives
warnings about symlinks to /var/lib/drbd on every command. I haven't
tested the other userland tools for this but i don't count a binary that
gives a warning on every use to belong in the category 'fine'.

>> 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.

I know this installs the userland tools, I didn't do this by hand.
running 'make install' on drbd source root as you describe did this, I
just explained here where the error was, not the actual command i used.
I thought I would highlight the problems i found from the make install
output I added to my original message.

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

Well, yes and no. Yes, it creates the path as stated in the Makefiles as
localstatedirpath but, since I mentioned that some sourcecode is
hardwired to /var/lib/drbd, this localstatedirpath will, as far as I can
tell, not be used by anything.

>> 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".

Ah, that is even better. That is a good reason for a default of 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.

I know I can override the defaults, however, I was thinking that doing...

./configure; make all; make install

...would and should at least be likely (I know its not possible to
account for all situations) to leave functioning software that wouldn't
need tinkering one way or the other. With the /var/lib/drbd references
in source fixed that should be possible though so we'll leave it at that.

Best regards,
Eelco Jepkema
_______________________________________________
drbd-user mailing list
drbd-user [at] lists
http://lists.linbit.com/mailman/listinfo/drbd-user


florian.haas at linbit

Nov 23, 2009, 4:35 AM

Post #5 of 6 (886 views)
Permalink
Re: compiling 8.3.6, sane configure defaults [In reply to]

Eelco,

On 2009-11-20 09:41, Eelco Jepkema wrote:
>> #2, that mkdir is fine as it uses a correct default localstatedir path.
>
> Well, yes and no. Yes, it creates the path as stated in the Makefiles as
> localstatedirpath but, since I mentioned that some sourcecode is
> hardwired to /var/lib/drbd, this localstatedirpath will, as far as I can
> tell, not be used by anything.

This is being changed to a properly autoconfigured header as I am typing
this.

>>> 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.
>
> I know I can override the defaults, however, I was thinking that doing...
>
> ./configure; make all; make install
>
> ...would and should at least be likely (I know its not possible to
> account for all situations) to leave functioning software that wouldn't
> need tinkering one way or the other. With the /var/lib/drbd references
> in source fixed that should be possible though so we'll leave it at that.

There is no easy way to satisfy your ./configure & make & make install
requirement _and_ at the same time be in line with autoconf defaults
(which tend to mirror the FHS). No matter what we do, we'll either
dissatisfy someone who wants to type as little as possible, or someone
who has used autoconf before and who expects us to adhere to its
conventions. Arbitrarily, we chose to stick to autoconf's conventions.

Thus, you can either go with

./configure --prefix=/usr --localstatedir=/var --sysconfdir=/etc
make
sudo make install

... or you can peruse
http://www.gnu.org/software/hello/manual/autoconf/Site-Defaults.html#Site-Defaults
to learn how to tweak your local autoconf defaults. Or you build an RPM,
where the %configure macro will set the correct configure flags
automatically.

Cheers,
Florian
Attachments: signature.asc (0.25 KB)


eelco at procolix

Nov 23, 2009, 8:14 AM

Post #6 of 6 (884 views)
Permalink
Re: compiling 8.3.6, sane configure defaults [In reply to]

Florian Haas wrote:
> There is no easy way to satisfy your ./configure & make & make install
> requirement _and_ at the same time be in line with autoconf defaults
> (which tend to mirror the FHS). No matter what we do, we'll either
> dissatisfy someone who wants to type as little as possible, or someone
> who has used autoconf before and who expects us to adhere to its
> conventions. Arbitrarily, we chose to stick to autoconf's conventions.
>
> Thus, you can either go with
>
> ./configure --prefix=/usr --localstatedir=/var --sysconfdir=/etc
> make
> sudo make install
>
> ... or you can peruse
> http://www.gnu.org/software/hello/manual/autoconf/Site-Defaults.html#Site-Defaults
> to learn how to tweak your local autoconf defaults. Or you build an RPM,
> where the %configure macro will set the correct configure flags
> automatically.

Thanks alot for taking the time to reply to this, I'll check into the
autoconf defaults possibility because that does indeed sound like the
way to go.

Ofcourse the best thing would indeed be for the module to go into the
mainstream kernel and then someone/we/I can make some distributions for
the userland stuff so I can do 'aptitude install drbd-tools', or
something like that, without having to think about this stuff :).

Best regards,
Eelco Jepkema
_______________________________________________
drbd-user mailing list
drbd-user [at] lists
http://lists.linbit.com/mailman/listinfo/drbd-user

DRBD users RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.