• [^] # Re: passer par un service

    Posté par (site web personnel) . En réponse au message Exécuter des scripts shell au démarrage et extinction d'un PC. Évalué à 8.

    Et si on inversait la logique inversée pour la (re)mettre à l'endroit ? J'ai des choses comme ça localement :

    [Unit]
    Description=<redacted>
    Documentation=<redacted>
    Before=systemd-poweroff.service
    DefaultDependencies=no
    [Service]
    Type=oneshot
    ExecStart=/usr/sbin/one-thing
    ExecStart=/usr/sbin/another-one-if-needed
    [Install]
    WantedBy=poweroff.target
    

    et :

    [Unit]
    Description=<redacted>
    Documentation=<redacted>
    Before=systemd-reboot.service
    DefaultDependencies=no
    [Service]
    Type=oneshot
    ExecStart=/usr/sbin/yet-another-thing
    [Install]
    WantedBy=reboot.target
    

    Debian Consultant @ DEBAMAX