From: maniacikarus Date: Sat, 22 Sep 2007 08:10:41 +0000 (+0000) Subject: hddshutdown mit sonderbehandlung für SATA X-Git-Tag: v2.3-beta1~371 X-Git-Url: http://git.ipfire.org/?p=people%2Fpmueller%2Fipfire-2.x.git;a=commitdiff_plain;h=1609fbfdaa46ed5bb953af3dca8efb23c3d8c6cb hddshutdown mit sonderbehandlung für SATA makegraphs um -d ata ergaenzt MPFire Paket angepasst git-svn-id: http://svn.ipfire.org/svn/ipfire/trunk@904 ea5c0bd1-69bd-2848-81d8-4f18e57aeed8 --- diff --git a/lfs/mpfire b/lfs/mpfire index 9cea6a5e4c..c8906bc55e 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 184f450145..6991ccf353 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 e5024461f1..f5aefa4270 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 a99b16a869..853f769e4b 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 f98e377584..ef959684b3 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" )