Created attachment 362286 [details] Ebuild for installing puppet with systemd-support I added useflag systemd to puppet-ebuild. If this is set the ebuild installs the systemd services puppetmaster.service and puppetagent.service already provided by upstream, instead of installing the rc-scripts.
Comment on attachment 362286 [details] Ebuild for installing puppet with systemd-support --- puppet-3.3.1.ebuild 2013-10-12 12:37:36.000000000 +0200 +++ - 2013-10-30 17:14:25.069165509 +0100 @@ -15,7 +15,7 @@ LICENSE="Apache-2.0 GPL-2" SLOT="0" KEYWORDS="~amd64 ~hppa ~ppc ~sparc ~x86" -IUSE="augeas diff doc emacs ldap minimal rrdtool selinux shadow sqlite3 vim-syntax xemacs" +IUSE="augeas diff doc emacs ldap minimal rrdtool selinux shadow sqlite3 vim-syntax xemacs systemd" ruby_add_rdepend " dev-ruby/hiera @@ -68,7 +68,12 @@ } all_ruby_install() { - newinitd "${FILESDIR}"/puppet.init-r1 puppet + if use systemd; then + insinto /usr/lib/systemd/system + doins ${WORKDIR}/all/puppet-3.3.1/ext/systemd/puppetagent.service + else + newinitd "${FILESDIR}"/puppet.init-r1 puppet + fi # Initial configuration files insinto /etc/puppet @@ -77,10 +82,16 @@ keepdir /var/log/puppet fowners -R puppet:puppet /var/log/puppet + if use minimal ; then rm "${ED}/etc/puppet/auth.conf" else - newinitd "${FILESDIR}"/puppetmaster.init-r1 puppetmaster + if use systemd; then + insinto /usr/lib/systemd/system + doins ${WORKDIR}/all/puppet-3.3.1/ext/systemd/puppetmaster.service + else + newinitd "${FILESDIR}"/puppetmaster.init-r1 puppetmaster + fi newconfd "${FILESDIR}"/puppetmaster.confd puppetmaster insinto /etc/puppet @@ -112,6 +123,7 @@ for f in $(find ext examples -type f) ; do docinto "$(dirname ${f})"; dodoc "${f}" done + } pkg_postinst() { You shouldn't need to introduce a USE flag here at all.
Actually I think it's usefull using the systemd useflag, as the install-destination doesn't exist if systemd is not installed. The current ebuild in portage does not install those two services yet and I think it does not make sense to install the rc-scripts if they're not used, so imho it is usefull adding the useflag to give users the choice if they want to install systemd-startup-routines or SysV-rc-scripts.
Ya, from what I remember in discussions on the gentoo-dev mailing lists, the systemd use flag is the way to go atm.
(In reply to Matthew Thode ( prometheanfire ) from comment #3) > Ya, from what I remember in discussions on the gentoo-dev mailing lists, the > systemd use flag is the way to go atm. It's exactly the opposite ;) https://wiki.gentoo.org/wiki/Systemd/Ebuild_policy
Also would need to install a tmpfiles.d file like: http://pkgs.fedoraproject.org/cgit/puppet.git/tree/puppet.spec#n187 Otherwise pid file won't be found
Matthew, will you take care of this or we (systemd team) can go ahead? Thanks
if I can get the systemd service file I could do it, but I can't do the conversion on my own (don't have systemd experience). If what you are doing looks like the diff https://bugs.gentoo.org/show_bug.cgi?id=489860#c1 then I think you can just do it.
Hi Matthew, the files are provided by upstream and simply need to be installed. See my ebuild for details. BR Jens
ah, ok I'll get to it tonight then.
But remember to install them unconditionally ;)
fixed (both tmpfiles.d and the service files are installed unconditionally (master only if minimal is not enabled)).