:: Re: [DNG] ideas for system startup …
Góra strony
Delete this message
Reply to this message
Autor: Gregory Nowak
Data:  
Dla: dng
Temat: Re: [DNG] ideas for system startup (was: Init scripts in packages)
On Fri, Aug 07, 2015 at 01:58:19PM +0100, Rainer Weikusat wrote:
> As someone else pointed out, the control flow code could be abstracted
> away into some kind of 'universal init script' and individual ones would
> just need to define the start and stop commands. And there's nothing
> horrible about that because anything which can't easily be done with the
> Bourne shell language is supposed to provided in from of a 'process/
> service management command' written in C which can be used as part of a
> complex service invocation command (the one not mentioned so far creates
> a listening AF_UNIX stream socket and executes a program for each
> connection --- much like inetd but with the 4.2BSD "have to get the
> number of processes down, the kernel can't handle that many"
> optimizations).
>
> The general idea would be
>
> 1) Keep a relatively simple init which kicks off execution of commands in
>    response to 'change the system state' request and nothing else (get
>    rid of as much of /etc/inittab as possible at some point in time)


This is something that systemd did, and one of the things about it
that really ticked me off. Let me provide a couple of examples:

1. One of the things I did when playing with debian jessie was to
install a virtual machine which would be accessed only via serial
console and ssh (this is a real use case for me). I discovered that
there is no /etc/inittab in debian jessie! Second, I discovered that
while I can remove agetty on tty1, I can't do so on tty2-tty6, because
systemd insists I should have a login console wherever possible.

2. I want ctrl+alt+del to do shutdown -h, instead of shutdown -r
(another real use case on another virtual system). I couldn't figure
out a way to do this in debian jessie.

Now, what you proposed above from what I understand should work for my
first example. The admin would do something like tty1.agetty stop,
followed by tty1.agetty disable. Nice, simpler then open inittab in an
editor, and commenting out lines, followed by telinit q. However, I
don't see how your proposal above would deal with defining what
ctrl+alt+del does per my second example. Handling such events isn't
as simple as starting/stopping a daemon with a universal init
script. Since you mentioned getting rid of most of inittab but not all
of it, would ctrl+alt+del be one of the things you envision inittab
still being useful for?

Greg


--
web site: http://www.gregn.net
gpg public key: http://www.gregn.net/pubkey.asc
skype: gregn1
(authorization required, add me to your contacts list first)
If we haven't been in touch before, e-mail me before adding me to your contacts.

--
Free domains: http://www.eu.org/ or mail dns-manager@???