After rename systemuser and group -- Invalid group specified

Hi All,

We want (have) changed the default username and group from our default installation icinga2.
From “nagios” to “icinga”, why… hmm we think it have to. We use the repo from icinga.

usermod -l icinga nagios
groupmod --new-name icinga nagios

Changed the following file: → “/etc/default/icinga2”

# default settings for icinga2's initscript

ICINGA2_USER="icinga"
ICINGA2_GROUP="icinga"

#DAEMON_ARGS="-e /var/log/icinga2/icinga2.err"

we can stop, start, reload, restart … and so one… works like a charm… so far so good

● icinga2.service - Icinga host/service/network monitoring system
Loaded: loaded (/lib/systemd/system/icinga2.service; enabled; vendor preset: enabled)
Drop-In: /etc/systemd/system/icinga2.service.d
└─limits.conf
Active: active (running) since Tue 2021-09-14 11:08:43 CEST; 12min ago
Process: 781 ExecStartPre=/usr/lib/icinga2/prepare-dirs /etc/default/icinga2 (code=exited, status=0/SUCCESS)
Main PID: 795 (icinga2)
Status: “Startup finished.”

but… if we want to check the config icinga2 daemon -C we got this error

critical/cli: Invalid group specified: nagios

with -x debug it also not working to get more information.
I tried do change directly username and group in /usr/lib/icinga2/prepare-dirs but dind’t help either

Somebody a idea, or is it compiled with group “nagios”?
Many thanks

1 Like

Because icinga2 daemon -C is not working any more and to troubleshot with systemctl status icinga2.service is very annoying. I changed the group back from icinga to nagios groupmod --new-name nagios icinga … but now I stuck with

# icinga2 daemon -C
critical/cli: Invalid user specified: nagios

so now back on “nagios:nagios” :wink: … but it would be nice if somebody has a idea.

#manyThanks2icinga4thatGreatTool

Hello @wattebausch!

I don’t quite understand.

Best,
AK

Hi @Al2Klimov

we think it make’s more sense to rename the user and group like i wrote above “icinga:icinga”.
our monitoring admins have to login with a unprivileged user … and it would be nice if the user would be “icinga” and not “nagios”. when we talk about monitoring, all talk from “icinga”. and last time our youngest employee (apprentice) ask me why i have to login with “nagios”, and hi got right. For almost all it looks like cosmetic…… but a example: my sons name is Marco, and I don’t call them Stephan :blush:

You’re absolutely right… ex. I’d s/cosmetic/not necessary/.

Both the nagios and icinga users are created with /sbin/nologin (at least on CentOS 7), so you may want to consider why you want users logging in as them in the first place.

We won’t work as root, and it offers to work with the user which the service runs. I think there’s “many roads lead to rome” or “There’s more than one way to skin a cat”

Thanks both for the response :+1:

From my point of view, for this “not necessary” challenge, we found a option to change username by editing /etc/default/icinga2 and it works……. except icinga2 daemon -C.. and we want ask the community if we miss something.