-
-
Save shanmuha/82171408704e9fd2912b7c0d418d7578 to your computer and use it in GitHub Desktop.
A systemd service to manage a Google Cloud Storage bucket mounted with GCSFuse
This file contains hidden or 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
# https://github.com/GoogleCloudPlatform/gcsfuse | |
# put this file as /etc/systemd/system/gcsfusemount.service and then `systemctl enable gcsfusemount.service` | |
# | |
[Unit] | |
Description=Google Cloud Storage FUSE mounter | |
After=local-fs.target network-online.target google.service sys-fs-fuse-connections.mount | |
Before=shutdown.target | |
[Service] | |
Type=forking | |
User=tomcat | |
Environment=BUCKET=gcs-bucket-name | |
Environment=MOUNT_POINT=/some/directory | |
#Environment=GOOGLE_APPLICATION_CREDENTIALS=/path/to/credentials.json | |
ExecStart=/usr/bin/gcsfuse $BUCKET $MOUNT_POINT | |
ExecStop=/bin/fusermount -u $MOUNT_POINT | |
Restart=always | |
[Install] | |
WantedBy=multi-user.target |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment