pusher / crank

Process slow restarter
http://pusher.github.io/crank/man/
MIT License
38 stars 3 forks source link

Set the HOME environment variables #24

Open zimbatm opened 10 years ago

zimbatm commented 10 years ago

The ruby uuid library for example tries to write a ~/.ruby-uuid file in the home directory (why!). A lot of tools usually requires a HOME environment variable. When started from upstart the HOME environment variable is missing.

cultureulterior commented 10 years ago

We should really drop the UUID gem or fix it- there's already a bug- and workaround- for it in the infrastructure code.

zimbatm commented 10 years ago

Especially since most of the time we just want a sufficiently-random-id. A UUID is a composition of clock time, mac address and PRNG.

For example right now the API generates a UUID for each requests. This involves: acquiring a mutex lock, some weird clock heuristic, acquiring a file lock to share PRNG state between processes, packing all the data in that weird hyphenated format.

It's nice that requests IDs can be sorted in time but that's what log timestamps are for. Instead we could just call SecureRandom.hex. Done.