:: Re: [DNG] What is an init system?
トップ ページ
このメッセージを削除
このメッセージに返信
著者: Ralph Ronnquist
日付:  
To: dng
題目: Re: [DNG] What is an init system?
On Thu, May 16, 2024 at 11:24:23AM +0200, Didier Kryn wrote:
> 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?


I think it is that the parallel start applies to links of the same
number; i.e. all S01* links start in parallel, then when they are
ready the S02* links start in parallel and so forth. That numbering is
derived from the dependency declarations in the LSB headers so that
when A depends on B the the link number for A is greater than the link
number for B.

Ralph.

>
> --     Didier
>
> _______________________________________________
> Dng mailing list
> Dng@???
> https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng