[NixOS] Restart mount bucket service on failure
This commit is contained in:
@@ -45,6 +45,8 @@ in {
|
||||
serviceConfig = {
|
||||
Type = "simple";
|
||||
RemainAfterExit = true;
|
||||
Restart = "on-failure"; # Restart the service on failure
|
||||
RestartSec = 5; # Wait 5 seconds before restarti
|
||||
ExecStartPre = [
|
||||
"-${pkgs.util-linux}/bin/umount -f ${mount-path}"
|
||||
"${pkgs.coreutils}/bin/mkdir -p ${mount-path}"
|
||||
@@ -63,7 +65,8 @@ in {
|
||||
${pkgs.util-linux}/bin/umount -f "${mount-path}" || true
|
||||
${pkgs.gcsfuse}/bin/gcsfuse --implicit-dirs --key-file "${key-file}" "${bucket-name}" "${mount-path}"
|
||||
fi
|
||||
sleep 60
|
||||
echo "Sleeping"
|
||||
sleep 30
|
||||
done
|
||||
'';
|
||||
User = "root";
|
||||
|
||||
Reference in New Issue
Block a user