Service to run user-owned init scripts at boot time?

Todd Zullinger tmz at pobox.com
Fri Jan 30 18:02:05 UTC 2009


Kevin Kofler wrote:
> This should work:
>
> cat>>/etc/rc.d/rc.local <<EOF
> for i in /home/*/.rc.local ; do
> user=${i#/home/}
> user=${user%/.rc.local}
> su $user -c $i
> done
> EOF

If you have SELinux enabled, won't these user scripts pick up the
wrong contexts and such?  I've got a few things in rc.local that I
start up for users and instead of su, I have something like this:

runcon user_u:system_r:unconfined_t -- runuser -l -c "$command" $user

Maybe that's overkill though? :)

-- 
Todd        OpenPGP -> KeyID: 0xBEAF0CE3 | URL: www.pobox.com/~tmz/pgp
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
As long as people will accept crap, it will be financially profitable
to dispense it.
    -- Dick Cavett, in "Playboy", 1971

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 542 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/fedora-list/attachments/20090130/435a57ee/attachment-0001.sig>


More information about the fedora-list mailing list