[Unit] Description=Run local commands after boot ConditionFileIsExecutable=/usr/local/bin/local.sh After=multi-user.target [Service] Type=oneshot # below is needed otherwise ExecStop would execute right after start and unmount RemainAfterExit=Yes ExecStart=/usr/local/bin/local.sh ExecStop=/usr/local/bin/local-cleanup.sh [Install] WantedBy=multi-user.target