Hi again, related to my inetd conversion example, in my .service unit I have something like this:

# nagios-nrpe-server@.service:
[Service]
Environment=NICENESS=0
EnvironmentFile=-/etc/default/nagios-nrpe-server
ExecStart=/usr/sbin/nrpe -i $DAEMON_OPTIONS
Nice=$NICENESS

# /etc/default/nagios-nrpe-server:
DAEMON_OPTIONS="--no-ssl"
#NICENESS=5
INETD=1


With that I get this sort of error message:
[/etc/systemd/system/nagios-nrpe-server@.service] Failed to parse nice 
priority, ignoring: $NICENESS

I added the leading "Environment=NICENESS=0" directive to try and make sure it wasn't just an empty variable kinda thing, but it didn't seem to help.


It's somewhat unclear from the man pages as to whether or not $VAR expansion is done outside of the Exec* directives, and I couldn't find a definitive answer online, but based on the above, I'm guessing it's not, correct?


Also, so long as I'm asking questions, I've got one about Condition* directives. There doesn't seem to be one for Environment variable sort of parsing or some sort of shell command evaluation (eg: returns 0 kinda thing).

Something like:

# nagios-nrpe-server.socket:
[Unit]
ConditionReturnsZero=/bin/grep -q ^INETD=1$ /etc/default/nagios-nrpe-server

I got to thinking about this for the INETD directive that comes in the /etc/default/nagios-nrpe-server script. It's somewhat irrelevant in this case since the .socket unit already needs to be active before the @.service pair is instantiated.

Looking at some of the other examples the system ships with like ssh.service vs ssh@.service/ssh.socket, they have Conflicts= directives against each other, but there's not really a conf file that I see that directs the system to use inetd-style vs daemon mode for those.

So, since there's not really a way to read that from an EnvironmentFile style conf file and use it in a Conditional* directive to disable one vs the other right now, is it just expected that people use something like "systemctl mask ssh.service" vs. "systemctl mask ssh.socket" to select between them?

Thanks,
Brian

Attachment: signature.asc
Description: Digital signature

_______________________________________________
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/systemd-devel

Reply via email to