Summary: | ZNC systemd unit tries to load znc config from /dev/null | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | Chandler Paul <thatslyude> |
Component: | Current packages | Assignee: | Alex Alexander (RETIRED) <wired> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | net-irc |
Priority: | Normal | ||
Version: | unspecified | ||
Hardware: | All | ||
OS: | Linux | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- | |
Attachments: |
Patch for upstream systemd unit to honor the environment file
Updated ebuild |
Created attachment 384082 [details, diff]
Updated ebuild
Comment on attachment 384080 [details, diff] Patch for upstream systemd unit to honor the environment file >From 1ffc6293da1d8bf74273f6d4cd7b51a9a57a56cf Mon Sep 17 00:00:00 2001 >From: Stephen Chandler Paul <thatslyude@gmail.com> >Date: Mon, 1 Sep 2014 18:01:41 -0400 >Subject: [PATCH] znc.service: Respect user enviornment > >By default the znc.service file provided doesn't load any environment >file, leaving it broken on Gentoo systems (it tries to load the >configuration from /dev/null) >--- > znc.service | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > >diff --git a/znc.service b/znc.service >index 2f862bf..abbbbf0 100644 >--- a/znc.service >+++ b/znc.service >@@ -3,8 +3,9 @@ Description=ZNC, an advanced IRC bouncer > After=network.target > > [Service] >-ExecStart=/usr/bin/znc -f >+ExecStart=/usr/bin/znc -f -d $ZNC_CONF > User=znc >+EnvironmentFile=/etc/conf.d/znc > > [Install] > WantedBy=multi-user.target >-- >1.8.5.5 > Apologies, I tried to fix a typo in the patch with the "edit as comment" feature and I guess it doesn't do what I had thought it does. (In reply to Chandler Paul from comment #2) > Comment on attachment 384080 [details, diff] [details, diff] > Patch for upstream systemd unit to honor the environment file > > >From 1ffc6293da1d8bf74273f6d4cd7b51a9a57a56cf Mon Sep 17 00:00:00 2001 > >From: Stephen Chandler Paul <thatslyude@gmail.com> > >Date: Mon, 1 Sep 2014 18:01:41 -0400 > >Subject: [PATCH] znc.service: Respect user enviornment > > > >By default the znc.service file provided doesn't load any environment > >file, leaving it broken on Gentoo systems (it tries to load the > >configuration from /dev/null) > >--- > > znc.service | 3 ++- > > 1 file changed, 2 insertions(+), 1 deletion(-) > > > >diff --git a/znc.service b/znc.service > >index 2f862bf..abbbbf0 100644 > >--- a/znc.service > >+++ b/znc.service > >@@ -3,8 +3,9 @@ Description=ZNC, an advanced IRC bouncer > > After=network.target > > > > [Service] > >-ExecStart=/usr/bin/znc -f > >+ExecStart=/usr/bin/znc -f -d $ZNC_CONF > > User=znc > >+EnvironmentFile=/etc/conf.d/znc > > > > [Install] > > WantedBy=multi-user.target > >-- > >1.8.5.5 > > Hi, this is fixed in the ebuild for version 1.6.3 https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=942dfd926c80e680f564099f0b9535a2777c0245 The Environment approach is apparently frowned upon (see https://wiki.gentoo.org/wiki/Project:Systemd/conf.d_files) so I simply changed the znc user's home to /var/lib/znc without patching the systemd unit. I have not tested this but it should make the files go to /var/lib/znc/.znc. While I agree that this looks a big redundant, this is what the upstream unit does. If you want the systemd unit to be changed, I suggest you file a bug upstream (or edit the unit locally). |
Created attachment 384080 [details, diff] Patch for upstream systemd unit to honor the environment file The systemd unit that comes with the ebuild for znc 1.4.1-r1 doesn't actually work. This is because the unit doesn't load the environment file from /etc/conf.d/znc, and as a result znc doesn't know where to load it's configuration from and tries to load it from /dev/null. I've updated the ebuild and added a patch that fixes the systemd unit.