Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 517728 - net-irc/znc - add systemd service unit
Summary: net-irc/znc - add systemd service unit
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Alex Alexander (RETIRED)
URL:
Whiteboard:
Keywords: PATCH
Depends on:
Blocks: install-systemd-unit
  Show dependency tree
 
Reported: 2014-07-21 22:16 UTC by Konstantin (elxa)
Modified: 2014-07-25 10:52 UTC (History)
2 users (show)

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


Attachments
Systemd service file for znc (znc.service,210 bytes, text/plain)
2014-07-21 22:19 UTC, Konstantin (elxa)
Details
Systemd service file for znc (znc.service,193 bytes, patch)
2014-07-23 22:01 UTC, Konstantin (elxa)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Konstantin (elxa) 2014-07-21 22:16:09 UTC
It would be nice to have a systemd service file, since I want to run it system wide.

Reproducible: Always

Steps to Reproduce:
1. emerge znc
2. systemctl start znc
Actual Results:  
Fails

Expected Results:  
Succeeds
Comment 1 Konstantin (elxa) 2014-07-21 22:19:08 UTC
Created attachment 381284 [details]
Systemd service file for znc

- Respects value of ZNC_CONF from /etc/conf.d/znc.
- "User=znc" is hardcoded, because I could not make it use the value from the environment file.
- Service file is tested and works.
Comment 2 Konstantin (elxa) 2014-07-23 22:01:51 UTC
Created attachment 381468 [details, diff]
Systemd service file for znc

Add "-f" to start flags to prevent forking:

$ znc -h
[ ** ] USAGE: znc [options]
[ ** ] Options are:
[ ** ] 	-h, --help         List available command line options (this page)
[ ** ] 	-v, --version      Output version information and exit
[ ** ] 	-f, --foreground   Don't fork into the background
[ ** ] 	-D, --debug        Output debugging information (Implies -f)
[ ** ] 	-n, --no-color     Don't use escape sequences in the output
[ ** ] 	-r, --allow-root   Don't complain if ZNC is run as root
[ ** ] 	-c, --makeconf     Interactively create a new config
[ ** ] 	-s, --makepass     Generates a password for use in config
[ ** ] 	-p, --makepem      Generates a pemfile for use with SSL
[ ** ] 	-d, --datadir      Set a different ZNC repository (default is ~/.znc)
Comment 3 Konstantin (elxa) 2014-07-23 22:02:37 UTC
Looks like upstream already provides a service unit:
https://github.com/znc/znc/blob/master/znc.service
Comment 4 Pacho Ramos gentoo-dev 2014-07-25 10:52:57 UTC
+*znc-1.4-r1 (25 Jul 2014)
+
+  25 Jul 2014; Pacho Ramos <pacho@gentoo.org> +znc-1.4-r1.ebuild:
+  Toggle configure option to install unit file (#517728 by Konstantin)
+