[Unit] Description=Run local commands after boot ConditionFileIsExecutable=/usr/local/bin/local.sh #After=multi-user.target After=network.target #Before=gdm.service Before=display-manager.service [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