Repository navigation
Fix systemd service to run with native root privileges - #1
Merged
Merged
Conversation
Co-authored-by: Sbgodin <3691603+Sbgodin@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Verify project setup as a system service
Fix systemd service to run with native root privileges
Feb 18, 2026
Sbgodin
marked this pull request as ready for review
May 27, 2026 04:50
There was a problem hiding this comment.
Pull request overview
This PR adjusts Filurn’s systemd/service execution model to rely on systemd’s native root execution rather than in-command privilege escalation, so cryptsetup/mount-related operations can run correctly in a service context.
Changes:
- Removed the
+execution prefix from the systemd unit’sExecStart. - Removed
sudofrom privileged commands infilurn-mount.sh(umount/cryptsetup/mkfs/mount/etc.).
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
filurn.service |
Simplifies ExecStart by removing the + prefix so the service runs normally under systemd. |
filurn-mount.sh |
Removes sudo usage so privileged operations run directly when invoked by the root-run service. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+9
to
+12
| umount $MAPPER | ||
| cryptsetup close $MAPPER | ||
|
|
||
| sudo cryptsetup open --type plain --cipher aes-xts-plain64 --key-file /dev/urandom "$DISK" "$NAME" | ||
| cryptsetup open --type plain --cipher aes-xts-plain64 --key-file /dev/urandom "$DISK" "$NAME" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The systemd service configuration incorrectly used privilege escalation prefix and sudo commands, preventing proper execution of cryptsetup/mount operations.
Changes
+prefix fromExecStartdirectivesudofrom all commands (umount, cryptsetup, mkfs, mount, rmdir, touch)Context
Systemd services run as root by default. The
+prefix is for privilege escalation from a non-root user context, which doesn't apply here. Thesudocommands would fail in service context due to lack of TTY and authentication unavailability.Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.