Bug 219207

Summary: [PATCH] devel/buildbot-worker rc script fails to start worker
Product: Ports & Packages Reporter: Alan Somers <asomers>
Component: Individual Port(s)Assignee: Michael Gmelin <grembo>
Status: Closed FIXED    
Severity: Affects Some People Keywords: patch
Priority: --- Flags: grembo: maintainer-feedback+
Version: Latest   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
Patch to fix buildbot-worker rc script
none
Fix "service buildbot-worker start" none

Description Alan Somers freebsd_committer freebsd_triage 2017-05-11 04:32:11 UTC
Created attachment 182497 [details]
Patch to fix buildbot-worker rc script

Running "service buildbot-worker start" on FreeBSD 11.0-RELEASE fails with the error "warn 'run_rc_command: cannot run -worker_program".  The reason is because `name` contains a hyphen.  This causes the following line in rc.subr to expand incorrectly:
command=${_override_command:-$command}

The solution is to change name to "buildbot_worker".
Comment 1 Michael Gmelin freebsd_committer freebsd_triage 2017-06-19 11:07:15 UTC
Are you sure this is the correct solution? This would also affect other rc scripts like mysql-server (mysql/mariadb). I think it would be better to fix rc.subr instead if renaming startup scripts and breaking people's administrative procedures in the process.
Comment 2 Alan Somers freebsd_committer freebsd_triage 2017-06-19 15:20:40 UTC
Actually, mariadb does not suffer from this problem.  The name of the rc file isn't important; only the value of the "name" variable is.

grep finds 75 examples throughout the ports tree of PROVIDES lines with a hyphen.  It looks like almost all of them either remove the hyphen or change it to an underscore when setting name.  Exceptions include devel/buildbot-worker, www/tomcat-devel (which does something complicated), and security/sguil with SANCP enabled  (which doesn't seem to work).

buildbot-worker should probably do the same.  I'll update the patch to revert the change to the PROVIDES line but leave the change to name=.
Comment 3 Alan Somers freebsd_committer freebsd_triage 2017-06-19 15:25:09 UTC
Created attachment 183630 [details]
Fix "service buildbot-worker start"

This patch fixes the problem without changing PROVIDES
Comment 4 Alan Somers freebsd_committer freebsd_triage 2017-07-04 04:46:01 UTC
Grembo, are you satisfied with the second patch?  If I don't hear back from you, I'll merge it tomorrow or the day after.
Comment 5 Michael Gmelin freebsd_committer freebsd_triage 2017-07-05 14:09:36 UTC
Looks ok, if it works for you, please commit
Comment 6 commit-hook freebsd_committer freebsd_triage 2017-07-07 03:58:44 UTC
A commit references this bug:

Author: asomers
Date: Fri Jul  7 03:57:40 UTC 2017
New revision: 445207
URL: https://svnweb.freebsd.org/changeset/ports/445207

Log:
  Fix changes unintentionally included in 445206

  devel/py-twisted152/Makefile
  	Revert all changes to this file

  Pointy-hat-to:	asomers

  devel/buildbot-workers/Makefile
  devel/buildbot-workers/files/buildbot-worker.in
  	Revert a 1-line change that I never intended to commit.  However,
  	leave in place the PORTREVISION bump and the other change to the RC
  	script, which I did intend to commit, but in a separate revision,
  	with this change message:

  devel/buildbot-worker rc script fails to start worker

  Running "service buildbot-worker start" on FreeBSD 11.0-RELEASE fails with
  the error "warn 'run_rc_command: cannot run -worker_program".  The reason is
  because `name` contains a hyphen.  This causes the following line in rc.subr
  to expand incorrectly:
  command=${_override_command:-$command}

  The solution is to change name to "buildbot_worker".

  PR:		219207
  Reviewed by:	grembo
  Approved by:	grembo (maintainer)

Changes:
  head/devel/buildbot-worker/files/buildbot-worker.in
  head/devel/py-twisted152/Makefile