Re: Ruby slow to launch (was L-o-n-g delay for rc.local in systemd on Ubuntu.)

2017-08-08 Thread Dennis Straffin
Oops, I didn't see Ken's reply where he already figure this out (spotty cell service). Where I work we were having this issue when bringing up new VMs. While provisioning, it would seem to just hang for 10 or 15 minutes when installing packages. No cpu usage, no disk io, no network io. And

Re: Ruby slow to launch (was L-o-n-g delay for rc.local in systemd on Ubuntu.)

2017-08-08 Thread Ken D'Ambrosio
Well, I don't know what was wrong with catting random data to /dev/random and /dev/urandom, but it didn't to diddly. "apt install haveged", howver, and I'm now booting in ~20 seconds instead of 3 - 5 minutes. (It adds entropy -- or, if you prefer, "entropy" -- by seeing how long certain

Re: Ruby slow to launch (was L-o-n-g delay for rc.local in systemd on Ubuntu.)

2017-08-08 Thread Dennis Straffin
VMs lack hardware devices to fill up the pool of random numbers. Installing the haveged daemon will do expansion on the random numbers to keep the pool full. -Dennis On August 8, 2017 3:30:46 PM EDT, Ken D'Ambrosio wrote: >On 2017-08-08 15:18, Joshua Judson Rosen wrote: > >>

Why does Ruby init its random number generator up front? (was: Ruby slow to launch)

2017-08-08 Thread Joshua Judson Rosen
On 08/08/2017 03:33 PM, Tom Buskey wrote: > On Tue, Aug 8, 2017 at 3:18 PM, Joshua Judson Rosen > wrote: > > On 08/08/2017 02:52 PM, Ken D'Ambrosio wrote: > > On 2017-08-08 14:43, Bill Freeman wrote: > >> As to why ruby is

Ruby slow to launch (was L-o-n-g delay for rc.local in systemd on Ubuntu.)

2017-08-08 Thread Ken D'Ambrosio
Well, I tried Tom's solution, and it made not a whit's worth of difference. Because, assuming my ignorance about systemd equated with slow boot time, I hadn't troubleshot further than that. Turns out that it's *Ruby's* fault. A command like this: ruby -e 'puts 1' is blocking for *THREE

Re: Ruby slow to launch (was L-o-n-g delay for rc.local in systemd on Ubuntu.)

2017-08-08 Thread Bill Freeman
I don't know, but getrandom() may well be using /dev/urandom (or a related facility). And that, in turn, might be waiting to "collect sufficient entropy". So some network traffic, keystrokes, whatever, need to happen between boot time and the first random emission, or that first "random" number

L-o-n-g delay for rc.local in systemd on Ubuntu.

2017-08-08 Thread Ken D'Ambrosio
Hey, all. I've got some stuff in my rc.local, and it takes *forever* to execute -- three+ minutes. (Note that the machine -- a virtual one -- is up in something like 20 seconds.) I *need* this stuff, which is lightweight in the extreme, to execute much more quickly than that. Anyone have

Re: Ruby slow to launch (was L-o-n-g delay for rc.local in systemd on Ubuntu.)

2017-08-08 Thread Ken D'Ambrosio
On 2017-08-08 14:43, Bill Freeman wrote: > I don't know, but getrandom() may well be using /dev/urandom (or a > related facility). And that, in turn, might be waiting to "collect > sufficient entropy". So some network traffic, keystrokes, whatever, > need to happen between boot time and the

Re: Ruby slow to launch (was L-o-n-g delay for rc.local in systemd on Ubuntu.)

2017-08-08 Thread Joshua Judson Rosen
On 08/08/2017 02:52 PM, Ken D'Ambrosio wrote: > On 2017-08-08 14:43, Bill Freeman wrote: >> I don't know, but getrandom() may well be using /dev/urandom (or a >> related facility). And that, in turn, might be waiting to "collect >> sufficient entropy". So some network traffic, keystrokes,

Re: L-o-n-g delay for rc.local in systemd on Ubuntu.

2017-08-08 Thread Tom Buskey
If you put it in systemd, it won't hold up login. I can often ssh into systems before the whole boot finishes. I don't remember if the login: on the console was affected. I did Solaris 10 until about 5 years ago. They replaced SysV init with SMF which did dependency checking, etc. Crucially,

Re: Ruby slow to launch (was L-o-n-g delay for rc.local in systemd on Ubuntu.)

2017-08-08 Thread Ken D'Ambrosio
On 2017-08-08 15:18, Joshua Judson Rosen wrote: >The /dev/random interface is considered a legacy > interface, and >/dev/urandom is preferred and sufficient in all use cases, > with the >exception of applications which require randomness during > early

Re: Ruby slow to launch (was L-o-n-g delay for rc.local in systemd on Ubuntu.)

2017-08-08 Thread Tom Buskey
On Tue, Aug 8, 2017 at 3:18 PM, Joshua Judson Rosen wrote: > On 08/08/2017 02:52 PM, Ken D'Ambrosio wrote: > > On 2017-08-08 14:43, Bill Freeman wrote: > >> As to why ruby is designed to require a random number before being > >> asked to do something dependent on such a

Re: L-o-n-g delay for rc.local in systemd on Ubuntu.

2017-08-08 Thread Tom Buskey
If your system is using systemd, don't use rc.local. rc.local is not deterministic in systemd. I've had to move everything out of rc.local and learn systemd to get reliable starting. I created something like this (run_on_boot.service) [Unit] Description=Run at startup After=network.target

Re: L-o-n-g delay for rc.local in systemd on Ubuntu.

2017-08-08 Thread Dan Garthwaite
+1 Tom. Not to detract in any way from his answer - he is spot on and everyone should learn systemd if they are using systemd. If it isn't a daemon and just something that's gotta be done once after a power outage I've used CRON's @REBOOT. Especially for non-root users.

Re: L-o-n-g delay for rc.local in systemd on Ubuntu.

2017-08-08 Thread Jerry Feldman
+1 for me also. When things like this change, we must also change with it. On 08/08/2017 12:08 PM, Dan Garthwaite wrote: +1 Tom. Not to detract in any way from his answer - he is spot on and everyone should learn systemd if they are using systemd. If it isn't a daemon and just something