fix: debug bundles: adjust systemd service to properly gather debug bundles

This commit is contained in:
Krzysztof Nazarewski
2025-07-09 12:41:58 +02:00
parent 969f1ed59a
commit e6672c4ecb
3 changed files with 16 additions and 8 deletions
+1 -1
View File
@@ -37,7 +37,7 @@ func newSVCConfig() *service.Config {
}
if runtime.GOOS == "linux" {
config.EnvVars["SYSTEMD_UNIT"] = serviceName
config.EnvVars["NB_SERVICE"] = serviceName
}
return config
+2 -2
View File
@@ -55,8 +55,8 @@ func (g *BundleGenerator) trySystemdLogFallback() error {
// getServiceName gets the service name from environment or defaults to netbird
func getServiceName() string {
if unitName := os.Getenv("SYSTEMD_UNIT"); unitName != "" {
log.Debugf("Detected SYSTEMD_UNIT environment variable: %s", unitName)
if unitName := os.Getenv("NB_SERVICE"); unitName != "" {
log.Debugf("Detected NB_SERVICE environment variable: %s", unitName)
return unitName
}