Closed emacsomancer closed 7 years ago
Can you try the following in irb and tell me what happens?
require 'net/ping'
Net::Ping::External.new('imap.gmail.com').ping
The message you reported results when the method call above returns false. I suspect this problem may stem from platform-specific differences resulting from using the External
subclass of Net::Ping
– I'll look into it a little later...
$ irb
irb(main):001:0> require 'net/ping'
=> true
irb(main):002:0> Net::Ping::External.new('imap.gmail.com').ping
=> false
irb(main):003:0>
Okay, that's strange. Can you find the appropriate ping command from the case statement below and run it in your terminal?
case RbConfig::CONFIG['host_os']
when /linux/i
`ping -c 1 -W 5 imap.gmail.com -i 1`
when /aix/i
`ping -c 1 -w 5 imap.gmail.com`
when /bsd|osx|mach|darwin/i
`ping -c 1 -t 5 imap.gmail.com`
when /solaris|sunos/i
`ping imap.gmail.com 5`
when /hpux/i
`ping imap.gmail.com -n1 -m5`
when /win32|windows|msdos|mswin|cygwin|mingw/i
`ping -n 1 -w 5000 imap.gmail.com`
else
`ping imap.gmail.com`
end
Then, tell me the output of
$ echo $?
Specifically, I'd like to see what the output of the ping command is, and whether it exits successfully or not.
I'm on Linux (Void Linux; using libressl instead of openssl, and musl rather than glibc, if that makes a difference).
If I run:
ping -c 1 -W 5 imap.gmail.com -i 1
the output is:
ping: unknown host -i
(though running ping -c 1 -W 5 imap.gmail.com
, produces:
PING gmail-imap.l.google.com (209.85.200.109) 56(84) bytes of data.
64 bytes from jl-in-f109.1e100.net (209.85.200.109): icmp_seq=1 ttl=44 time=120 ms
--- gmail-imap.l.google.com ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 120.149/120.149/120.149/0.000 ms
)
$ echo $?
2
[ For comparison, if I do the same on my Arch Linux machine, I get:
$ ping -c 1 -W 5 imap.gmail.com -i 1
PING gmail-imap.l.google.com (209.85.147.108) 56(84) bytes of data.
64 bytes from jg-in-f108.1e100.net (209.85.147.108): icmp_seq=1 ttl=44 time=103 ms
--- gmail-imap.l.google.com ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 103.453/103.453/103.453/0.000 ms
and
$ echo $?
0
]
That's interesting. The case statement I provided previously was adapted from the Net::Ping::External
class provided by the net/ping gem that Little Red Flag depends on.
I don't know why it appends the -i
argument to the end of the command; a quick glance at the GNU ping man page indicates that the -i
option should go before the destination anyway, so I'd consider it a bug in net/ping.
Seeing as how that project has unmerged PRs going as far back as last December, and this project doesn't really need to specify ping intervals in the first place, I may just lift that class out of net/ping directly and adapt it for use in this daemon.
Thanks for the vigilance; expect a release in the next couple hours.
Gem has been updated to v0.1.2; please let me know if this works better for you.
With a working .mbsynrc in the regular place (~/.mbsyncrc), I tried running
littleredflag -a
, but I just get:imap.gmail.com unreachable. Trying again
over and over again.
--verbose
didn't reveal anything additional.