Summary: | net-proxy/polipo add systemd support | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | Yichao Zhou <broken.zhou> |
Component: | [OLD] Server | Assignee: | Gentoo systemd Team <systemd> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | bircoph, candrews, jens |
Priority: | Normal | Keywords: | NeedPatch |
Version: | unspecified | ||
Hardware: | All | ||
OS: | Linux | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- | |
Bug Depends on: | |||
Bug Blocks: | 448882 | ||
Attachments: |
service file
full ebuild (polipo-1.1.1) |
Description
Yichao Zhou
2014-05-21 04:52:09 UTC
If someone is willing to add systemd support, please provide all necessary files and patches (including ebuild patch) and test them. I don't have an access to a systemd setup, so I can't provide and test required changes on my own. Why this is resolved as "CANTFIX"? It should remain open until someone fixes it. I can't fix this bug, that's why I marked it as CANTFIX. If someone is willing to fix it, instructions are above. You can change the bug status when solution will be available. This can stay open until fixe . Maintainers are not obligated to add init.d scripts or units. Here is my patch: --- /usr/portage/net-proxy/polipo/polipo-1.1.1.ebuild 2015-01-12 19:01:15.000000000 +0800 +++ polipo-1.1.1.ebuild 2015-02-10 14:39:22.947687487 +0800 @@ -14,12 +14,13 @@ KEYWORDS="amd64 x86" fi -inherit ${_GIT} toolchain-funcs user +inherit ${_GIT} toolchain-funcs user systemd DESCRIPTION="A caching web proxy" HOMEPAGE="http://www.pps.jussieu.fr/~jch/software/polipo/" LICENSE="MIT GPL-2" SLOT="0" +IUSE="systemd" DEPEND="sys-apps/texinfo" RDEPEND="" @@ -39,18 +40,23 @@ newinitd "${FILESDIR}/${PN}.initd-2" ${PN} insinto /etc/${PN} ; doins "${FILESDIR}/config" - exeinto /etc/cron.weekly ; newexe "${FILESDIR}/${PN}.crond-2" ${PN} + systemd_dounit "${FILESDIR}"/${PN}@.service + if ! use systemd; then + exeinto /etc/cron.weekly ; newexe "${FILESDIR}/${PN}.crond-2" ${PN} + fi dodoc CHANGES README dohtml html/* } pkg_postinst() { - einfo "Do not forget to read the manual." - einfo "Change the config file in /etc/${PN} to suit your needs." - einfo "" - einfo "Polipo OpenRC init scripts can now be multiplexed:" - einfo "1. create /etc/${PN}/config.foo" - einfo "2. symlink /etc/init.d/{${PN}.foo -> ${PN}}" - einfo "3. make sure all instances use unique ip:port pair and cachedir, if any" + elog "Do not forget to read the manual." + elog "Change the config file in /etc/${PN} to suit your needs." + elog "" + elog "Polipo init scripts can now be multiplexed:" + elog "1. create /etc/${PN}/config.foo" + elog "2. symlink /etc/init.d/{${PN}.foo -> ${PN}}" + elog " a. if you are using OpenRC, symlink /etc/init.d/{${PN}.foo -> ${PN}}" + elog " b. if you are using systemd, execute \"systemctl enable polipo@config.foo\"" + elog "3. make sure all instances use unique ip:port pair and cachedir, if any" } Created attachment 396048 [details]
service file
service file should be placed in files/polipo@.service Created attachment 396052 [details]
full ebuild (polipo-1.1.1)
(In reply to Yichao Zhou from comment #7) > service file should be placed in files/polipo@.service Why "@"? As I see from other packages, normal naming scheme is "${PN}.service". The systemd service files with suffix "@" are called instance. See http://0pointer.de/blog/projects/instances.html for details. Using instance, we can use one service to start multiple instances of a service. For example, "systemctl enable polipo@config.foo" will enable the polipo that uses "config.foo" as the configuration file. Repoman doesn't allow "@" character in file names. systemd_dounit doesn't allow to change unit file name. Find another way to solve this (see how multiplexing is handled for other packages). And please consider that in Gentoo systemd unit files are usually name ".service", not ".systemd". Forget my last comment, my mistake. File name issue with: systemd_newunit "${FILESDIR}/${PN}_at.service" "${PN}@.service" Changes are added to polipo-1.1.1-r1. |