[Pkg-uml-pkgs] Bug#849672: Bug#849672: uml-utilities: boot up delay

Ritesh Raj Sarraf rrs at debian.org
Mon Jan 23 16:09:23 UTC 2017


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

On Mon, 2017-01-23 at 06:44 -0800, Mattia Dongili wrote:
> That code pre-dates me.
> I don't think there was any specific reason other than giving the time
> to the daemon do to whatever it needs to do before calling it a success.

I just looked into the init script.

A better snippet is:

        log_daemon_msg "Starting $DESC" "$NAME"
        if ! start-stop-daemon --start --quiet --pidfile $PIDFILE \
                        --make-pidfile --background --chuid $UML_SWITCH_USER \
                        --exec $DAEMON -- $OPTIONS; then
                log_end_msg 1
                exit 1
        fi

        WAIT=5
        while ! test -e $UML_SWITCH_CTL; do
            sleep 1
            WAIT=$(($WAIT - 1))
            if [ $WAIT -le 0 ]; then
                log_warning_msg "$DAEMON never created control socket $UML_SWITCH_CTL"
                log_end_msg 1
                exit 1
            fi
        done

        chmod 777 $UML_SWITCH_CTL
        log_end_msg 0
        ;;

So, this whole check was done because having a file permission of 777 on
$UML_SWITCH_CTL is required.

I'm not confident why that is needed but my guess is it is needed, because in
the first use case example in README.Debian, a user isn't expected to be part of
the uml-net group.

I guess the more efficient approach would be to change the file umask before
firing the daemon. Then, it should be able to inherit the same attributes (mask
777), without the delay.

I'll mark this as todo and look it after Stretch.

- -- 
Ritesh Raj Sarraf | http://people.debian.org/~rrs
Debian - The Universal Operating System
-----BEGIN PGP SIGNATURE-----

iQIzBAEBCgAdFiEEQCVDstmIVAB/Yn02pjpYo/LhdWkFAliGKrMACgkQpjpYo/Lh
dWl+tg//Xs1O8IAMJMLTceazPUtQgUnI6H1oWIByREGTDb4TdT+XVb3myfURgTsW
lwrTa/rjpPscdl+n+GIyKdyRA1ipZBggdRTsEdWy+BHaUWNSj7AoDbgaK0mdoQms
NwZ52og70lZ7mIe2cOYokyHXBQ4ogLDUWEO4e8T+CPALuYRWaFbuDfrNydu2qvWn
qu7MA8lXcRCNR2DYnV3OucH45QcI3Du15sHSf7nwu1UU9Du1XChJCSeH1BjU1Rh5
cz3aCipGGOAsUdjIRvPh3qj4byQkd+i+ntXp0f1Z3JVoRGLxK2MOaG0NrVn291lK
PxNYH4C0utJSXJ4TRfqVC7AIaaAE/Mob/BxwHuh5mwZyZsEbafSaKPkEXfCwycFk
Hmm0jrBHpdHaUM7gMO0zMWq7YcCsU3Weuspv1nTxCCwYMJwx/OTGCrjUk/9arScA
CnFZi4iL86iZc3FRtlHbtl/dZMZqYr9B+VrCvebHGhuWpdjow1yFQt9y9ssfeGvj
9bPwVPpnrKqyGFikILFNSpVcyQ3muUm0kLOLMjP2kd2nCZv9zm5cgVLGIoAZ351+
Zl0YUGfN6qGi3oUcJea61Nvt/HvlzCDRJxQkgeUXO9p52X0N0hB1P2TPIwjIZnd/
+6L1OF1HOP/SehQ9QbvacoU1ZPEdujimqF7IluflpMT4DTxOo+k=
=LOEw
-----END PGP SIGNATURE-----



More information about the Pkg-uml-pkgs mailing list