Dear list,
Please see below for the follow up. I accidentally only replied to Greg
in my previous response. I am glad to report that this issue is now
resolved.
Thanks!
--- Begin Message ---
Thank you again for staying with me.
I installed nut via pkg in FreeBSD 14.3-RELEASE. It is 2.8.2_1 version that is
installed.
One thing I tried last night was trying su with the -m as you suggested below,
and I got this:
# su -m nut -c '/usr/local/bin/mailme baz bar foo'
su: /usr/local/bin/mailme: Permission denied
It is weird, because /usr/local/bin/mailme has permissions set at 755, although
owned by the root. It was actually a symlink to /root/scripts/mailme.sh which
has the same permissions set at 755; however, since the /root directory's
permissions are 750, I thought it created the problem. Therefore, I unlinked
the symlink and copied the script under /usr/local/bin/mailme instead. Then,
the following worked:
# su -m nut /usr/local/bin/mailme foo baz bar
I tried the power outage simulation again after this, and I am happy to report
that I now get emails from the UPS regarding the events, at least on battery
and online ones that I tested so far.
Thank you so much for your help and time!
On Sunday, January 11th, 2026 at 6:08 AM, Greg Troxel via Nut-upsuser
<[email protected]> wrote:
>
>
> hakayova via Nut-upsuser [email protected] writes:
>
> > > - check that the script is 755 or 555 permissions
> >
> > Indeed this was a problem. I modified the permissions from 750 to 755.
>
>
> And below you seem to have more permissions problems. If using ports,
> that should set things up right, but it's tricky. The pkgsrc entry
> (NetBSD) may be helpful, perhaps more to the port maintainer.
>
> > > - become the nut user with su, /bin/sh, and clear out the environment.
> > > Cannot do it in FreeBSD, it appears.
> > > # su nut
> > > This account is currently not available.
> > > # su -l nut /usr/local/bin/mailme
> > > su: no directory
> > > # cat /etc/passwd | grep nut
> > > nut:*:316:316:Network UPS Tools user:/nonexistent:/usr/sbin/nologin
>
>
> Read the man page for su: https://man.freebsd.org/cgi/man.cgi?query=su
I did, a few times, but I suspect what I get from that is not what you get when
we read it.
> Use -m. Then use env to adjust the environment, so that PATH is the
> system default.
> > > - read /var/log/messages and /var/log/maillog, or however you spell
> > > those logs on your system
> > > Thanks to this pointer, I realized that upsd.conf and upsmon.conf were
> > > owned by root and could not be accessed by the nut user. I changed the
> > > ownership of them and set permissions to 750. The error messages in
> > > /var/log/messages disappeared after that.
> >
> > /var/log/maillog does not show any entry with the power outage
> > simulation, likely becuase the nut user cannot find and execute the
> > mailme script as described above.
>
>
> So what happens after you fixed your permissions problems?
>
> How did you install nut?
>
> _______________________________________________
> Nut-upsuser mailing list
> [email protected]
> https://alioth-lists.debian.net/cgi-bin/mailman/listinfo/nut-upsuser
--- End Message ---
_______________________________________________
Nut-upsuser mailing list
[email protected]
https://alioth-lists.debian.net/cgi-bin/mailman/listinfo/nut-upsuser