From 1609fbfdaa46ed5bb953af3dca8efb23c3d8c6cb Mon Sep 17 00:00:00 2001 From: maniacikarus Date: Sat, 22 Sep 2007 08:10:41 +0000 Subject: [PATCH] =?UTF-8?q?hddshutdown=20mit=20sonderbehandlung=20f=C3=BCr?= =?UTF-8?q?=20SATA=20makegraphs=20um=20-d=20ata=20ergaenzt=20MPFire=20Pake?= =?UTF-8?q?t=20angepasst?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: http://svn.ipfire.org/svn/ipfire/trunk@904 ea5c0bd1-69bd-2848-81d8-4f18e57aeed8 --- lfs/mpfire | 5 +++-- src/misc-progs/syslogdctrl.c | 2 +- src/paks/mpfire/install.sh | 8 +++++--- src/scripts/hddshutdown | 18 +++++++++++++----- src/scripts/makegraphs | 2 +- 5 files changed, 23 insertions(+), 12 deletions(-) diff --git a/lfs/mpfire b/lfs/mpfire index 9cea6a5e4..c8906bc55 100644 --- a/lfs/mpfire +++ b/lfs/mpfire @@ -63,6 +63,7 @@ $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects)) install -v -m 755 $(DIR_SRC)/config/mpfire/mpfire.pl /var/ipfire/mpfire/bin install -v -m 644 $(DIR_SRC)/config/mpfire/mpd.conf /var/ipfire/mpfire/ install -v -m 644 $(DIR_SRC)/config/mpfire/webradio /var/ipfire/mpfire/ - chown root.nobody /var/ipfire/mpfire/{settings,playlist.m3u,webradio,mpd.conf} - chown root.nobody /var/ipfire/mpfire/db/mpd.db + chown root.nobody /var/ipfire/mpfire/{mpd.conf,playlist.m3u} + chown nobody.nobody /var/ipfire/mpfire/{settings,webradio} + chown root.nobody /var/ipfire/mpfire/db/mpd.db @$(POSTBUILD) diff --git a/src/misc-progs/syslogdctrl.c b/src/misc-progs/syslogdctrl.c index 184f45014..6991ccf35 100644 --- a/src/misc-progs/syslogdctrl.c +++ b/src/misc-progs/syslogdctrl.c @@ -112,7 +112,7 @@ int main(void) else snprintf(buffer, STRING_SIZE - 1, "/bin/sed -e 's/^#\\?\\(\\*\\.\\*[[:blank:]]\\+@.\\+\\)$/#\\1/' /etc/syslog.conf >&%d", config_fd ); - snprintf(buffer, STRING_SIZE - 1, "/bin/sed 's#.*/var/log/messages.*#%s /var/log/messages#' /etc/syslog.conf >&%d", varmessages, config_fd ); + snprintf(buffer, STRING_SIZE - 1, "/bin/sed -e 's#\\.\\*/var/log/messages\\.\\*#%s /var/log/messages#' /etc/syslog.conf >&%d", varmessages, config_fd ); /* if the return code isn't 0 failsafe */ if ((rc = unpriv_system(buffer,99,99)) != 0) diff --git a/src/paks/mpfire/install.sh b/src/paks/mpfire/install.sh index e5024461f..f5aefa427 100644 --- a/src/paks/mpfire/install.sh +++ b/src/paks/mpfire/install.sh @@ -2,8 +2,10 @@ . /opt/pakfire/lib/functions.sh extract_files -ln -svf ../init.d/mpd /etc/rc.d/rc3.d/S65mpd -ln -svf ../init.d/mpd /etc/rc.d/rc0.d/K35mpd -ln -svf ../init.d/mpd /etc/rc.d/rc6.d/K35mpd +ln -svf /etc/init.d/mpd /etc/rc.d/rc3.d/S65mpd +ln -svf /etc/init.d/mpd /etc/rc.d/rc0.d/K35mpd +ln -svf /etc/init.d/mpd /etc/rc.d/rc6.d/K35mpd +ln -svf /etc/init.d/mpd /etc/rc.d/rc6.d/K35mpd +ln -svf /var/ipfire/mpfire/mpd.conf /etc/mpd.conf touch /var/log/mpd.error.log touch /var/log/mpd.log diff --git a/src/scripts/hddshutdown b/src/scripts/hddshutdown index a99b16a86..853f769e4 100644 --- a/src/scripts/hddshutdown +++ b/src/scripts/hddshutdown @@ -20,23 +20,31 @@ if ($debug){print "### Searching for available Disks ###\n";} foreach (@devices){ chomp $_; $diskstats = `iostat -d -t $_ | tail -2 | head -1 | awk '{ print \$5","\$6}'`; -$status = `hdparm -C /dev/$_ | tail -1 | cut -d: -f2`; + +if ( $_ =~ /^s/ ){$status = `sdparm --command=ready /dev/$_ | tail -1`;} +else {$status = `hdparm -C /dev/$_ | tail -1 | cut -d: -f2`;} + chomp $status; chomp $diskstats; -if ($debug){print "Device ".$_." is in status".$status." and has ".$diskstats." write and read Requests.\n";} +if ($debug){print "Device ".$_." is in status ".$status." and has ".$diskstats." write and read Requests.\n";} sleep 30; + $newdiskstats = `iostat -d -t $_ | tail -2 | head -1 | awk '{ print \$5","\$6}'`; chomp $newdiskstats; - if ($diskstats eq $newdiskstats && $status !=~/standby/){ + if ($diskstats eq $newdiskstats && $status !~/standby/){ if ($debug){print "Device ".$_." is set to standy.\n";} - system("/sbin/hdparm -y /dev/$_"); + if ( $_ =~ /^s/ ){system("sdparm --command=stop /dev/$_");} + else {system("/sbin/hdparm -y /dev/$_");} system("touch /tmp/hddshutdown-$_"); } - else{ + elsif ($diskstatus{$_} ne "0" ){ if ($debug){print "Device ".$_." is active.\n";} if ( -e "/tmp/hddshutdown-$_" ) { system("unlink /tmp/hddshutdown-$_"); } } + elsif ( $status =~/standby/ ){ + if ($debug){print "Device ".$_." is in standby mode.\n";} + } } # end diff --git a/src/scripts/makegraphs b/src/scripts/makegraphs index f98e37758..ef959684b 100644 --- a/src/scripts/makegraphs +++ b/src/scripts/makegraphs @@ -421,7 +421,7 @@ sub updatehdddata if ( -e "$path_smartctl" ) { - system("$path_smartctl -iHA /dev/$disk > /var/log/smartctl_out_hddtemp-$disk"); + system("$path_smartctl -iHA -d ata /dev/$disk > /var/log/smartctl_out_hddtemp-$disk"); } if ( -e "$path_hddtemp" )