Solved checking for shutdown.bsd... no


After more than 20 years, I'm in process to move from Linux to FreeBSD, and I'm checking every piece of software that I need to use on this new environment.

One thing that is preventing me to make the switch is this software:

This is a "port" of APC to a particular model of nobreak that exists only in Brazil. It works like a charm in Linux, but when I try to compile it in FreeBSD (11), I've got this error:

$ ./configure
checking for true... /usr/bin/true
checking for false... /usr/bin/false
checking build system type... x86_64-unknown-freebsd11.0
checking host system type... x86_64-unknown-freebsd11.0
checking for g++... g++
checking whether the C++ compiler works... yes
checking for C++ compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking for gcc... gcc
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking how to run the C preprocessor... gcc -E
checking for a BSD-compatible install... /usr/bin/install -c
checking for gawk... gawk
checking for library containing strerror... none required
checking for shutdown... no
checking for shutdown.bsd... no
configure: error: Missing required tool; need any one of: shutdown shutdown.bsd

So, what do I need to install/load/whatever in the system in order to have this "shutdown/shutdown.bsd" recognizable?

It sounds like the configure script is broken somehow on your system. sysutils/apcupsd specifies the path to shutdown directly via env ac_cv_path_SHUTDOWN=/sbin/shutdown ./configure. Maybe this will work for you too?

Thanks for reply.

Actually no, but your reply gave me an idea...

I ran ./configure again, but this time using "sudo", and then the "shutdown" was found in the system. I never needed to run ./configure as root before, so I guess that this is a FreeBSD feature in this particular case.

Thank you very much!
The default PATH for non-root users doesn't include /sbin /usr/sbin /usr/local/sbin so any binaries in those directories won't be found unless the full path to them is specified. If you add those directories to your shell's PATH then you'll be able to run the ./configure properly.