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
Gene Heskett
2021-Mar-07 21:35 UTC
[Nut-upsuser] Request For Additional Status Confirmation
On Sunday 07 March 2021 15:13:58 Roger Price wrote:> 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). > > > > - Tim > > Then ? su -c "/usr/local/bin/myscript" nut ? looks like the best > choice. RogerDoes that syntax work? I've always used: su username -c "nano file to be edited" Curious... Cheers, Gene Heskett -- "There are four boxes to be used in defense of liberty: soap, ballot, jury, and ammo. Please use in that order." -Ed Howdershelt (Author) If we desire respect for the law, we must first make the law respectable. - Louis D. Brandeis Genes Web page <http://geneslinuxbox.net:6309/gene>
Actually, su nut -c <script> . . . or it just runs as root, since you have not given it any other userid . . . On March 7, 2021 2:13:58 PM CST, Roger Price <roger at rogerprice.org> wrote:>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). >> >> - Tim > >Then ? su -c "/usr/local/bin/myscript" nut ? looks like the best choice. Roger-- 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/85d8299b/attachment-0001.htm>
Harlan Stenn
2021-Mar-07 23:04 UTC
[Nut-upsuser] Request For Additional Status Confirmation
On 3/7/2021 3:02 PM, Tim Dawson wrote:> Actually, su nut -c <script> . . . or it just runs as root, since you > have not given it any other userid . . .Check the man page for your OS. The above is right for linux, not for *BSD. It may be different for other OSes. H --> On March 7, 2021 2:13:58 PM CST, Roger Price <roger at rogerprice.org> wrote: > > 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). > > - Tim > > > Then ? su -c "/usr/local/bin/myscript" nut ? looks like the best choice. Roger > > > -- > Sent from my Android device with K-9 Mail. Please excuse my brevity. > > _______________________________________________ > Nut-upsuser mailing list > Nut-upsuser at alioth-lists.debian.net > https://alioth-lists.debian.net/cgi-bin/mailman/listinfo/nut-upsuser >