Skip to content

Instantly share code, notes, and snippets.

@scriptless
Last active August 7, 2022 16:57
Show Gist options
  • Save scriptless/e3b1426e87d746a1d3da69526af26f44 to your computer and use it in GitHub Desktop.
Save scriptless/e3b1426e87d746a1d3da69526af26f44 to your computer and use it in GitHub Desktop.
Systemd - GlusterFS mount on boot service
[Unit]
Description=glusterfs-mount
After=network.target glusterd.service
Requires=glusterd.service
[Service]
RemainAfterExit=true
ExecStartPre=/usr/sbin/gluster volume list
ExecStartPre=/bin/mount -a -t glusterfs
ExecStart=/usr/bin/mountpoint [path to mountpoint]
ExecStartPost=/usr/bin/mountpoint [path to mountpoint]
# Only if mount is required for docker start
# Disable docker.service on boot with systemctl disable docker.service
ExecStartPost=/usr/bin/systemctl start docker.service
Restart=on-failure
RestartSec=10
[Install]
WantedBy=multi-user.target
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment