[Unit] Description=Ejecutar Mi Script en el Apagado DefaultDependencies=no Before=shutdown.target reboot.target halt.target [Service] Type=oneshot ExecStart=/opt/raspberry_scripts/off.py RemainAfterExit=true [Install] WantedBy=halt.target reboot.target shutdown.target