??????????? # Have the system pause while all the mail elements load,>> ??????????? ? sleep 60 >> ??????????? # and then run the script: >> ??????????? ? sudo /usr/local/bin/reboot_notify >> >> ????? Do you need to get root involved?? If a hacker can substitute >> his reboot_notify for yours, he gets full control. > >> Being such a beginner, I didn't realize I was creating a problem with >> root...I took your advice and removed "sudo"...is that enough, or is >> there something else I should do for security? > > ?????????? Any script in rc.local is probably called by root, so it's > best to follow the example of NUT itself and drop to a non-privileged > with something like > > ? ? ? ? ?? sudo -u nut /usr/local/bin/reboot_notifyI don't understand. I edited the rc.local script to what you indicated ( sudo -u nut ...) and now when the Pi reboots I don't get any messages. I'm afraid I'm too much of a beginner to see what you mean.> > > _______________________________________________ > Nut-upsuser mailing list > Nut-upsuser at alioth-lists.debian.net > https://alioth-lists.debian.net/cgi-bin/mailman/listinfo/nut-upsuser-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://alioth-lists.debian.net/pipermail/nut-upsuser/attachments/20210307/698281be/attachment.htm>
Roger Price
2021-Mar-07 19:01 UTC
[Nut-upsuser] Request For Additional Status Confirmation
On Sun, 7 Mar 2021, Jon Kinne via Nut-upsuser wrote:> I don't understand. I edited the rc.local script to what you indicated ( sudo > -u nut ...) and now when the Pi reboots I don't get any messages. I'm afraid > I'm too much of a beginner to see what you mean.When sudo doesn't do anything, then the problem is usually in the file /etc/sudoers which says who has the authority to issue which commands. See man sudoers. The best approach is to use command visudo as root to modify this file. If you prefer to use emacs as your editor, use command VISUAL=/usr/bin/emacs visudo -f /etc/sudoers There is a detailed visudo tutorial at https://www.digitalocean.com/community/tutorials/how-to-edit-the-sudoers-file Roger