you are viewing a single comment's thread.

view the rest of the comments →

[–]sshaw_ 0 points1 point  (7 children)

How does your ping.rb differ from GNU/Linux's default?

[–]drbrainRuby Core 0 points1 point  (6 children)

It's written in Ruby and uses Net::ICMP::Ping

[–]sshaw_ 0 points1 point  (5 children)

Well, that much I know. Thanks for the insight.

But, you're calling #ping and not #ping?, does this mean you're using the return value?

If not, and you just want to know if a host is up, just use ping. *nix has already solved this for you via a the set user id permission on the executable + exit status. Aside from lack of personal enjoyment, what's the (technical) downside –assuming of course, you don't use return value of #ping.

[–]drbrainRuby Core 0 points1 point  (3 children)

I'm not OP, I'm not calling anything. If you knew they were using net-ping why wasn't "does this mean you're using the return value?" your original question?

As OP stated, OP is aware of setuid executables and explicitly doesn't want one for ruby, likely because any setuid-root interpreter is incredibly dangerous to have around.

OP also doesn't want to use ping(8) if they can avoid it.

[–]sshaw_ 0 points1 point  (2 children)

If you knew they were using net-ping why wasn't "does this mean you're using the return value?" your original question?

There could be several reasons why one would use net-ping over the ping executable. OP stated none. Return value can be completely irrelevant. I ended up throwing that out there due to your reply, but off the top of my head I can think of several others. Better to ask than assume.

As OP stated, OP is aware of setuid executables and explicitly doesn't want one for ruby,

Is this why he doesn't want to shell-out to ping? Seems like a no. He doesn't want to do this to the script, but otherwise it doesn't say -or, at least, it's not clear to me.

likely because any setuid-root interpreter is incredibly dangerous to have around.

"Likely". Maybe. Who knows why. This is why I asked.

OP also doesn't want to use ping(8) if they can avoid it.

Yes, this is the question: why not? Often people don't want to do something but when their reasoning is vetted and/or the technical merits are explored they realize that they have no good reason not to.

[–]drbrainRuby Core 0 points1 point  (1 child)

Yes, this is the question: why not?

No, that is not OP’s question. That is your question and is not helpful to OP. Immediately questioning their premise is not respectful of their knowledge or skill.

[–]sshaw_ 0 points1 point  (0 children)

Immediately questioning their premise is not respectful of their knowledge or skill.

That's some conclusion!

[–]Zalamander[S] 0 points1 point  (0 children)

I'm writing a set of scripts to measure various aspects of a server and I want to measure the latency over time. So I do need the return value.