Sujet : Re: Faking a TTY on a pipe/socketpair
De : rweikusat (at) *nospam* talktalk.net (Rainer Weikusat)
Groupes : comp.unix.programmerDate : 06. Dec 2024, 18:01:49
Autres entêtes
Message-ID : <87zfl8924i.fsf@doppelsaurus.mobileactivedefense.com>
References : 1 2 3 4 5 6 7 8
User-Agent : Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux)
Lawrence D'Oliveiro <
ldo@nz.invalid> writes:
On Thu, 5 Dec 2024 08:19:46 -0000 (UTC), Muttley wrote:
>
On Thu, 5 Dec 2024 02:11:04 -0000 (UTC)
Lawrence D'Oliveiro <ldo@nz.invalid> wibbled:
>
On Wed, 4 Dec 2024 08:34:30 -0000 (UTC), Muttley wrote:
>
Linux is far closer to the unix philosphy (ignoring systemd) ...
>
Which “unix philosophy” would that be?
The one where init does a single task instead of spreading itself
throughout the system ...
>
What “single task” did init do?
>
* Mount filesystems
* Spawn syslog, cron
* Spawn terminal login processes (getty)
* Respawn terminated getty processes
* Monitor other special stuff in inittab
* Spawn random other services, without monitoring their state
* Act as a general catch-all for orphaned processes when they terminate
>
This was all before systemd came on the scene.
Originally, mainly two things: Execute a script to kick off userspace
boot. Call wait in a loop in order to reap zombies.
System V init is somewhat more complicated than that. It has a concept
of numbered run levels and will run a configurable command in response
to runlevel change request. On linux, that's usually the script
/etc/init.d/rc. It also has some process monitoring capabilities: It can
start programs depending on the current runlevel and restart them when
they terminate. This is typically used to run getty processes for real
or virtual terminals and serial lines connected to modems.
Minus some handling of special situations (power failure, ctrl-alt-del
on PCs), that's it. Anything beyond that is done by the rc script.
One could argue that this is already a case of creature feep as process
monitoring and restarting of terminated processes and many other
process invocation management tasks can as well be provided
by dedicated programs. There's no reason to hack all of this (or rather,
some random subset of what could be provided here) into a single
codebase save developer inertia: It's less work to add code to a file
that's already compiled by some build system or to add a new file to a
code base which already has a build system than to create lots of
different, specialized tools.