I found out what SuSE did to rc.local
, since Google is my friend
. They created an "/etc/init.d/after.local", a "script with local commands to be executed from init after all scripts of a runlevel have been executed". I appended
Code:
su - root -c /etc/init.d/<my-script>
It still does not work *sigh*.
Quote:
Originally Posted by chrism01
Re suid on scripts; I knew that but from post #9 it looked like powertop is a cpp thus binary exe.
|
It is an (interactive) binary. I took it's output and pasted it into a shellscript. That is what we are talking about in the meantime
.
Quote:
Originally Posted by chrism01
Maybe its different for you, but normally the boot process has to run as root to do all the privileged things it needs to do, although some sub-processes may be run as a different user for their own reasons.
|
Booting openSuSE is done by "systemd", not anymore by sysvinit. I don't know how "systemd" handles users and permissions.
Quote:
Originally Posted by chrism01
On eg RHEL, you'd have have an entry in /etc/rc.d/rc.local like
Code:
su - root -c "cmd args"
This syntax means no passwd or sudo reqd.
|
I know that according to the man page of su the above entered "root" is redundant, but neither a simple "-" nor "- root" works. <edit1> A change of the command to
Code:
su - root -c "cmd >> /home/me/error.txt 2>&1"
brought no further insights either. Grrr. </edit1>
<edit2> Found out why: "su" is asking for a password. I created a test-script and ran that from console. [enter favourite expletives here]. What now?