Skip to content

Commit 0200f79

Browse files
committed
system: dealing with "sleep 60" and signals in scripts is hard...
PR: https://forum.opnsense.org/index.php?topic=34241.0
1 parent 7273bba commit 0200f79

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/etc/inc/rrd.inc

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -553,15 +553,16 @@ function rrd_configure($verbose = false, $bootup = false)
553553
554554
EOD;
555555

556-
$rrdupdatesh .= "sleep 60\n";
556+
$rrdupdatesh .= "\n";
557+
$rrdupdatesh .= " for UNUSED in \$(seq 1 60); do sleep 1; done\n";
557558
$rrdupdatesh .= "done\n";
558559

559560
/* write the rrd update script */
560561
$updaterrdscript = '/var/db/rrd/updaterrd.sh';
561-
$fd = fopen("$updaterrdscript", "w");
562-
fwrite($fd, "$rrdupdatesh");
562+
$fd = fopen($updaterrdscript, 'w');
563+
fwrite($fd, $rrdupdatesh);
563564
fclose($fd);
564-
chmod($updaterrdscrip, 0755);
565+
chmod($updaterrdscript, 0755);
565566

566567
/* start traffic collector */
567568
mwexecf('/usr/sbin/daemon -f -p %s %s', ['/var/run/updaterrd.pid', $updaterrdscript]);

0 commit comments

Comments
 (0)