Update #8 - Syncthing Systemd Recovery After Upgrade

Date: May 10, 2025
Category: System Maintenance / Automation
Backlink: Update #7 – Syncthing UFW Rule Automation with DDNS Integration

Overview

After performing a system upgrade on the VPS hosting BookStack and Syncthing, it was discovered that Syncthing no longer started correctly under the user-level systemctl --user session. Attempts to restart the service resulted in a Failed to connect to bus: Connection refused error, likely due to the user session being interrupted by the upgrade process.


The Problem

The Solution

Switched Syncthing from a user-level service to a system-wide service tied to the user account.

Steps Taken:

  1. Stopped any failed user service attempts (optional but safe):

    systemctl --user stop syncthing
    
  2. Enabled the system-wide service instead:

    sudo systemctl enable syncthing@<username>.service
    sudo systemctl start syncthing@<username>.service
    
  3. Verified Syncthing is active:

    sudo systemctl status syncthing@<username>.service
    

 Optional Consideration

If future system upgrades disrupt services again, I will consider using a simple systemd timer or cron job to periodically check and restart Syncthing, though this is not currently necessary due to the stability of the system-wide service.


Revision #4
Created 10 May 2025 12:23:38 by Nate Nash
Updated 7 June 2025 00:14:24 by Nate Nash