Skip to content

Instantly share code, notes, and snippets.

@Cremator
Created April 8, 2025 11:51
Show Gist options
  • Save Cremator/fa518ce60c9543ba7fb8e25ef9bb17dc to your computer and use it in GitHub Desktop.
Save Cremator/fa518ce60c9543ba7fb8e25ef9bb17dc to your computer and use it in GitHub Desktop.
Use systemd unit to check for active MDS ceph cluster
[Unit]
Description=Check for active MDS
Requires=ceph.target
[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=/bin/bash -c "until ceph fs status -f json | jq -e \'.mdsmap[0].state == \"active\"\'; do sleep 1s; done"
Restart=on-failure
[Install]
WantedBy=multi-user.target
@Cremator
Copy link
Author

Cremator commented Apr 8, 2025

fstab:
[email protected]=/ /cephfs ceph noatime,_netdev,fsc=cephfs,rasize=268435456,dirstat,rbytes,x-systemd.requires=ceph-mds-active.service,x-systemd.device-timeout=30,x-systemd.mount-timeout=30 0 0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment