blink: The linux kernel has a race condition for blinking drives. -j1 works around it.

This commit is contained in:
Ole Tange 2012-08-27 17:54:14 +02:00
parent 172e7972f5
commit a51c490af0

View file

@ -185,21 +185,21 @@ if($::opt_on) {
sub on {
my $locate = shift;
print("parallel echo 1 \\> ::: $locate\n");
system("parallel echo 1 \\> ::: $locate\n");
print("parallel -j1 echo 1 \\> ::: $locate\n");
system("parallel -j1 echo 1 \\> ::: $locate\n");
}
sub off {
my $locate = shift;
print("parallel echo 0 \\> ::: $locate\n");
system("parallel echo 0 \\> ::: $locate\n");
print("parallel -j1 echo 0 \\> ::: $locate\n");
system("parallel -j1 echo 0 \\> ::: $locate\n");
}
sub toggle {
my $locate = shift;
# If the file 'locate' contains 1 it should be put to 0.
print('parallel grep -q 1 {} \; echo \$? \\> {} :::'." $locate\n");
system('parallel grep -q 1 {} \; echo \$? \\> {} :::'." $locate\n");
print('parallel -j1 grep -q 1 {} \; echo \$? \\> {} :::'." $locate\n");
system('parallel -j1 grep -q 1 {} \; echo \$? \\> {} :::'." $locate\n");
}