J. R. Swab

How to Run Syncthing as a Daemon on OpenBSD

Categories: [Technology], [How To], [OpenBSD]

  1. Install Syncthing pkg_add syncthing
  2. Enable Syncthing rcctl enable syncthing
  3. Update Daemon flag vi /etc/rc.d/syncthing, add -home=/var/syncthing
  4. Run Syncthing once to create initial files: /etc/rc.d/syncthing start
  5. Stop Syncthing after after a few minutes: /etc/rc.d/syncthing stop
  6. Update login.conf: vi /etc/login.conf; add syncthing:\ :openfiles-max=60000:\ :tc=daemon:
  7. Generate the binary: cap_mkdb /etc/login.conf
  8. Add kern.maxfiles=80000 to /etc/sysctl.conf
  9. Run sysctl kern.maxfiles=80000 to set it immediately
  10. Set ownership on Syncthing directory: chown -R _syncthing:wheel /var/syncthing