Skip to content

Instantly share code, notes, and snippets.

@webghostx
Last active February 16, 2021 20:16
Show Gist options
  • Save webghostx/e0504dde0e952f3f97f9ef06c6a34885 to your computer and use it in GitHub Desktop.
Save webghostx/e0504dde0e952f3f97f9ef06c6a34885 to your computer and use it in GitHub Desktop.
Run odrive-agent in background
# systemd user unit to run odrive agent in the background
#
# odrive for linux: https://docs.odrive.com/docs/odrive-sync-agent#install-on-linux
# save this file as:
# ~/.config/systemd/user/odrive.service
# Create folder if not available. Ubuntu recognizes this directory for user units
#
# enable: $ systemctl --user enable odrive.service
# start: $ systemctl --user start odrive.service
# status: $ systemctl --user status odrive.service
#
# check odrive status from cli:
# $ odrive status ## if known binary
# else
# $ "$HOME/.odrive-agent/bin/odrive" status
[Unit]
Description=Run odrive-agent in background
Wants=network-online.target
After=network.target network-online.target
[Service]
Type=forking
ExecStart=%h/.odrive-agent/bin/odriveagent
Restart=on-failure
RestartSec=5
[Install]
WantedBy=default.target
# https://www.freedesktop.org/software/systemd/man/systemd.special.html#Units%20managed%20by%20the%20user%20service%20manager
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment