Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 869356 - net-irc/znc-1.8.2-r1: znc.service break previous installation
Summary: net-irc/znc-1.8.2-r1: znc.service break previous installation
Status: RESOLVED DUPLICATE of bug 743856
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Louis Sautier (sbraz)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-09-09 15:03 UTC by Samuel Bernardo
Modified: 2022-09-11 00:59 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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
[Unit]
Description=ZNC, an advanced IRC bouncer
After=network.target

[Service]
EnvironmentFile=/etc/conf.d/znc
ExecStart=/usr/bin/znc -f
User=znc

[Install]
WantedBy=multi-user.target
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
[Unit]
Description=ZNC, an advanced IRC bouncer
After=network.target

[Service]
EnvironmentFile=/etc/conf.d/znc
ExecStart=/usr/bin/znc -f

[Install]
WantedBy=multi-user.target
Comment 2 Mike Gilbert gentoo-dev 2022-09-10 01:12:50 UTC
Referring to conf.d files in systemd units is prohibited.

https://wiki.gentoo.org/wiki/Project:Systemd/Ebuild_policy#Unit_file_guidelines
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:
https://github.com/znc/znc/issues/1837
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
https://gitweb.gentoo.org/repo/gentoo.git/tree/net-irc/znc/files/znc.confd-r1

This broke the setup for systemd unit configuration.
Comment 6 Louis Sautier (sbraz) gentoo-dev 2022-09-11 00:54:51 UTC
Hi,
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 ***