-
Notifications
You must be signed in to change notification settings - Fork 89
/
gcsf.service
27 lines (24 loc) · 1.2 KB
/
gcsf.service
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# Systemd service configuration for mounting GCSF.
# Can be placed in /etc/systemd/system/ or in other places[0]. Remember to set
# GCSF_(SESSION|MOUNTPOINT) to the correct values, and also set the full path
# to the gcsf binary.
#
# [0](https://unix.stackexchange.com/questions/224992/where-do-i-put-my-systemd-unit-file)
[Unit]
Description=GCSF
Documentation="https://github.com/harababurel/gcsf"
After=network.target
[Service]
Type=simple
Environment=RUST_BACKTRACE=1
Environment=GCSF_MOUNTPOINT="/path/to/some/mount/point"
Environment=GCSF_SESSION="some_session_name"
ExecStart=/full/path/to/gcsf mount $GCSF_MOUNTPOINT -s $GCSF_SESSION
ExecStop=/bin/fusermount -u $GCSF_MOUNTPOINT
User=some_user_name
# Set KillMode to "control-group": after ExecStop is executed, all remaining processes will be killed.
# Normally, GCSF will die by itself after the fusermount command is executed, but in some cases (such as during start-up while still receiving initial data from the Drive API), fusermount will fail (as expected, since the file system is not mounted yet) and the gcsf process will continue running. In that case, systemd should kill it.
KillMode=control-group
Restart=on-failure
[Install]
WantedBy=multi-user.target