This change broke the previous installation because, when using environment variables from conf.d, znc loads configuration files from /var/lib/znc/.znc, but, when using --datadir, znc loads configuration from /var/lib/znc. Maybe this happens because the environment file was never used.
I would ask for znc development team to advise the best solution for keeping systemd unit regarding those concerns.
Gentoo changed its policy for loading configuration into systemd units. Referring to conf.d files in systemd units is prohibited:
https://wiki.gentoo.org/wiki/Project:Systemd/Ebuild_policy#Unit_file_guidelines
Previous configuration:
```
# /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
```
New configuration:
```
# /lib/systemd/system/znc.service
[Unit]
Description=ZNC, an advanced IRC bouncer
After=network.target
[Service]
ExecStart=/usr/bin/znc -f --datadir=/var/lib/znc
User=znc
[Install]
WantedBy=multi-user.target
```
This change broke the previous installation because, when using environment variables from conf.d, znc loads configuration files from /var/lib/znc/.znc, but, when using `--datadir`, znc loads configuration from /var/lib/znc. Maybe this happens because the environment file was never used.
I would ask for znc development team to advise the best solution for keeping systemd unit regarding those concerns.
<!-- github-sync-id:1368764319 -->
It seems that the environment variable I mentioned before it is defined by the ebuild and not from upstream:
https://gitweb.gentoo.org/repo/gentoo.git/tree/net-irc/znc/files/znc.confd-r1
Also the following instructions are being provided by ebuild maintainer:
https://gitweb.gentoo.org/repo/gentoo.git/tree/net-irc/znc/znc-1.8.2-r2.ebuild#n158
<!-- github-comment-id:1242827960 -->
Hi @samuelbernardo,
> Previous configuration:
AFAICT there never was a systemd unit with `EnvironmentFile=/etc/conf.d/znc`, in Gentoo or znc upstream.
Have you read the bug mentioned in the ebuild? The one which is also mentioned in d4bfd143b4b12f6e6695878cc1b5168cc31c362c (https://bugs.gentoo.org/743856).
<!-- github-comment-id:1242828635 -->
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Gentoo changed its policy for loading configuration into systemd units. Referring to conf.d files in systemd units is prohibited:
https://wiki.gentoo.org/wiki/Project:Systemd/Ebuild_policy#Unit_file_guidelines
Previous configuration:
New configuration:
This change broke the previous installation because, when using environment variables from conf.d, znc loads configuration files from /var/lib/znc/.znc, but, when using
--datadir, znc loads configuration from /var/lib/znc. Maybe this happens because the environment file was never used.I would ask for znc development team to advise the best solution for keeping systemd unit regarding those concerns.
It seems that the environment variable I mentioned before it is defined by the ebuild and not from upstream:
https://gitweb.gentoo.org/repo/gentoo.git/tree/net-irc/znc/files/znc.confd-r1
Also the following instructions are being provided by ebuild maintainer:
https://gitweb.gentoo.org/repo/gentoo.git/tree/net-irc/znc/znc-1.8.2-r2.ebuild#n158
Hi @samuelbernardo,
AFAICT there never was a systemd unit with
EnvironmentFile=/etc/conf.d/znc, in Gentoo or znc upstream.Have you read the bug mentioned in the ebuild? The one which is also mentioned in
d4bfd143b4(https://bugs.gentoo.org/743856).Hi @sbraz
I wasn't aware of that bug... Going to close this issue. Thanks for pointing that out.