:: Re: [DNG] What is an init system?
Página superior
Eliminar este mensaje
Responder a este mensaje
Autor: Hector Gonzalez Jaime
Fecha:  
A: dng
Asunto: Re: [DNG] What is an init system?

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
> _______________________________________________
> Dng mailing list
> Dng@???
> https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng


--
Hector Gonzalez
cacho@???