Skip to content

Instantly share code, notes, and snippets.

@Klowner
Last active March 4, 2017 21:27
Show Gist options
  • Save Klowner/5457894 to your computer and use it in GitHub Desktop.
Save Klowner/5457894 to your computer and use it in GitHub Desktop.
Per-user systemd service file for Bittorrent Sync (initially developed for use with the bittorrent-sync from AUR)
Instructions for ArchLinux
- Place btsync@.service in /etc/systemd/system
Then for each user:
- Create a .sync directory in the user's home directory
- Create a config file (eg: /usr/bin/btsync --dump-sample-config > ~/.sync/btsync.json)
- Change options:
"storage_path" : "/home/<username>/.sync"
"pid_file" : "/run/user/<userid>/btsync.pid"
choose unique IP for webui listen directive
- Enable the systemd unit: systemctl enable btsync@<username>
- Fire it up, systemctl start btsync@<username>
[Unit]
Description=BTSync for user %I
Requires=network.target
After=network.target
[Service]
Type=simple
User=%I
ExecStart=/usr/bin/btsync --config %h/.sync/btsync.json --nodaemon
[Install]
WantedBy=multi-user.target
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment