<div dir="ltr"><div><div>I don&#39;t know, but getrandom() may well be using /dev/urandom (or a related facility).  And that, in turn, might be waiting to &quot;collect sufficient entropy&quot;.  So some network traffic, keystrokes, whatever, need to happen between boot time and the first random emission, or that first &quot;random&quot; number becomes predictable.  Since random numbers are often used cryptographically, predictability is a bad thing.</div><div><br></div>As to why ruby is designed to require a random number before being asked to do something dependent on such a random number is a question for the ruby developers.<br><br>Re-linking /dev/urandom will probably break lots of things.  Maybe run your script in a chroot jail that has a different /dev/urandom could work.<br><br></div>Is your script too complex to rewrite in bash?  Not a general solution, but as a workaround it has its appeal.<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Aug 8, 2017 at 2:24 PM, Ken D&#39;Ambrosio <span dir="ltr">&lt;<a href="mailto:ken@jots.org" target="_blank">ken@jots.org</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Well, I tried Tom&#39;s solution, and it made not a whit&#39;s worth of<br>
difference.  Because, assuming my ignorance about systemd equated with<br>
slow boot time, I hadn&#39;t troubleshot further than that.  Turns out that<br>
it&#39;s *Ruby&#39;s* fault.  A command like this:<br>
ruby -e &#39;puts 1&#39;<br>
is blocking for *THREE MINUTES OR MORE* on getrandom() for the first<br>
post-boot execution.  (Subsequent ones run fine.)  Which leads to all<br>
sorts of questions:<br>
* Why in the Hell do we care about getrandom() when we&#39;re printing an<br>
integer??<br>
* Couldn&#39;t we just use /dev/urandom and be done with it?<br>
* So much etc.<br>
<br>
I love Ruby -- a lot -- but this is bash-my-head-against-the-<wbr>monitor<br>
bad.<br>
<br>
Any suggestions?  Simply renaming /dev/random to something else and<br>
doing &quot;ln -s /dev/urandom /dev/random&quot; doesn&#39;t seem to be doing the job.<br>
<br>
-Ken<br>
______________________________<wbr>_________________<br>
gnhlug-discuss mailing list<br>
<a href="mailto:gnhlug-discuss@mail.gnhlug.org">gnhlug-discuss@mail.gnhlug.org</a><br>
<a href="http://mail.gnhlug.org/mailman/listinfo/gnhlug-discuss/" rel="noreferrer" target="_blank">http://mail.gnhlug.org/<wbr>mailman/listinfo/gnhlug-<wbr>discuss/</a><br>
</blockquote></div><br></div>