On Wed, Nov 16, 2022 at 06:25:16PM +0100, Moviuro wrote: > Hi all, > > I installed smartmontools-7.3 on my new OpenBSD 7.2 system and turned on > mailing in smartd.conf(5): > > DEVICESCAN -m <myemail> -M exec /usr/local/bin/send_smart_mail \ > -M test -s (S/../.././02|L/../../7/03) > > /usr/local/bin/send_smart_mail is a script calling msmtp(1), and which I > also use on other systems (FreeBSD, Archlinux). It just adds the SMART > env variables in an email ($SMARTD_MESSAGE, $SMARTD_FULLMESSAGE, etc.). > > After finishing up with smartd.conf(5), `rcctl restart smartd` causes > these messages in the daemon log: > > smartd[45007]: Test of /usr/local/bin/send_smart_mail to \ > <myemail>: failed (32-bit/8-bit exit status: 32512/127) > smartd[45007]: sh: /etc/smartd_warning.sh: not found > > NB: I never call anything else than cat(1) and msmtp(1) in my > send_smart_mail script; I didn't even know about smartd_warning.sh > script before today. > > So I had to symlink > /usr/local/share/examples/smartmontools/smartd_warning.sh to /etc; > restarting the daemon made it all work. > > I suggest smartmontools be packaged in a way that the smartd_warning.sh > code is available to the smartd(8) daemon. FWIW, archlinux and FreeBSD > package that script respectively: > > * in /usr/share/smartmontools/smartd_warning.sh > * in /usr/local/etc/smartd_warning.sh > > Best regards, >
This does a copy rather than symlink, probably just an oversight. Feedback? OK? Index: Makefile =================================================================== RCS file: /cvs/ports/sysutils/smartmontools/Makefile,v retrieving revision 1.47 diff -u -p -r1.47 Makefile --- Makefile 11 Mar 2022 19:58:02 -0000 1.47 +++ Makefile 16 Nov 2022 17:46:26 -0000 @@ -3,6 +3,7 @@ COMMENT= control and monitor storage sy # XXX at update time check whether C++11 is actually needed DISTNAME= smartmontools-7.3 CATEGORIES= sysutils +REVISION= 0 HOMEPAGE= https://www.smartmontools.org/ Index: pkg/PLIST =================================================================== RCS file: /cvs/ports/sysutils/smartmontools/pkg/PLIST,v retrieving revision 1.9 diff -u -p -r1.9 PLIST --- pkg/PLIST 1 Mar 2022 09:53:01 -0000 1.9 +++ pkg/PLIST 16 Nov 2022 17:47:21 -0000 @@ -26,3 +26,4 @@ share/examples/smartmontools/Example7 share/examples/smartmontools/Example8 share/examples/smartmontools/README share/examples/smartmontools/smartd_warning.sh +@sample ${SYSCONFDIR}/smartd_warning.sh