Roger Price
2021-Mar-07 20:01 UTC
[Nut-upsuser] Request For Additional Status Confirmation
On Sun, 7 Mar 2021, Harlan Stenn wrote:> Why use sudo instead of su for this case?Wouldn't su ask for the login password? This is not practical in rc.local. In addition user nut doesn't have a login password. Roger
Su asks for nothing if executed as root . . . it already knows it has authority, so simply changes the user id the command is run as (as I recall, with "-c" to run a script). - Tim On March 7, 2021 2:01:34 PM CST, Roger Price <roger at rogerprice.org> wrote:>On Sun, 7 Mar 2021, Harlan Stenn wrote: > >> Why use sudo instead of su for this case? > >Wouldn't su ask for the login password? This is not practical in rc.local. >In addition user nut doesn't have a login password. > >Roger > >_______________________________________________ >Nut-upsuser mailing list >Nut-upsuser at alioth-lists.debian.net >https://alioth-lists.debian.net/cgi-bin/mailman/listinfo/nut-upsuser-- Sent from my Android device with K-9 Mail. Please excuse my brevity. -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://alioth-lists.debian.net/pipermail/nut-upsuser/attachments/20210307/5a5fca10/attachment-0002.htm>
Roger Price
2021-Mar-07 20:13 UTC
[Nut-upsuser] Request For Additional Status Confirmation
On Sun, 7 Mar 2021, Tim Dawson wrote:> Su asks for nothing if executed as root . . . it already knows it has > authority, so simply changes the user id the command is run as (as I recall, > with "-c" to run a script). > > - TimThen ? su -c "/usr/local/bin/myscript" nut ? looks like the best choice. Roger
Harlan Stenn
2021-Mar-07 22:58 UTC
[Nut-upsuser] Request For Additional Status Confirmation
On 3/7/2021 12:01 PM, Roger Price wrote:> On Sun, 7 Mar 2021, Harlan Stenn wrote: > >> Why use sudo instead of su for this case? > > Wouldn't su ask for the login password?? This is not practical in rc.local. > In addition user nut doesn't have a login password.rc.local is already being run by root, right? This happens at system startup. H> Roger > > _______________________________________________ > Nut-upsuser mailing list > Nut-upsuser at alioth-lists.debian.net > https://alioth-lists.debian.net/cgi-bin/mailman/listinfo/nut-upsuser >