Bug 152847 - devel/buildbot-slave: Add a startup script
Summary: devel/buildbot-slave: Add a startup script
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Some People
Assignee: Kubilay Kocak
URL:
Keywords: feature, patch
Depends on:
Blocks:
 
Reported: 2010-12-05 04:40 UTC by Garrett Wollman
Modified: 2016-02-18 17:36 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 Garrett Wollman freebsd_committer freebsd_triage 2010-12-05 04:40:10 UTC
When one installs buildbot-slave, it is likely that one would like the
daemon start automatically once the software is configured.

Fix: 

Here is a very simple one that I am using successfully.  It can only
handle one buildslave environment per machine (I am using one virtual
machine per environment).  It will need a few generalizations to make
it ${PREFIX}-safe and Python-version-independent.  Making buildslave's
startup a bit quieter by default would be a nice addition.

#! /bin/sh
#
# $FreeBSD$
#

# PROVIDE: buildslave
# REQUIRE: LOGIN
# KEYWORD: shutdown

#
# Add the following lines to /etc/rc.conf to enable buildslave:
#
#buildslave_enable="YES"
#buildslave_directory="/home/buildbot/path/to/slave"

. /etc/rc.subr

name="buildslave"
rcvar=`set_rcvar`

load_rc_config $name

: ${buildslave_enable:=NO}
: ${buildslave_directory:=/nonexistent}
: ${buildslave_user:=buildbot}

command="/usr/local/bin/buildslave"
command_interpreter="/usr/local/bin/python2.6"
pidfile="${buildslave_directory}/twistd.pid"
required_dirs="${buildslave_directory}"
flags="${buildslave_flags:-"start ${buildslave_directory}"}"
stop_cmd="buildslave_stop"

buildslave_stop() {
	info "Stopping ${name}."
	${buildslave_program:-$command} stop ${buildslave_directory}
}

run_rc_command "$1"
How-To-Repeat: 
ls /usr/ports/devel/buildbot-slave/files.  Note no rc script.
Comment 1 Olli Hauer freebsd_committer freebsd_triage 2010-12-05 20:00:51 UTC
Responsible Changed
From-To: freebsd-ports-bugs->clsung

Fix Synopsis and assign to maintainer.
Comment 2 Philip M. Gollucci freebsd_committer freebsd_triage 2012-02-11 23:55:19 UTC
Responsible Changed
From-To: clsung->pgollucci

committer&maintainer timeout (clsung ; 433 days) / last commit: 50 days 
ago
Comment 3 Tom Judge freebsd_committer freebsd_triage 2012-06-02 05:23:46 UTC
Responsible Changed
From-To: pgollucci->tj

I'll take this as I'm taking over maintenance of the buildbot ports.
Comment 4 Kubilay Kocak freebsd_committer freebsd_triage 2013-03-10 07:20:29 UTC
Responsible Changed
From-To: tj->koobs

Take buildbot PR's - Approved by: tj (maintainer)
Comment 5 Mark Linimon freebsd_committer freebsd_triage 2014-11-23 05:07:54 UTC
Fix Synopsis.
Comment 6 commit-hook freebsd_committer freebsd_triage 2016-02-18 17:32:39 UTC
A commit references this bug:

Author: koobs
Date: Thu Feb 18 17:31:58 UTC 2016
New revision: 409121
URL: https://svnweb.freebsd.org/changeset/ports/409121

Log:
  devel/buildbot-slave: Add startup script with profile support

  Kill a 5+ year old Bugzilla issue [1] by adding a startup script
  support multiple "profiles" to buildbot-slave.

  This will save me many 10's of minutes restarting ~15 buildbot
  builders over 3 VM's manually every time the power goes out, or the
  Windows host hosting them needs to be restarted :|

  PR:		152847 [1]
  Requested by:	wollman

Changes:
  head/devel/buildbot-slave/Makefile
  head/devel/buildbot-slave/files/buildslave.in
Comment 7 Kubilay Kocak freebsd_committer freebsd_triage 2016-02-18 17:35:00 UTC
Committed, my profuse apologies for this taking so long Garrett.

I wanted to do it right (profile support), and have had this in progress for a while. I came across many niggly issues trying to get it to work well