Skip to content

Instantly share code, notes, and snippets.

@craigafinch
Last active August 7, 2019 06:37
Show Gist options
  • Star 9 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save craigafinch/292f98618f8eadc33e9633e6e3b54c05 to your computer and use it in GitHub Desktop.
Save craigafinch/292f98618f8eadc33e9633e6e3b54c05 to your computer and use it in GitHub Desktop.
A systemd service to manage a Google Cloud Storage bucket mounted with GCSFuse
# https://github.com/GoogleCloudPlatform/gcsfuse
[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=apache
ExecStart=/bin/gcsfuse --key-file=/key/file/path/my-gcs-key.json bucket-name /var/www/html/mysite.com/mount_point
ExecStop=/bin/fusermount -u /var/www/html/mysite.com/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