mirror of
https://github.com/netbirdio/netbird.git
synced 2026-09-19 13:19:06 +02:00
fix: debug bundles: adjust systemd service to properly gather debug bundles
This commit is contained in:
@@ -37,7 +37,7 @@ func newSVCConfig() *service.Config {
|
||||
}
|
||||
|
||||
if runtime.GOOS == "linux" {
|
||||
config.EnvVars["SYSTEMD_UNIT"] = serviceName
|
||||
config.EnvVars["NB_SERVICE"] = serviceName
|
||||
}
|
||||
|
||||
return config
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user