[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

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



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

Attachment: pgpRB9Uv5LI3m.pgp
Description: PGP signature


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]