:: Re: [DNG] What is an init system?
Startseite
Nachricht löschen
Nachricht beantworten
Autor: Didier Kryn
Datum:  
To: dng
Betreff: Re: [DNG] What is an init system?
Le 16/05/2024 à 04:35, Hector Gonzalez Jaime via Dng a écrit :
>
> On 5/15/24 19:39, Steve Litt wrote:
>> al3xu5 via Dng said on Wed, 15 May 2024 08:59:49 +0200
>>
>>> Wed, 15 May 2024 02:10:14 -0400 - Steve Litt
>>> <slitt@???>:
>>>> I didn't know about startpar. Thanks for the info. If startpar
>>>> existed and worked in January 2014, it eliminated any excuse the
>>>> "dd's" had for switching to systemd.
>>> It has been separated from sysvinit-tools at Wed, 19 Feb 2014 22:15:02
>>> +0100, which means it already existed before...
>>> https://metadata.ftp-master.debian.org/changelogs//main/s/startpar/startpar_0.65-1_changelog
>>>
>> In other words, poettering and the dds KNEW you could do (feature name
>> parallel-instantiation) with sysvinit, but withheld this info from the
>> general public and in fact lied ("you need systemd to do
>> parallel-instantiation"). When Don Armstrong cast his bragged about
>> tie-breaking vote for systemd, and before he removed posting rights
>> from me and many others, he knew this was a lie. Now I'm really pissed.
>>
>> This puts sysvinit in a better light. Combine this with the short init
>> script Martin showed us, and my only remaining objection to sysvinit is
>> that the daemons need to background themselves.
>>
> You can background those with a kludge like this:
>
> #! /bin/sh
> # kFreeBSD do not accept scripts as interpreters, using #!/bin/sh and
> sourcing.
> if [ true != "$INIT_D_SCRIPT_SOURCED" ] ; then
>     set "$0" "$@"; INIT_D_SCRIPT_SOURCED=true . /lib/init/init-d-script
> fi
> ### BEGIN INIT INFO
> # Provides:          someprogram
> # Required-Start:    $network
> # Required-Stop:     $network
> # Should-Start:
> # X-Start-Before:
> # Default-Start:     S
> # Default-Stop:
> # Short-Description: Start someprogram
> # Description:  Start someprogram as a service
> ### END INIT INFO
> #
>
> DAEMON="someprogram"
> USER="someuser"
> DESC="Some program that needs to run as some user and does not become
> a daemon"
> PIDFILE=none
>
> do_start_cmd() {
>         STATUS=0
>         /bin/su $USER -c "nohup $DAEMON &" || STATUS=$?
>         return $STATUS
> }
>
> do_reload() { call do_start_cmd; }
> do_stop() { killall $DAEMON; }
> do_status() { return 0; }
>
>> SteveT
>>
>> Steve Litt
>>
>> Autumn 2023 featured book: Rapid Learning for the 21st Century
>> http://www.troubleshooters.com/rl21



    Well, all this seems to defeat the concept of dependency of servers
wrt each other. It just start everything in parallel.

    But actually it just should be all like this. Servers should be
smart enough to detect if their running conditions are fulfilled and
wait until they are. And report a reason when they're not ready.

    Conditions may change, like the network is temporarily broken, but
, in the current model, the OS assumes ssh is still ready, while it is
not. Or what does it mean?

--     Didier