feat: usermode systemd service setup script #3

Merged
troed merged 13 commits from nextcloud-fuse-service into main 2026-08-07 14:02:32 +02:00
Owner

Summary

  • Adds scripts/install-service.sh: interactive bash script that installs nextcloudfs as a per-user systemd service.
  • Generates ~/.config/nextcloud-fuse/config.toml (0600, TOML-escaped) with server/username/password/remote_path; copies the built binary to ~/.local/bin/nextcloudfs; writes ~/.config/systemd/user/nextcloud-fuse.service (Restart=on-failure, StartLimit in [Unit], WantedBy=default.target) and enable --now.
  • Subcommands: install (default), update (re-copy binary + restart, ETXTBSY-safe via temp-file rename), start|stop|restart|status, logs, uninstall (keeps config/mount dir).
  • Adds tests/install-service-test.sh: harness with fake systemctl + isolated HOME, 53 assertions incl. TOML round-trip, ETXTBSY regression, and error paths.

Test Plan

  • Harness: 53/53 pass (bash tests/install-service-test.sh)
  • Live on this machine: install → service active, mount live, config 0600, binary in ~/.local/bin
  • restart / stop (unmounts) / start (remounts) / logs verified
  • update after rebuild verified (fixed ETXTBSY)
## Summary - Adds `scripts/install-service.sh`: interactive bash script that installs `nextcloudfs` as a per-user systemd service. - Generates `~/.config/nextcloud-fuse/config.toml` (0600, TOML-escaped) with server/username/password/remote_path; copies the built binary to `~/.local/bin/nextcloudfs`; writes `~/.config/systemd/user/nextcloud-fuse.service` (Restart=on-failure, StartLimit in [Unit], WantedBy=default.target) and `enable --now`. - Subcommands: `install` (default), `update` (re-copy binary + restart, ETXTBSY-safe via temp-file rename), `start|stop|restart|status`, `logs`, `uninstall` (keeps config/mount dir). - Adds `tests/install-service-test.sh`: harness with fake systemctl + isolated HOME, 53 assertions incl. TOML round-trip, ETXTBSY regression, and error paths. ## Test Plan - [x] Harness: 53/53 pass (`bash tests/install-service-test.sh`) - [x] Live on this machine: install → service active, mount live, config 0600, binary in ~/.local/bin - [x] restart / stop (unmounts) / start (remounts) / logs verified - [x] update after rebuild verified (fixed ETXTBSY)
troed merged commit 44f4448db9 into main 2026-08-07 14:02:32 +02:00
troed deleted branch nextcloud-fuse-service 2026-08-07 14:02:32 +02:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
troed/nextcloud-fuse!3
No description provided.