Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 30 Dec 2012 00:25:15 +0000 (UTC)
From:      Mark Linimon <linimon@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-projects@freebsd.org
Subject:   svn commit: r244842 - projects/portbuild/etc/rc.d
Message-ID:  <201212300025.qBU0PFpd081367@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: linimon (doc,ports committer)
Date: Sun Dec 30 00:25:15 2012
New Revision: 244842
URL: http://svnweb.freebsd.org/changeset/base/244842

Log:
  Continue the process of weaning these things off uid root.  buildproxy, by
  definition, still runs as root, but its whole existance is in the crosshairs.

Modified:
  projects/portbuild/etc/rc.d/buildproxy
  projects/portbuild/etc/rc.d/pollmachine
  projects/portbuild/etc/rc.d/qmanager

Modified: projects/portbuild/etc/rc.d/buildproxy
==============================================================================
--- projects/portbuild/etc/rc.d/buildproxy	Sun Dec 30 00:23:11 2012	(r244841)
+++ projects/portbuild/etc/rc.d/buildproxy	Sun Dec 30 00:25:15 2012	(r244842)
@@ -1,4 +1,7 @@
 #!/bin/sh
+#
+# installed by the portbuild application
+#
 export PATH=/usr/local/bin:${PATH}
 
 pb=/var/portbuild

Modified: projects/portbuild/etc/rc.d/pollmachine
==============================================================================
--- projects/portbuild/etc/rc.d/pollmachine	Sun Dec 30 00:23:11 2012	(r244841)
+++ projects/portbuild/etc/rc.d/pollmachine	Sun Dec 30 00:25:15 2012	(r244842)
@@ -1,4 +1,7 @@
 #!/bin/sh
+#
+# installed by the portbuild application
+#
 export PATH=/usr/local/bin:${PATH}
 
 pb=/var/portbuild
@@ -8,6 +11,10 @@ if [ ! -f ${config_file} ]; then
   echo "$0: ${config_file} must exist!"
   exit 1
 fi
+if [ -z "${PORTBUILD_USER}" ]; then
+  echo "$0: You must define PORTBUILD_USER in ${config_file}."
+  exit 1
+fi
 
 . ${config_file}
 
@@ -17,7 +24,7 @@ case $1 in
         if [ -x $s ]; then
             running=`ps ax | grep -v grep | grep $s`
             if [ -z "${running}" ]; then
-                ${s} -daemon ${SUPPORTED_ARCHS} &
+                su - ${PORTBUILD_USER} -c "${s} -daemon ${SUPPORTED_ARCHS}" &
                 echo -n ' pollmachine'
             else
                 echo "pollmachine already running"

Modified: projects/portbuild/etc/rc.d/qmanager
==============================================================================
--- projects/portbuild/etc/rc.d/qmanager	Sun Dec 30 00:23:11 2012	(r244841)
+++ projects/portbuild/etc/rc.d/qmanager	Sun Dec 30 00:25:15 2012	(r244842)
@@ -1,4 +1,7 @@
 #!/bin/sh
+#
+# installed by the portbuild application
+#
 export PATH=/usr/local/bin:${PATH}
 
 pb=/var/portbuild
@@ -8,6 +11,10 @@ if [ ! -f ${config_file} ]; then
   echo "$0: ${config_file} must exist!"
   exit 1
 fi
+if [ -z "${PORTBUILD_USER}" ]; then
+  echo "$0: You must define PORTBUILD_USER in ${config_file}."
+  exit 1
+fi
 
 . ${config_file}
 
@@ -17,7 +24,7 @@ case $1 in
         if [ -x $s ]; then
             running=`ps ax | grep -v grep | grep $s`
             if [ -z "${running}" ]; then
-                ${s} &
+                su - ${PORTBUILD_USER} -c "${s}" &
                 echo -n ' qmanager'
             else
                 echo "qmanager already running"



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201212300025.qBU0PFpd081367>