From 7c376639d603b61b9e1c711df455b9a77a9fb75b Mon Sep 17 00:00:00 2001 From: Olav Vitters Date: Fri, 31 Jul 2020 13:40:07 +0200 Subject: ensure partmon and listhome files are in the same path as before the 10.04 merge --- mageia/etc/sysconfig/partmon | 5 +++ mageia/etc/sysconfig/partmon.sysconfig | 5 --- mageia/usr/bin/listhome | 7 ++++ mageia/usr/bin/partmon | 64 ++++++++++++++++++++++++++++++++++ mageia/usr/bin/partmon.pl | 64 ---------------------------------- mageia/usr/sbin/listhome | 7 ---- 6 files changed, 76 insertions(+), 76 deletions(-) create mode 100644 mageia/etc/sysconfig/partmon delete mode 100644 mageia/etc/sysconfig/partmon.sysconfig create mode 100644 mageia/usr/bin/listhome create mode 100644 mageia/usr/bin/partmon delete mode 100644 mageia/usr/bin/partmon.pl delete mode 100644 mageia/usr/sbin/listhome diff --git a/mageia/etc/sysconfig/partmon b/mageia/etc/sysconfig/partmon new file mode 100644 index 00000000..622e4492 --- /dev/null +++ b/mageia/etc/sysconfig/partmon @@ -0,0 +1,5 @@ +/ 20000 +/tmp 20000 +/usr 50000 +/var 50000 +/boot 5000 diff --git a/mageia/etc/sysconfig/partmon.sysconfig b/mageia/etc/sysconfig/partmon.sysconfig deleted file mode 100644 index 622e4492..00000000 --- a/mageia/etc/sysconfig/partmon.sysconfig +++ /dev/null @@ -1,5 +0,0 @@ -/ 20000 -/tmp 20000 -/usr 50000 -/var 50000 -/boot 5000 diff --git a/mageia/usr/bin/listhome b/mageia/usr/bin/listhome new file mode 100644 index 00000000..733dbe08 --- /dev/null +++ b/mageia/usr/bin/listhome @@ -0,0 +1,7 @@ +#!/bin/sh +# Chmouel Boudjnah +# Description: List the home greather than 501 should be unusefull now, but +# here for backward compatibilities + +LC_ALL=C LANG=C LANGUAGE=C \ +perl -n -e 'while(my @list=getpwent){print $list[-2], "\n" unless $list[2] <= 999}' < /etc/passwd diff --git a/mageia/usr/bin/partmon b/mageia/usr/bin/partmon new file mode 100644 index 00000000..d6d297b6 --- /dev/null +++ b/mageia/usr/bin/partmon @@ -0,0 +1,64 @@ +#!/usr/bin/perl +# +# Guillaume Cottenceau (gc@mandriva.com) +# +# Copyright 2002 Mandriva +# +# This software may be freely redistributed under the terms of the GNU +# public license. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +# +# +#use strict; +use MDK::Common; + +my ($verbose); + +sub free_space { + my ($mntpoint) = @_; + my ($blocksize, $size, $avail); + my $buf = ' ' x 20000; + syscall_('statfs', $mntpoint, $buf) or return; + (undef, $blocksize, $size, undef, $avail, undef) = unpack "L!6", $buf; + return $avail * ($blocksize / 1024); +} + +my %partlimits = map { if_(/^(.*\S)(?:\s+?)(\d+)$/, $1 => $2 ) } cat_('/etc/sysconfig/partmon'); + + +my $params = join '', @ARGV; + +$params =~ /-h/ and die "usage: partmon [-v]\n"; +$params =~ /-v/ and $verbose = 1; + + +my $ok = 1; +foreach (cat_('/etc/fstab')) { + /^\s*#/ and next; + my (undef, $mountpoint, undef, undef, undef, undef) = split or next; #- I want at least 6 fields to consider it a valid entry + member($mountpoint, keys %partlimits) or next; + my $free = free_space($mountpoint); + $verbose and print "Free space of <$mountpoint> is <$free>\n"; + if ($free < $partlimits{$mountpoint}) { + print "Warning, free space for <$mountpoint> is only <", free_space($mountpoint), "> (which is inferior to <$partlimits{$mountpoint}>\n"; + $ok = 0; + } +} + +$ok or exit -1; + + +#------------------------------------------------- +#- $Log$ +#- Revision 1.3 2006/05/11 12:45:38 tvignaud +#- more s/Mandrakesoft/mandriva/ +#- +#- Revision 1.2 2002/01/15 13:45:24 chmouel +#- Fix warnings. +#- +#- Revision 1.1 2002/01/15 13:44:15 chmouel +#- Add partition monitor from GC +#- diff --git a/mageia/usr/bin/partmon.pl b/mageia/usr/bin/partmon.pl deleted file mode 100644 index d6d297b6..00000000 --- a/mageia/usr/bin/partmon.pl +++ /dev/null @@ -1,64 +0,0 @@ -#!/usr/bin/perl -# -# Guillaume Cottenceau (gc@mandriva.com) -# -# Copyright 2002 Mandriva -# -# This software may be freely redistributed under the terms of the GNU -# public license. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -# -# -#use strict; -use MDK::Common; - -my ($verbose); - -sub free_space { - my ($mntpoint) = @_; - my ($blocksize, $size, $avail); - my $buf = ' ' x 20000; - syscall_('statfs', $mntpoint, $buf) or return; - (undef, $blocksize, $size, undef, $avail, undef) = unpack "L!6", $buf; - return $avail * ($blocksize / 1024); -} - -my %partlimits = map { if_(/^(.*\S)(?:\s+?)(\d+)$/, $1 => $2 ) } cat_('/etc/sysconfig/partmon'); - - -my $params = join '', @ARGV; - -$params =~ /-h/ and die "usage: partmon [-v]\n"; -$params =~ /-v/ and $verbose = 1; - - -my $ok = 1; -foreach (cat_('/etc/fstab')) { - /^\s*#/ and next; - my (undef, $mountpoint, undef, undef, undef, undef) = split or next; #- I want at least 6 fields to consider it a valid entry - member($mountpoint, keys %partlimits) or next; - my $free = free_space($mountpoint); - $verbose and print "Free space of <$mountpoint> is <$free>\n"; - if ($free < $partlimits{$mountpoint}) { - print "Warning, free space for <$mountpoint> is only <", free_space($mountpoint), "> (which is inferior to <$partlimits{$mountpoint}>\n"; - $ok = 0; - } -} - -$ok or exit -1; - - -#------------------------------------------------- -#- $Log$ -#- Revision 1.3 2006/05/11 12:45:38 tvignaud -#- more s/Mandrakesoft/mandriva/ -#- -#- Revision 1.2 2002/01/15 13:45:24 chmouel -#- Fix warnings. -#- -#- Revision 1.1 2002/01/15 13:44:15 chmouel -#- Add partition monitor from GC -#- diff --git a/mageia/usr/sbin/listhome b/mageia/usr/sbin/listhome deleted file mode 100644 index 733dbe08..00000000 --- a/mageia/usr/sbin/listhome +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/sh -# Chmouel Boudjnah -# Description: List the home greather than 501 should be unusefull now, but -# here for backward compatibilities - -LC_ALL=C LANG=C LANGUAGE=C \ -perl -n -e 'while(my @list=getpwent){print $list[-2], "\n" unless $list[2] <= 999}' < /etc/passwd -- cgit v1.2.1