Skip Menu |

This queue is for tickets about the Linux-LVM CPAN distribution.

Report information
The Basics
Id: 38889
Status: patched
Priority: 0/
Queue: Linux-LVM

People
Owner: Nobody in particular
Requestors: bremner-dated-1221423046.182790 [...] pivot.cs.unb.ca
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



CC: debian-perl [...] lists.debian.org
Subject: location of lvm binaries in Linux::LVM
Date: Sun, 31 Aug 2008 17:10:45 -0300
To: bug-linux-lvm [...] rt.cpan.org
From: David Bremner <bremner [...] unb.ca>
Dear Chad; On Debian, we had to apply the patch below to get your module to find the lvm binaries, which for us are in /sbin. I could see it being distro dependent where these binaries ended up; perhaps the nicest thing would be to have a configure option for Makefile.PL. In any case I guess you want the error messages to match the test :-). --- liblinux-lvm-perl.orig/LVM.pm +++ liblinux-lvm-perl/LVM.pm @@ -151,8 +151,8 @@ my $lvn; my $pvn; - if( ! -e "/usr/sbin/vgdisplay" ) { die("LVM utilities not installed in /sbin"); } - my @vginfo = `/usr/sbin/vgdisplay -v`; + if( ! -e "/sbin/vgdisplay" ) { die("LVM utilities not installed in /sbin"); } + my @vginfo = `/sbin/vgdisplay -v`; VGINF: foreach(@vginfo) { chomp; @@ -361,8 +361,8 @@ my %pvhash; if( ! -e "$pvname" ) { die("Physical Disk: $pvname does not exist."); } - if( ! -e "/usr/sbin/pvdisplay" ) { die("LVM utilities not installed in /sbin"); } - my @pvinfo = `/usr/sbin/pvdisplay $pvname`; + if( ! -e "/sbin/pvdisplay" ) { die("LVM utilities not installed in /sbin"); } + my @pvinfo = `/sbin/pvdisplay $pvname`; PVINF: foreach(@pvinfo) { # Get the name of the physical volume. @@ -445,8 +445,8 @@ my $lvname = $_[0]; my %lvhash; if( ! -e "$lvname" ) { die("Logical Disk: $lvname does not exist."); } - if( ! -e "/usr/sbin/lvdisplay" ) { die("LVM utilities not installed in /sbin"); } - my @lvinfo = `/usr/sbin/lvdisplay $lvname`; + if( ! -e "/sbin/lvdisplay" ) { die("LVM utilities not installed in /sbin"); } + my @lvinfo = `/sbin/lvdisplay $lvname`; LVINF: foreach(@lvinfo) {
On Sun Aug 31 16:11:35 2008, bremner-dated-1221423046.182790@pivot.cs.unb.ca wrote: Show quoted text
> > Dear Chad; > > On Debian, we had to apply the patch below to get your module to find > the lvm binaries, which for us are in /sbin. > > I could see it being distro dependent where these binaries ended up; > perhaps the nicest thing would be to have a configure option for > Makefile.PL. > > In any case I guess you want the error messages to match the test :-). > > --- liblinux-lvm-perl.orig/LVM.pm > +++ liblinux-lvm-perl/LVM.pm > @@ -151,8 +151,8 @@ > my $lvn; > my $pvn; > > - if( ! -e "/usr/sbin/vgdisplay" ) { die("LVM utilities not > installed in /sbin"); } > - my @vginfo = `/usr/sbin/vgdisplay -v`; > + if( ! -e "/sbin/vgdisplay" ) { die("LVM utilities not installed > in /sbin"); } > + my @vginfo = `/sbin/vgdisplay -v`; > > VGINF: foreach(@vginfo) { > chomp; > @@ -361,8 +361,8 @@ > my %pvhash; > > if( ! -e "$pvname" ) { die("Physical Disk: $pvname does not > exist."); } > - if( ! -e "/usr/sbin/pvdisplay" ) { die("LVM utilities not > installed in /sbin"); } > - my @pvinfo = `/usr/sbin/pvdisplay $pvname`; > + if( ! -e "/sbin/pvdisplay" ) { die("LVM utilities not installed > in /sbin"); } > + my @pvinfo = `/sbin/pvdisplay $pvname`; > > PVINF: foreach(@pvinfo) { > # Get the name of the physical volume. > @@ -445,8 +445,8 @@ > my $lvname = $_[0]; > my %lvhash; > if( ! -e "$lvname" ) { die("Logical Disk: $lvname does not > exist."); } > - if( ! -e "/usr/sbin/lvdisplay" ) { die("LVM utilities not > installed in /sbin"); } > - my @lvinfo = `/usr/sbin/lvdisplay $lvname`; > + if( ! -e "/sbin/lvdisplay" ) { die("LVM utilities not installed > in /sbin"); } > + my @lvinfo = `/sbin/lvdisplay $lvname`; > > LVINF: foreach(@lvinfo) { > >
To make it work for both /sbin and /usr/sbin, so for example it works for both Debian and Red Hat, I have attached a patch.
Subject: lvm_usr_bin.patch
--- /root/.cpan/build/Linux-LVM-0.14-g6S72j/LVM.pm 2008-07-02 02:53:41.000000000 -0500 +++ bin/lib/Linux/LVM.pm 2009-12-21 15:53:50.000000000 -0600 @@ -151,8 +151,14 @@ sub get_vg_information() { my $lvn; my $pvn; - if( ! -e "/usr/sbin/vgdisplay" ) { die("LVM utilities not installed in /sbin"); } - my @vginfo = `/usr/sbin/vgdisplay -v`; + my @vginfo; + + if ( -e "/usr/sbin/vgdisplay" ) { + @vginfo = `/usr/sbin/vgdisplay -v`; + } else { + if( ! -e "/sbin/vgdisplay" ) { die("LVM utilities not installed in /sbin or /usr/sbin"); } + @vginfo = `/sbin/vgdisplay -v`; + } VGINF: foreach(@vginfo) { chomp; @@ -359,10 +375,17 @@ sub get_vg_information() { sub get_pv_info($) { my $pvname = $_[0]; my %pvhash; + my @pvinfo; if( ! -e "$pvname" ) { die("Physical Disk: $pvname does not exist."); } - if( ! -e "/usr/sbin/pvdisplay" ) { die("LVM utilities not installed in /sbin"); } - my @pvinfo = `/usr/sbin/pvdisplay $pvname`; + + if ( -e "/usr/sbin/pvdisplay" ) { + @pvinfo = `/usr/sbin/pvdisplay $pvname`; + } else { + if( ! -e "/sbin/pvdisplay" ) { die("LVM utilities not installed in /sbin or /usr/sbin"); } + @pvinfo = `/sbin/pvdisplay $pvname`; + } + PVINF: foreach(@pvinfo) { # Get the name of the physical volume. @@ -444,9 +467,16 @@ sub get_pv_info($) { sub get_lv_info($) { my $lvname = $_[0]; my %lvhash; + my @lvinfo; + if( ! -e "$lvname" ) { die("Logical Disk: $lvname does not exist."); } - if( ! -e "/usr/sbin/lvdisplay" ) { die("LVM utilities not installed in /sbin"); } - my @lvinfo = `/usr/sbin/lvdisplay $lvname`; + + if ( -e "/usr/sbin/vgdisplay" ) { + @lvinfo = `/usr/sbin/lvdisplay $lvname`; + } else { + if( ! -e "/sbin/vgdisplay" ) { die("LVM utilities not installed in /sbin or /usr/sbin"); } + @lvinfo = `/sbin/lvdisplay $lvname`; + } LVINF: foreach(@lvinfo) {