Skip to contentSkip to conversation

depinit

DISCUSSION Luke Kenneth Casson Leighton 4 participants 10 messages May 22, 2005 – May 24, 2005 SELinux security module

lore
Share & tools
lore
#0 lore raw

hiya people,

i have come across someone who unbelievably is completely disconnected from the free software community, despite the fact that he has come up with an absolutely invaluable core piece of software.

richard lightman, is the author of depinit, and by complete coincidence i happen to be working at the same tiny company in farnham, uk, that he is working for.

despite depinit being a core critical component of linux from scratch, and thence, for some time, in gentoo, he has received XXXX-ALL feedback on depinit - despite it being the only real significant advance in unix system service maintenance since sysinit!

so.

question for you.

would it be worth anybody's while for me to work with richard to add support for selinux into depinit?

e.g. is anyone _not_ doing gentoo/hardened because they're using depinit? would anyone _use_ depinit in gentoo/hardened _if_ it had support for selinux? FC? anyone?

don't think, btw, that i'd be offended to not receive any response, because i realise quite how much work is involved :)

l.

Signature · 8 lines
--
<a href="http://lkcl.net">http://lkcl.net</a>
--

--
This message was distributed to subscribers of the selinux mailing 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

On Sunday 22 May 2005 13:42, Luke Kenneth Casson Leighton enlightened us thusly:

Quoted 9 lines

hiya people,

i have come across someone who unbelievably is completely disconnected from the free software community, despite the fact that he has come up with an absolutely invaluable core piece of software.

richard lightman, is the author of depinit, and by complete coincidence i happen to be working at the same tiny company in farnham, uk, that he is working for.

I've heard of this. I think IBM came up with something similar that used make to compute dependencies.

Quoted 4 lines

despite depinit being a core critical component of linux from scratch, and thence, for some time, in gentoo, he has received XXXX-ALL feedback on depinit - despite it being the only real significant advance in unix system service maintenance since sysinit!

Please translate "XXXX-ALL" for me.

Kurt

--
This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.

#8 lore raw
In reply to Luke Kenneth Casson Leighton
Quoted 2 lines · Luke Kenneth Casson Leighton

despite depinit being a core critical component of linux from scratch, and thence, for some time, in gentoo, he has received

I'm not sure where you heard this; Gentoo has always used sysvinit. Depinit isn't even in the portage tree.

Signature · 8 lines
Chris PeBenito
<[email protected]>
Developer,
Hardened Gentoo Linux
Embedded Gentoo Linux
 
Public Key: http://pgp.mit.edu:11371/pks/lookup?op=get&search=0xE6AF9243
Key fingerprint = B0E6 877A 883F A57A 8E6A  CB00 BC8E E42D E6AF 9243
#9 lore raw
Quoted 6 lines · Chris PeBenito
Quoted 2 lines · Luke Kenneth Casson Leighton

despite depinit being a core critical component of linux from scratch, and thence, for some time, in gentoo, he has received

I'm not sure where you heard this; Gentoo has always used sysvinit. Depinit isn't even in the portage tree.

odd. time to read more carefully:

	  http://mail.lug.lk/lurker/message/20050428.084821.4711d463.en.html

yep, you're absolutely right - it describes lfs as being similar to gentoo in that it's a source-code based distro, and describes _lfs_ as having 3 startup options - one of them being depinit.

i'm _sure_ i've also seen one other message about depinit being one of the early options for gentoo (a lfs derivative), and people going "hurrah" when it was removed in favour of sysvinit.

l.

--
This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.

#2 lore raw
In reply to Kurt Wall

[advance notice for busy people: contents of this message mostly off-topic]

Quoted 8 lines · Kurt Wall

On Sunday 22 May 2005 13:42, Luke Kenneth Casson Leighton enlightened us thusly:

Quoted 6 lines

hiya people,

i have come across someone who unbelievably is completely disconnected from the free software community, despite the fact that he has come up with an absolutely invaluable core piece of software.

Quoted 6 lines
Quoted 3 lines

richard lightman, is the author of depinit, and by complete coincidence i happen to be working at the same tiny company in farnham, uk, that he is working for.

I've heard of this. I think IBM came up with something similar that used make to compute dependencies.

i've seen a research paper by sun microsystems, too.

also there's always NT's MSRPC-controlled "svcctl", the format of which also allows you to specify service interdependencies.

... and yet linux is still, despite the best efforts of the linux standards base, still living with something cobbled together from nearly 30 years ago.

at least redhat and suse (and probably others i don't know much about) service startup scripts are making an effort to be LSB compliant.

my debian-based laptop takes TWO MINUTES to get to a console login because of the services it runs. that's a _joke_.

anyway - all of this is off-topic.

i may have a requirement for utilising depinit instead of debian /etc/init.d and /sbin/init - because i believe it to be much more capable of doing fast boot-times.

one of the other requirements is selinux.

one plus one equals a whole boat-load more work.

if anyone _else_ is interested to see depinit be selinux'd, such that i would end up with testers and potential contributors, i'd be more inclined to bother.

Quoted 6 lines
Quoted 4 lines

despite depinit being a core critical component of linux from scratch, and thence, for some time, in gentoo, he has received XXXX-ALL feedback on depinit - despite it being the only real significant advance in unix system service maintenance since sysinit!

Please translate "XXXX-ALL" for me.

... not on-list :)

pick any bad word you like in the language of your choice - it'll do *cackle*

l.

--
This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.

#3 lore raw
Quoted 7 lines · Luke Kenneth Casson Leighton

i may have a requirement for utilising depinit instead of debian /etc/init.d and /sbin/init - because i believe it to be much more capable of doing fast boot-times.

one of the other requirements is selinux.

one plus one equals a whole boat-load more work.

The current Fedora patch to add SELinux support to SysVinit is all of 318 lines. 150 lines of that is one large chunk of added subroutines you can use yourself, another 15 is adding all the "should we enable it" testing. 100 lines is adding SELinux support to 'killall' and 'sulogin'.

You're handed most of the code you need, and identifying the correct place to add the 15 lines of checking is pretty easy. It's *not* a boat-load more work.

#5 lore raw
In reply to Luke Kenneth Casson Leighton
Quoted 10 lines · Luke Kenneth Casson Leighton

there _is_ no "start" option or "stop" option to the service startup scripts. if the script dies, the service is assumed to have
died: the signal is caught by depinit (all signals are caught by depinit) and an "action" script e.g. /etc/depinit/sig_chld is called.

if you _want_ the service to stop, you get depinit to automatically send increasingly aggressive levels of signals to the "service" script.

there _is_ no stupid numbering schemes - not the stupid symlinks, and not the stupid runlevels.

This is actually irrelevant (mostly) as far as SELinux is concerned..

Quoted 1 line

everything is _named_. properly.

Again, mostly irrelevant..

Quoted 2 lines

the present policy - init.te, initrc.te - is therefore going to be mostly irrelevant.

Actually *looking* at the .te's shows that *most* of it will, in fact, still be applicable for *any* init-replacment. The *important* part is that the policy address things like "can the init-process access these resources?" and "can the init-process launch the MTA process and have that transition to the proper domain?" (domain-auto-trans does a *lot* of the heavy lifting here - for instance, domains/program/mta.te contains:

domain_auto_trans(initrc_t, sendmail_exec_t, sendmail_t)

So as long as your depinit starts off in something that can get to initrc_t, the kernel doesn't *CARE*. I if an initrc_t fork/exec a sendmail_exec_t, and it transitions to the needed domain.

Hell, I suspect that if you just put a:

/sbin/depinit -- system_u:object_r:initrc_exec_t

in file_contexts, 98% of it will Just Work.

#4 lore raw
In reply to [email protected]
Quoted 10 lines · On Mon, May 23, 2005 at 12:28:54PM -0400, [email protected] wrote:
Quoted 7 lines · Luke Kenneth Casson Leighton

i may have a requirement for utilising depinit instead of debian /etc/init.d and /sbin/init - because i believe it to be much more capable of doing fast boot-times.

one of the other requirements is selinux.

one plus one equals a whole boat-load more work.

Quoted 8 lines

The current Fedora patch to add SELinux support to SysVinit is all of 318 lines. 150 lines of that is one large chunk of added subroutines you can use yourself, another 15 is adding all the "should we enable it" testing. 100 lines is adding SELinux support to 'killall' and 'sulogin'.

You're handed most of the code you need, and identifying the correct place to add the 15 lines of checking is pretty easy. It's *not* a boat-load more work.

sorry, valdis - i was thinking more along the lines of writing the policy.

thank you for the pointers - they're really appreciated.

depinit provides concepts like "start this service group named 'mail'" which will go away and bring up networking and anything else you need.

there _is_ no "start" option or "stop" option to the service startup scripts. if the script dies, the service is assumed to have
died: the signal is caught by depinit (all signals are caught by depinit) and an "action" script e.g. /etc/depinit/sig_chld is called.

if you _want_ the service to stop, you get depinit to automatically send increasingly aggressive levels of signals to the "service" script.

there _is_ no stupid numbering schemes - not the stupid symlinks, and not the stupid runlevels.

everything is _named_. properly.

the present policy - init.te, initrc.te - is therefore going to be mostly irrelevant.

that's where quite a lot of the work would go.

l.

Signature · 8 lines
--
<a href="http://lkcl.net">http://lkcl.net</a>
--

--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to [email protected] with
the words "unsubscribe selinux" without quotes as the message.
#6 lore raw
In reply to [email protected]
Quoted 10 lines · On Mon, May 23, 2005 at 01:58:46PM -0400, [email protected] wrote:
Quoted 8 lines · Luke Kenneth Casson Leighton

there _is_ no "start" option or "stop" option to the service startup scripts. if the script dies, the service is assumed to have
died: the signal is caught by depinit (all signals are caught by depinit) and an "action" script e.g. /etc/depinit/sig_chld is called.

if you _want_ the service to stop, you get depinit to automatically send increasingly aggressive levels of signals to the "service" script.

Quoted 8 lines
Quoted 2 lines

there _is_ no stupid numbering schemes - not the stupid symlinks, and not the stupid runlevels.

This is actually irrelevant (mostly) as far as SELinux is concerned..

Quoted 1 line

everything is _named_. properly.

Again, mostly irrelevant..

*whew*.

Quoted 7 lines
Quoted 2 lines

the present policy - init.te, initrc.te - is therefore going to be mostly irrelevant.

Actually *looking* at the .te's shows that *most* of it will, in fact, still be applicable for *any* init-replacment. The *important* part is that the policy address things like "can the init-process access these resources?"

okay. much appreciated.

i have a bit more confidence to try it :)

l.

--
This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.

#7 lore raw
Quoted 1 line · Luke Kenneth Casson Leighton

i have a bit more confidence to try it :)

The hardest part will be figuring out how depinit fits into the init_t/initrc_t model - the RedHat/Fedora way has 'init' running in init_t, and any /etc/rc*.d/ scripts get launched in initrc_t, and then initrc_t is able to transition to whatever fooserver_t the daemon runs in. If depinit runs scripts to start stuff, just labeling everything so depinit runs as init_t and the scripts as initrc_t will probably be a lot closer to done than you might imagine....

And the *nice* thing is that once you're fairly confident that you've got it at least somewhat close, you can boot in 'permissive' mode, catch all the 'avc' messages, and use 'audit2allow' to help sort out the wreckage.