Skip to contentSkip to conversation

run_init - am I missing something?

DISCUSSION Russell Coker 2 participants 2 messages Feb 9, 2002 – Feb 11, 2002 SELinux security module

lore
Share & tools
lore
#0 lore raw

It seems to me that run_init should just quietly change to system_u:system_r:initrc_t without asking for any passwords if run from system_u:system_r:init_t. That way the same /etc/init.d/* scripts can be used by the sysadmin to restart daemons and also for them to be started automatically on boot.

Is there anything I'm missing here? Is there some need to do otherwise?

Also I've hacked my run_init to just run the program if it's run on a non-SE system so that the same start scripts can be used with an SE kernel or a non-SE kernel. Any good reasons for not doing this?

Signature · 10 lines
http://www.coker.com.au/bonnie++/     Bonnie++ hard drive benchmark
http://www.coker.com.au/postal/       Postal SMTP/POP benchmark
http://www.coker.com.au/projects.html Projects I am working on
http://www.coker.com.au/~russell/     My home page


--
You have received this message because you are subscribed to the selinux list.
If you no longer wish to subscribe, send mail to [email protected] with
the words "unsubscribe selinux" without quotes as the message.
#1 lore raw
Quoted 7 lines · Russell Coker

It seems to me that run_init should just quietly change to system_u:system_r:initrc_t without asking for any passwords if run from system_u:system_r:init_t. That way the same /etc/init.d/* scripts can be used by the sysadmin to restart daemons and also for them to be started automatically on boot.

Is there anything I'm missing here? Is there some need to do otherwise?

When running from system_u:system_r:init_t, you shouldn't need to use run_init at all. There is an automatic domain transition from init_t to initrc_t when running one of the /etc/rc.d/rc* scripts (with the initrc_exec_t type). If you need init to be able to directly run a /etc/init.d script, then you should just apply the initrc_exec_t type to those scripts as well. run_init is only needed to support a secure transition from sysadm_r:sysadm_t.

Quoted 3 lines

Also I've hacked my run_init to just run the program if it's run on a non-SE system so that the same start scripts can be used with an SE kernel or a non-SE kernel. Any good reasons for not doing this?

That's fine.

--
Stephen D. Smalley, NAI Labs
[email protected]

--
You have received this message because you are subscribed to the selinux list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.