[GH-ISSUE #3520] systemd mask/unmask is blocked; service restart at every package upgrade #7411

Open
opened 2026-08-05 01:12:52 -04:00 by saavagebueno · 6 comments
Owner

Originally created by @trharmon0 on GitHub (Mar 16, 2025).
Original GitHub issue: https://github.com/netbirdio/netbird/issues/3520

Originally assigned to: @nazarewk on GitHub.

Describe the problem

I've observed this on Debian 12. I'm not sure about other Debian variants (ex: Ubuntu).

I disable/enable the Netbird service depending on if I'm going to be traveling. I've noticed that if the service is disabled and not running via systems each package upgrade will start the service. Furthermore something about the way the systemd .service file is set up blocks systemctl from being able to mask/unmask.

root:~# systemctl disable --now netbird
root:~# systemctl mask netbird
Failed to mask unit: File /etc/systemd/system/netbird.service already exists.
root:~# file /etc/systemd/system/netbird.service 
/etc/systemd/system/netbird.service: ASCII text

To Reproduce

  1. Default package-based install on Debian 12.
  2. Run the above commands.

Expected behavior

  1. Package upgrades to no (re)start and systemctl-disabled service.
  2. Packaged unit files support being masked/unmasked.

Are you using NetBird Cloud?

No, self-hosted.

NetBird version

root:~# netbird version
0.38.2

Is any other VPN software installed?

No

Debug output

root:~# netbird status -dA
Peers detail:
Events: No events recorded
OS: linux/amd64
Daemon version: 0.38.2
CLI version: 0.38.2
Management: Connected to https://api.netbird.io:443
Signal: Connected to https://signal.netbird.io:443
Relays:
[rels://streamline-us-chi1-1.relay.netbird.io:443] is Available
Nameservers:
FQDN:
NetBird IP:
Interface type: Kernel
Quantum resistance: false
Networks: -
Forwarding rules: 0
Peers count: 0/0 Connected

"As well as the file created by

netbird debug for 1m -AS"

Sorry, I am not able to share that information due to infosec policies.

Additional context

Add any other context about the problem here.

Have you tried these troubleshooting steps?

  • Checked for newer NetBird versions
  • Searched for similar issues on GitHub (including closed ones)
  • Restarted the NetBird client
  • Disabled other VPN software
  • Checked firewall settings
Originally created by @trharmon0 on GitHub (Mar 16, 2025). Original GitHub issue: https://github.com/netbirdio/netbird/issues/3520 Originally assigned to: @nazarewk on GitHub. **Describe the problem** I've observed this on Debian 12. I'm not sure about other Debian variants (ex: Ubuntu). I disable/enable the Netbird service depending on if I'm going to be traveling. I've noticed that if the service is disabled and not running via systems each package upgrade will start the service. Furthermore something about the way the systemd .service file is set up blocks systemctl from being able to mask/unmask. ``` root:~# systemctl disable --now netbird root:~# systemctl mask netbird Failed to mask unit: File /etc/systemd/system/netbird.service already exists. root:~# file /etc/systemd/system/netbird.service /etc/systemd/system/netbird.service: ASCII text ``` **To Reproduce** 1. Default package-based install on Debian 12. 2. Run the above commands. **Expected behavior** 1) Package upgrades to no (re)start and systemctl-disabled service. 2) Packaged unit files support being masked/unmasked. **Are you using NetBird Cloud?** No, self-hosted. **NetBird version** root:~# netbird version 0.38.2 **Is any other VPN software installed?** No **Debug output** root:~# netbird status -dA Peers detail: Events: No events recorded OS: linux/amd64 Daemon version: 0.38.2 CLI version: 0.38.2 Management: Connected to https://api.netbird.io:443 Signal: Connected to https://signal.netbird.io:443 Relays: [rels://streamline-us-chi1-1.relay.netbird.io:443] is Available Nameservers: FQDN: <redacted> NetBird IP: <redacted> Interface type: Kernel Quantum resistance: false Networks: - Forwarding rules: 0 Peers count: 0/0 Connected "As well as the file created by netbird debug for 1m -AS" Sorry, I am not able to share that information due to infosec policies. **Additional context** Add any other context about the problem here. **Have you tried these troubleshooting steps?** - [x] Checked for newer NetBird versions - [x] Searched for similar issues on GitHub (including closed ones) - [x] Restarted the NetBird client - [x] Disabled other VPN software - [x] Checked firewall settings
saavagebueno added the bugsystem-compatibility-issue labels 2026-08-05 01:12:52 -04:00
Author
Owner

@nazarewk commented on GitHub (Mar 17, 2025):

Thanks for the report.

Initially seems like we're putting netbird.service directly into /etc/systemd/system, while we should be symlinking it from /usr/lib/systemd/system instead.

I'll review the packaging best practices and adjust affected packages.

<!-- gh-comment-id:2729264122 --> @nazarewk commented on GitHub (Mar 17, 2025): Thanks for the report. Initially seems like we're putting `netbird.service` directly into `/etc/systemd/system`, while we should be symlinking it from `/usr/lib/systemd/system` instead. I'll review the packaging best practices and adjust affected packages.
Author
Owner

@nazarewk commented on GitHub (Mar 17, 2025):

Will need to update https://github.com/netbirdio/service to render files into /usr/local/lib/systemd/system/ instead of /etc/systemd/system/

<!-- gh-comment-id:2729356103 --> @nazarewk commented on GitHub (Mar 17, 2025): Will need to update https://github.com/netbirdio/service to render files into `/usr/local/lib/systemd/system/` instead of `/etc/systemd/system/`
Author
Owner

@trharmon0 commented on GitHub (Mar 18, 2025):

Will need to update https://github.com/netbirdio/service to render files into /usr/local/lib/systemd/system/ instead of /etc/systemd/system/

I could be wrong but impression has always been that if a file is distributed as part of a package (ex: .deb), as opposed to make install, the FHS asks that it be placed other than in /usr/local.

<!-- gh-comment-id:2733646876 --> @trharmon0 commented on GitHub (Mar 18, 2025): > Will need to update https://github.com/netbirdio/service to render files into `/usr/local/lib/systemd/system/` instead of `/etc/systemd/system/` I could be wrong but impression has always been that if a file is distributed as part of a package (ex: .deb), as opposed to ```make install```, the FHS asks that it be placed other than in /usr/local.
Author
Owner

@nazarewk commented on GitHub (Mar 18, 2025):

Will need to update netbirdio/service to render files into /usr/local/lib/systemd/system/ instead of /etc/systemd/system/

I could be wrong but impression has always been that if a file is distributed as part of a package (ex: .deb), as opposed to make install, the FHS asks that it be placed other than in /usr/local.

I don't think this is the case here, it's probably just calling netbird service install instead of distributing a static *.service file, I'm still trying to track it down.

<!-- gh-comment-id:2733800402 --> @nazarewk commented on GitHub (Mar 18, 2025): > > Will need to update [netbirdio/service](https://github.com/netbirdio/service?rgh-link-date=2025-03-18T15%3A20%3A40.000Z) to render files into `/usr/local/lib/systemd/system/` instead of `/etc/systemd/system/` > > I could be wrong but impression has always been that if a file is distributed as part of a package (ex: .deb), as opposed to `make install`, the FHS asks that it be placed other than in /usr/local. I don't think this is the case here, it's probably just calling `netbird service install` instead of distributing a static `*.service` file, I'm still trying to track it down.
Author
Owner

@trharmon0 commented on GitHub (Mar 18, 2025):

When I was troubleshooting I did not see a static .service file in the inventory of the package. Just, like, three files one of which was the binary. My guess was that the binary was generating a service file in the filesystem on-the-fly. That seems consistent with what you are saying.

<!-- gh-comment-id:2733812070 --> @trharmon0 commented on GitHub (Mar 18, 2025): When I was troubleshooting I did not see a static .service file in the inventory of the package. Just, like, three files one of which was the binary. My guess was that the binary was generating a service file in the filesystem on-the-fly. That seems consistent with what you are saying.
Author
Owner

@trharmon0 commented on GitHub (Jul 26, 2025):

Any updates here? Infosec policy around here doesn't allow for Netbird to run all the time. We need to be able to mask + unmask it. Otherwise we'll have to remove it. Or roll custom packages.

<!-- gh-comment-id:3122664669 --> @trharmon0 commented on GitHub (Jul 26, 2025): Any updates here? Infosec policy around here doesn't allow for Netbird to run all the time. We need to be able to mask + unmask it. Otherwise we'll have to remove it. Or roll custom packages.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: DYNR/netbird#7411