Bug 174557 - sysutils/puppet rc script uses wrong $command_interpreter
Summary: sysutils/puppet rc script uses wrong $command_interpreter
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: Steve Wills
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-12-19 00:20 UTC by wollman
Modified: 2013-01-06 16:30 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description wollman 2012-12-19 00:20:00 UTC
$LOCALBASE/etc/rc.d/puppet specifies that command_interpreter is
$LOCALBASE/bin/ruby18.  This is wrong when using Ruby 1.9.  The error
causes (embarrassingly) Puppet to be unable to start itself (using the
Puppet::Type::Service::ProviderFreebsd service provider).

Fix: 

Edit in the correct path when the rc file is installed.
How-To-Repeat: 
Install Puppet port.
Run the following manifest:
  service {'puppet': ensure => running, enable => true, }
Watch the fail:

Error: undefined method `error' for Service[puppet](provider=freebsd):Puppet::Type::Service::ProviderFreebsd
Error: /Stage[main]/Csail::Puppet/Service[puppet]/ensure: change from stopped to running failed: undefined method `error' for Service[puppet](provider=freebsd):Puppet::Type::Service::ProviderFreebsd
Comment 1 Edwin Groothuis freebsd_committer freebsd_triage 2012-12-19 09:32:32 UTC
Responsible Changed
From-To: freebsd-ports-bugs->swills

Over to maintainer (via the GNATS Auto Assign Tool)
Comment 2 dfilter service freebsd_committer freebsd_triage 2013-01-06 16:27:01 UTC
Author: swills
Date: Sun Jan  6 16:26:53 2013
New Revision: 309998
URL: http://svnweb.freebsd.org/changeset/ports/309998

Log:
  - Update to 3.0.2
  - Fix config generation
  - Specify rundir, logdir, vardir explicitly to avoid potential issues
  - Fix command_interpreter in rc script [1]
  - General improvements to rc script while here [2]
  
  PR:		ports/174557 [1]
  Reviewed by:	crees [1] [2]

Modified:
  head/sysutils/puppet/Makefile
  head/sysutils/puppet/distinfo
  head/sysutils/puppet/files/optpatch-package_origin
  head/sysutils/puppet/files/puppet.in   (contents, props changed)
  head/sysutils/puppet/pkg-plist

Modified: head/sysutils/puppet/Makefile
==============================================================================
--- head/sysutils/puppet/Makefile	Sun Jan  6 16:25:54 2013	(r309997)
+++ head/sysutils/puppet/Makefile	Sun Jan  6 16:26:53 2013	(r309998)
@@ -2,8 +2,8 @@
 # $FreeBSD$
 
 PORTNAME=	puppet
-PORTVERSION=	3.0.1
-PORTREVISION=	2
+PORTVERSION=	3.0.2
+PORTREVISION=	0
 CATEGORIES=	sysutils
 MASTER_SITES=	http://downloads.puppetlabs.com/puppet/
 
@@ -24,6 +24,7 @@ PORTEXAMPLES=	*
 USERS=		puppet
 GROUPS=		puppet
 SUB_FILES+=	pkg-message
+SUB_LIST=	RUBY=${RUBY}
 
 MANCOMPRESSED=	yes
 MAN5=	puppet.conf.5
@@ -87,13 +88,12 @@ do-install:
 post-install:
 	${INSTALL} -d ${ETCDIR}
 	${INSTALL} -m 0755 -o puppet -g puppet -d /var/puppet
-	${INSTALL} -m 0755 -o puppet -g puppet -d /var/run/puppet
 	${INSTALL} -m 0644 ${WRKSRC}/conf/auth.conf ${ETCDIR}/auth.conf-dist
-	${RUBY} -I ${RUBY_SITELIBDIR} ${PREFIX}/bin/puppet --genconfig \
+	${RUBY} -I ${RUBY_SITELIBDIR} ${PREFIX}/bin/puppet master --genconfig \
 		--confdir=${ETCDIR} \
-		--rundir=/var/run/puppet | \
-		${SED} -e 's/genconfig = true/# genconfig = false/' | \
-		${SED} -e 's/factdest =/# factdest =/' \
+		--rundir=/var/run/puppet \
+		--vardir=/var/lib/puppet \
+		--logdir=/var/log/puppet \
 		> ${ETCDIR}/puppet.conf-dist
 	@${ECHO} ${RUBY_SITELIBDIR}/puppet.rb | \
 		${SED} 's,^${PREFIX}/,,' >> ${TMPPLIST}

Modified: head/sysutils/puppet/distinfo
==============================================================================
--- head/sysutils/puppet/distinfo	Sun Jan  6 16:25:54 2013	(r309997)
+++ head/sysutils/puppet/distinfo	Sun Jan  6 16:26:53 2013	(r309998)
@@ -1,2 +1,2 @@
-SHA256 (puppet-3.0.1.tar.gz) = 5e4d0cfdd6989faf4f6c5c76c0d3bcfa0364e380549be1a2f7c3abd22b0b562b
-SIZE (puppet-3.0.1.tar.gz) = 1505102
+SHA256 (puppet-3.0.2.tar.gz) = e4d73ae9953764b0c70c1327c9105ec9a17f03b33d50e622611491c886796d6b
+SIZE (puppet-3.0.2.tar.gz) = 1534566

Modified: head/sysutils/puppet/files/optpatch-package_origin
==============================================================================
--- head/sysutils/puppet/files/optpatch-package_origin	Sun Jan  6 16:25:54 2013	(r309997)
+++ head/sysutils/puppet/files/optpatch-package_origin	Sun Jan  6 16:26:53 2013	(r309998)
@@ -30,8 +30,8 @@
  
 -  def self.listcmd
 -    command(:pkginfo)
-+  @@lock = Mutex.new
-+  @@ports_index = nil
++  class_variable_set(:@@lock, Mutex.new)
++  class_variable_set(:@@ports_index, new)
 +
 +  # fix bug in URI::FTP merge method that tries to set typecode
 +  # even when other is a string.

Modified: head/sysutils/puppet/files/puppet.in
==============================================================================
--- head/sysutils/puppet/files/puppet.in	Sun Jan  6 16:25:54 2013	(r309997)
+++ head/sysutils/puppet/files/puppet.in	Sun Jan  6 16:26:53 2013	(r309998)
@@ -5,6 +5,7 @@
 
 # PROVIDE: puppet
 # REQUIRE: NETWORK
+# KEYWORD: shutdown
 
 #
 # Add the following lines to /etc/rc.conf to enable the puppet agent:
@@ -20,13 +21,13 @@ load_rc_config "$name"
 
 : ${puppet_enable="NO"}
 : ${puppet_rundir="/var/run/puppet"}
-: ${puppet_flags="--rundir=${puppet_rundir}"}
 
-command_interpreter="%%PREFIX%%/bin/ruby18"
 command="%%PREFIX%%/bin/puppet"
-command_args="agent ${puppet_flags}"
+command_args="agent ${puppet_flags} --rundir=${puppet_rundir}"
+command_interpreter=%%RUBY%%
 unset puppet_flags
 
 pidfile="${puppet_rundir}/agent.pid"
+start_precmd="install -d -o puppet -g puppet ${pidfile%/*}"
 
 run_rc_command "$1"

Modified: head/sysutils/puppet/pkg-plist
==============================================================================
--- head/sysutils/puppet/pkg-plist	Sun Jan  6 16:25:54 2013	(r309997)
+++ head/sysutils/puppet/pkg-plist	Sun Jan  6 16:26:53 2013	(r309998)
@@ -7,9 +7,6 @@ bin/puppet
 %%ETCDIR%%/auth.conf-dist
 @dirrmtry etc/puppet
 @unexec rmdir /var/puppet 2>/dev/null || true
-@unexec rmdir /var/run/puppet 2>/dev/null || true
-@exec /bin/mkdir -p /var/run/puppet
-@exec /usr/sbin/chown -Rh puppet:puppet /var/run/puppet
 @exec /bin/mkdir -p /var/puppet
 @exec /usr/sbin/chown -Rh puppet:puppet /var/puppet
 @dirrm %%RUBY_SITELIBDIR%%/hiera/backend
_______________________________________________
svn-ports-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-ports-all
To unsubscribe, send any mail to "svn-ports-all-unsubscribe@freebsd.org"
Comment 3 Steve Wills freebsd_committer freebsd_triage 2013-01-06 16:28:40 UTC
State Changed
From-To: open->closed

Fix committed, thanks for the report.