A problematic bug in simple-init can be resolved by eliminating one variable. Specifically, change:-
$wait=60*60*24;
while($active&& $running) {
(undef,$wait)=select(undef,undef,undef,$wait);
}
to:-
while($active&& $running) {
select(undef,undef,undef,60*60*24);
}
or suchlike. This change eliminates the case where the variable is zero and a busy wait on select() ensues.
Minor bugs remain. Regardless, simple-init is now suitable for deployment on systems which do not require suspend.
(Score: 2) by Knowledge Troll on Friday August 19 2016, @01:45AM
For downward compatibility, the code was intended to run on Perl4.
Whoa uhm ok.
It is preferable to keep dependencies down - especially in an init system.
Time::HiRes is in Core so it is already everywhere perl 5 is. Perl 4 I dunno. It even looks like strict depends on Time::HiRes so I would assume it has already even been loaded. But then Perl 4. *shrug*
And you should still find an algorithm for sleeping and ensuring the right sleep duration happened then either faulting or gracefully recovering from it.