Help, bash is defending itself somehow!!

Try the python os object? Don't think it cares, completely avoiding sudo is rather suicidal though but you can setup a group for NOPASSWD.

import os
os.system("sudo systemctl restart php-fm")

On Sun, Nov 20, 2022 at 11:51 AM Charles Polisher <chas@chasmo.org> wrote:


On 11/19/22 08:32, Chris Miller wrote:
Hi Folks,

This should be easy ... And I'm sure I've done it before. But either Fedora has changed or I have, and I'm not committing either way. (-:

I have a script to bounce the web-server and php-fpm with systemd and I'd like to be able to do this without "sudo" or a terminal tab permanently logged on as root. Seems like I should be able to set the script "setuid" and anybody should be able to run it. I can't seem to make it work.

In the alternative, it seems like I should be able to delegate certain services to user control with systemd, like "systemctrl restart httpd", but the discussions I've found on that are hideously complex, and I'm not really interested in going down any of those rabbit holes. It can't be this difficult ... I mean, wasn't this one of the original justification for systemd?

Why can't bash scripts be SUID?
https://www.vidarholen.net/contents/blog/?p=30

Why is SUID disabled for shell scripts but not for binaries?
https://security.stackexchange.com/questions/194166/why-is-suid-disabled-for-shell-scripts-but-not-for-binaries


_______________________________________________
Lug-nuts mailing list -- lug-nuts@bigbrie.com
To unsubscribe send an email to lug-nuts-leave@bigbrie.com