Stuart Henderson wrote:
On 2008-11-14, Ivo Chutkin <[EMAIL PROTECTED]> wrote:
Hello misc,
I cannot get ping and traceroute working with bgplg on 4.4 stable.
Both show "failed" on the web interface.
Everything else works perfect.
I followed man pages and checked everything many times and there is no log entries for any errors.

bgplg, as distributed, needs chrooted httpd (it looks for /bin/ping
which is really /var/www/bin/ping with chrooted httpd - but the system
binary is in /sbin/ping so without the chroot it will fail). If you
don't chroot httpd, either chroot it (probably the better option)
or arrange things so bgplg can find a suitable binary in /bin.

If that's not it, carefully double-check permissions on the
ping/traceroute binaries (as mentioned in the manual), they must
be executable by the user running the webserver.
N.B. you have to do this every time you upgrade the OS.


Ivo, aside from the fact that you've not shown all relevant permissions, I'll bite:

$
$ uname -a
OpenBSD earth.raapid.net 4.3 GENERIC#698 i386

$ /var/www/bin/ping -c1 127.0.0.1
ksh: /var/www/bin/ping: Permission denied

$ /sbin/ping -c1 127.0.0.1 PING 127.0.0.1 (127.0.0.1): 56 data bytes
64 bytes from 127.0.0.1: icmp_seq=0 ttl=255 time=0.359 ms
--- 127.0.0.1 ping statistics ---
1 packets transmitted, 1 packets received, 0.0% packet loss
round-trip min/avg/max/std-dev = 0.359/0.359/0.359/0.000 ms

$ mount | grep var
/dev/wd0e on /var type ffs (local, nodev, noexec)
/dev/wd0h on /var/spool/imap type ffs (local, noatime, nodev, nosuid, softdep)

$ ls -l /var/www/bin/ total 964
-r-xr-xr-x  1 root  bin  190272 Mar 12  2008 bgpctl
-r-sr-xr-x  1 root  bin  157408 Mar 12  2008 ping
-r-sr-xr-x  1 root  bin  145312 Mar 12  2008 traceroute

$ sudo mount -u -o exec /var
$ /var/www/bin/ping -c1 127.0.0.1
PING 127.0.0.1 (127.0.0.1): 56 data bytes
64 bytes from 127.0.0.1: icmp_seq=0 ttl=255 time=0.340 ms
--- 127.0.0.1 ping statistics ---
1 packets transmitted, 1 packets received, 0.0% packet loss
round-trip min/avg/max/std-dev = 0.340/0.340/0.340/0.000 ms

$ mount | grep var
/dev/wd0e on /var type ffs (local, nodev)
/dev/wd0h on /var/spool/imap type ffs (local, noatime, nodev, nosuid, softdep)

Read:
http://www.openbsd.org/faq/faq10.html
afterboot(8), httpd(8), bgplg(8), mount(8)

-tico

Reply via email to