Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
SYSTEMD files for plexdrive. Ceates a plexdrive mount and then a UnionFS of local and remote content (SEE updated version here: https://github.com/hthighway/scripts/tree/master/plexdrive )
[Unit]
Description=Plexdrive
AssertPathIsDirectory=/mnt/plexdrive
After=network-online.target
[Service]
Type=simple
#
# uid & gid values are for the user that you want to run plexdrive, $id will give you the values for the logged in user
#
ExecStart=/opt/plexdrive/plexdrive -c /home/user/.plexdrive -v 2 -o allow_other --uid=1000 --gid=1000 /mnt/plexdrive
ExecStop=/bin/fusermount -uz /mnt/plexdrive
Restart=on-abort
RestartSec=30
StartLimitInterval=200
StartLimitBurst=5
[Install]
WantedBy=default.target
#
# To monitor the PlexDrive activity use: sudo journalctl -f -u plexdrive
#
[Unit]
Description=UnionFS Mount (plexdrive)
AssertPathIsDirectory=/mnt/media
After=plexdrive.service
Requires=plexdrive.service
PartOf=plexdrive.service
[Service]
Type=forking
User=user
Group=user
ExecStart=/bin/sh /home/user/scripts/unionfs.sh
ExecStop=/bin/fusermount -uz /mnt/media
Restart=on-abort
RestartSec=5
StartLimitInterval=60s
StartLimitBurst=3
[Install]
WantedBy=default.target
#!/bin/sh
unionfs-fuse \
-o cow,allow_other,large_read,statfs_omit_ro,atomic_o_trunc,\
auto_cache,big_writes,default_permissions,splice_move,splice_read,nonempty \
-o uid=1000 -o gid=1000 /mnt/local=RW:/mnt/plexdrive/remote_media=RO /mnt/media
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.