In order to work as expected, apcupsd-cgi usually requires ld.so.hints inside the web server's chroot directory. The patch below fixes the copy-libs.sh script accordingly and also creates missing directories.
Somebody else needs to commit this as I do not have a CVS account. Index: sysutils/apcupsd/files/copy-libs.sh =================================================================== RCS file: /cvs/ports/sysutils/apcupsd/files/copy-libs.sh,v retrieving revision 1.1.1.1 diff -u -p -u -p -r1.1.1.1 copy-libs.sh --- sysutils/apcupsd/files/copy-libs.sh 25 May 2010 21:56:33 -0000 1.1.1.1 +++ sysutils/apcupsd/files/copy-libs.sh 10 Sep 2020 09:26:20 -0000 @@ -5,6 +5,11 @@ if [ `id -u` != 0 ]; then exit 1 fi +hints_needed=false for i in `ldd /var/www/cgi-bin/apcupsd/upsimage.cgi | sed -e '1,3d' -e 's/^.* \([^ ]*\)$/\1/g'`; do - cp $i /var/www/$i + mkdir -p /var/www$(dirname $i) && cp $i /var/www$i + [ ${i#*ld.so} != ${i} ] && hints_needed=true done +if ${hints_needed}; then + mkdir -p /var/www/var/run && cp /var/run/ld.so.hints /var/www/var/run +fi