Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 489860 - app-admin/puppet - add systemd support
Summary: app-admin/puppet - add systemd support
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Server (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Matthew Thode ( prometheanfire )
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: install-systemd-unit
  Show dependency tree
 
Reported: 2013-10-30 10:32 UTC by Jens Ott
Modified: 2013-12-23 00:02 UTC (History)
4 users (show)

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


Attachments
Ebuild for installing puppet with systemd-support (puppet-3.3.1-r1.ebuild,4.53 KB, text/plain)
2013-10-30 10:32 UTC, Jens Ott
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jens Ott 2013-10-30 10:32:17 UTC
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 1 Jeroen Roovers (RETIRED) gentoo-dev 2013-10-30 16:14:55 UTC
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.
Comment 2 Jens Ott 2013-10-30 17:19:15 UTC
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.
Comment 3 Matthew Thode ( prometheanfire ) archtester Gentoo Infrastructure gentoo-dev Security 2013-10-30 17:52:05 UTC
Ya, from what I remember in discussions on the gentoo-dev mailing lists, the systemd use flag is the way to go atm.
Comment 4 Pacho Ramos gentoo-dev 2013-10-30 18:26:22 UTC
(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
Comment 5 Pacho Ramos gentoo-dev 2013-10-30 18:34:42 UTC
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
Comment 6 Pacho Ramos gentoo-dev 2013-12-22 11:14:26 UTC
Matthew, will you take care of this or we (systemd team) can go ahead? Thanks
Comment 7 Matthew Thode ( prometheanfire ) archtester Gentoo Infrastructure gentoo-dev Security 2013-12-22 18:36:35 UTC
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.
Comment 8 Jens Ott 2013-12-22 19:18:18 UTC
Hi Matthew,

the files are provided by upstream and simply need to be installed. See my ebuild for details. 

BR Jens
Comment 9 Matthew Thode ( prometheanfire ) archtester Gentoo Infrastructure gentoo-dev Security 2013-12-22 19:20:10 UTC
ah, ok I'll get to it tonight then.
Comment 10 Pacho Ramos gentoo-dev 2013-12-22 19:23:13 UTC
But remember to install them unconditionally ;)
Comment 11 Matthew Thode ( prometheanfire ) archtester Gentoo Infrastructure gentoo-dev Security 2013-12-23 00:02:20 UTC
fixed (both tmpfiles.d and the service files are installed unconditionally (master only if minimal is not enabled)).