twitter-archive / kestrel

simple, distributed message queue system (inactive)
http://twitter.github.io/kestrel
Other
2.77k stars 312 forks source link

Startup script does not work under FreeBSD #22

Closed stevencorona closed 14 years ago

stevencorona commented 14 years ago

Hi there. Just wanted to report a small bug- apparently the daemon utility is different under FreeBSD versus Linux. It does not let you lookup the PID, which blows up the shutdown function. I changed the startup script to use pgrep when running under FreeBSD. My fix is attached below (I can send you a pull request, but it might be overkill).

I'm not sure if pgrep is a common linux utility or not, which is why I made the change FreeBSD specific instead of changing the entire function to use pgrep.

http://github.com/stevecorona/kestrel/commit/b07a1bd3440f927bca6ff45f3c3f6c12dacf9dc5

robey commented 14 years ago

i don't think pgrep is on linux. :(

that's kinda maddening that they expose a --running option that doesn't actually work. do you think we should file a bug?

stevencorona commented 14 years ago

interestingly, pgrep is on my gentoo box & daemon is not, heh. I don't know if it's a bug, as far as I can tell FreeBSDs daemon is a different tool than on linux. In fact, it seems like it even ignores the --stdout and --stderr flags.

What if I just replaced pgrep with some "ps | grep" action?

robey commented 14 years ago

oh! i bet the BSD "daemon" is an entirely different beast. that's probably the root problem.

you can get the libslack "daemon" here: http://libslack.org/daemon/

stevencorona commented 14 years ago

Thanks, I'll check that out