Merge branch 'master' of github.com:ole-tange/tangetools

This commit is contained in:
Ole Tange 2012-05-18 23:17:44 +02:00
commit 7015db12a3
2 changed files with 7 additions and 4 deletions

View file

@ -56,7 +56,7 @@ sub mail {
my($cpu_seconds, $user, @command) = @_; my($cpu_seconds, $user, @command) = @_;
my @mail = my @mail =
( (
'From: Ole Tanges renice program <tange@binf.ku.dk>', 'From: The renice program <root>',
"To: <$user>", "To: <$user>",
'Subject: Your program has been reniced', 'Subject: Your program has been reniced',
'', '',
@ -68,7 +68,10 @@ sub mail {
'', '',
"has been using more than $cpu_seconds CPU seconds. I have therefore niced it to nice level 19.", "has been using more than $cpu_seconds CPU seconds. I have therefore niced it to nice level 19.",
'', '',
'If you want to avoid that in the future, you can start the program with a different nice level:', 'There is no harm done, this is purely for your information so you know what happened and how',
'to avoid it.',
'',
'If you want to avoid it in the future, you can start the program with a different nice level:',
'', '',
' nice -n XX your_command', ' nice -n XX your_command',
'', '',
@ -80,7 +83,7 @@ sub mail {
'', '',
'Regards', 'Regards',
'', '',
"Ole Tange's renice program", "The renice program",
); );
open(S,"|/usr/sbin/sendmail -t") or die; open(S,"|/usr/sbin/sendmail -t") or die;

View file

@ -24,7 +24,7 @@ start() {
mem_total=$((mem_total_kb * 1024)) mem_total=$((mem_total_kb * 1024))
# load dependency modules # load dependency modules
modprobe zram zram_num_devices=$num_cpus modprobe zram zram_num_devices=$num_cpus || modprobe zram num_devices=$num_cpus || exit 1
# initialize the devices # initialize the devices
for i in $(seq 0 $decr_num_cpus); do for i in $(seq 0 $decr_num_cpus); do