Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 869356

Summary: net-irc/znc-1.8.2-r1: znc.service break previous installation
Product: Gentoo Linux Reporter: Samuel Bernardo <samuelbernardo.mail>
Component: Current packagesAssignee: Louis Sautier (sbraz) <sbraz>
Severity: normal CC: alexey+gentoo, systemd
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Package list:
Runtime testing required: ---

Description Samuel Bernardo 2022-09-09 15:03:13 UTC
The environment file /etc/conf.d was removed from the systemd service and ExecStart appears with hardcoded "--datadir=/var/lib/znc".
I just changed the znc.service into the following that works as expected:

# /lib/systemd/system/znc.service
Description=ZNC, an advanced IRC bouncer

ExecStart=/usr/bin/znc -f

Comment 1 Samuel Bernardo 2022-09-09 15:06:35 UTC
Just realized that the user is also defined in /etc/conf.d/znc file. So znc.service could be like this:

# /lib/systemd/system/znc.service
Description=ZNC, an advanced IRC bouncer

ExecStart=/usr/bin/znc -f

Comment 2 Mike Gilbert gentoo-dev 2022-09-10 01:12:50 UTC
Referring to conf.d files in systemd units is prohibited.
Comment 3 Samuel Bernardo 2022-09-11 00:06:49 UTC
I understand the reasons presented there for distribution and administration management, trying to keep things more clear.

But regarding znc, the software is not prepared to manage their configurations the same way. I would need to add a systemd drop-in to add the Environment=ZNC_DATADIR="/var/lib/znc", since when service is started this way creates .znc directory inside /var/lib/znc. When starting znc with the flag as it is being done now, znc reads configuration file directly from /var/lib/znc directory.

So maybe we have here an upstream bug to report, since to comply with current Gentoo management policies we need to use daemon flags and not environment files.
Comment 4 Samuel Bernardo 2022-09-11 00:31:07 UTC
Created the following bug report:
Comment 5 Samuel Bernardo 2022-09-11 00:39:04 UTC
It seem that the environment variable is defined by the ebuild and not from upstream

This broke the setup for systemd unit configuration.
Comment 6 Louis Sautier (sbraz) gentoo-dev 2022-09-11 00:54:51 UTC
As I replied on your upstream issue, I don't see how we "broke" anything. Our systemd service never supported an environment file. At some point, upstream changed the default datadir so I added a check to warn users in the ebuild. Overriding unit files is quite easy and the conf.d file is only meant for OpenRC users so I'm not sure what you would like for us or upstream to change.
Comment 7 Samuel Bernardo 2022-09-11 00:59:57 UTC
It seems that this issue was solved in upstream since it was not a common behavior to have a service with its configurations files loaded from .znc.
This was already reviewed on previous issue that Louis just pointed out on github issue.

*** This bug has been marked as a duplicate of bug 743856 ***