Unable to run in linux background using headscale.service #429

Closed
opened 2025-12-29 01:29:02 +01:00 by adam · 6 comments
Owner

Originally created by @m4passion on GitHub (Feb 9, 2023).

Originally created by @m4passion on GitHub (Feb 9, 2023).
adam added the bug label 2025-12-29 01:29:02 +01:00
adam closed this issue 2025-12-29 01:29:02 +01:00
Author
Owner

@darientops commented on GitHub (Feb 9, 2023):

Same here :(

Error initializing error="failed to read or create private key: failed to save private key to disk: open /etc/headscale/private.key: read-only file system"

Installed following the guide at: https://github.com/juanfont/headscale/tree/main/docs

@darientops commented on GitHub (Feb 9, 2023): Same here :( `Error initializing error="failed to read or create private key: failed to save private key to disk: open /etc/headscale/private.key: read-only file system"` Installed following the guide at: https://github.com/juanfont/headscale/tree/main/docs
Author
Owner

@huskyii commented on GitHub (Feb 10, 2023):

@MDQ0512 please paste your full headscale.service and detail log. you can get detail log using journalctl.

@darientops If you use the example systemd service file from document, then try sudo chown -R headscale:headscale /etc/headscale

@huskyii commented on GitHub (Feb 10, 2023): @MDQ0512 please paste your full headscale.service and detail log. you can get detail log using journalctl. @darientops If you use the example systemd service file from document, then try `sudo chown -R headscale:headscale /etc/headscale`
Author
Owner

@coding2dawn commented on GitHub (Feb 12, 2023):

This issue can be done by running the command sudo headscale serve to generate the private key.

I guess you were using a sudo user to run headscale in the background with systemd.

@coding2dawn commented on GitHub (Feb 12, 2023): This issue can be done by running the command `sudo headscale serve` to generate the private key. I guess you were using a sudo user to run headscale in the background with systemd.
Author
Owner

@coding2dawn commented on GitHub (Feb 12, 2023):

@MDQ0512 @darientops
You can also replace the private key, the noise private key, and the db_path with /var/lib/headscale/ instead of ./filename
It worked for me.

@coding2dawn commented on GitHub (Feb 12, 2023): @MDQ0512 @darientops You can also replace the private key, the noise private key, and the db_path with _/var/lib/headscale/_ instead of _./filename_ It worked for me.
Author
Owner

@kradalby commented on GitHub (Feb 12, 2023):

This is not an issue, but a support question, please continue the conversation on Discord.

@kradalby commented on GitHub (Feb 12, 2023): This is not an issue, but a support question, please continue the conversation on Discord.
Author
Owner

@dev286 commented on GitHub (Oct 23, 2024):

I get this issue in Ubuntu 24.04 / Headscale 0.23.0 (also in 22.3 alpha 3/5/9).

sudo headscale serve returns this:
WRN Failed to read configuration from disk error="While parsing config: yaml: line 12: did not find expected key"
2024-10-23T07:23:11Z FTL ../runner/work/headscale/headscale/cmd/headscale/cli/root.go:48 > Error loading config error="fatal error reading config file: While parsing config: yaml: line 12: did not find expected key"

I do have this in the config file: /var/lib/headscale/

I followed the official install docs.

@dev286 commented on GitHub (Oct 23, 2024): I get this issue in Ubuntu 24.04 / Headscale 0.23.0 (also in 22.3 alpha 3/5/9). _sudo headscale serve_ returns this: WRN Failed to read configuration from disk error="While parsing config: yaml: line 12: did not find expected key" 2024-10-23T07:23:11Z FTL ../runner/work/headscale/headscale/cmd/headscale/cli/root.go:48 > Error loading config error="fatal error reading config file: While parsing config: yaml: line 12: did not find expected key" I do have this in the config file: /var/lib/headscale/ I followed the official install docs.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/headscale#429