Last active
March 14, 2019 19:57
-
-
Save jcollie/60f8b278d1ac5eadb4794db1f4c0e87d to your computer and use it in GitHub Desktop.
systemd services to map RADOS block devices and mount a filesystem
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Unit] | |
Description=Map RBD disk svr03-pgsql | |
Requires=network-online.target | |
After=network-online.target | |
ConditionPathExists=!/dev/rbd/rbd/svr03-pgsql | |
[Service] | |
Type=oneshot | |
RemainAfterExit=yes | |
ExecStart=/usr/bin/rbd map --pool rbd svr03-pgsql | |
ExecStop=/usr/bin/rbd unmap /dev/rbd/rbd/svr03-pgsql | |
[Install] | |
WantedBy=multi-user.target |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Unit] | |
After=rbd-map-rbd-svr03-pgsql.service | |
Requires=rbd-map-rbd-svr03-pgsql.service | |
Before=remote-fs.target | |
Before=postgresql.service | |
[Mount] | |
What=/dev/rbd/rbd/svr03-pgsql | |
Where=/var/lib/pgsql | |
[Install] | |
WantedBy=remote-fs.target |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment