Import daemontools script.
authorPatrick R McDonald <marlowe@antagonism.org>
Sun, 7 Jun 2009 01:35:06 +0000 (03:35 +0200)
committerJelmer Vernooij <jelmer@samba.org>
Sun, 7 Jun 2009 01:35:06 +0000 (03:35 +0200)
contrib/service-ctrlproxy-run [new file with mode: 0644]

diff --git a/contrib/service-ctrlproxy-run b/contrib/service-ctrlproxy-run
new file mode 100644 (file)
index 0000000..c676794
--- /dev/null
@@ -0,0 +1,49 @@
+#!/bin/sh
+#
+# service-ctrlproxy-run
+# Patrick R McDonald <marlowe@antagonism.org> 2009-04-23
+#
+#######################################################################
+#
+# Copyright (C) 2009 Patrick R McDonald
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 2 or version 3 of the
+# license, at your option.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses>
+#
+#######################################################################
+
+CONFIG=
+
+UU=ctrlproxy
+GG=ctrlproxy
+
+#######################################################################
+#
+# build the command line
+
+CMD="setuidgid ${UU:?UU not defined} ${GG:?GG not defined}"
+
+if [ -n "${CONFIG:-}" ]
+then
+        CMD="$CMD -C $CONFIG"
+fi
+
+#######################################################################
+#
+# do the deed
+
+umask 022
+
+echo "$CMD"
+exec env - PATH="/usr/bin:/bin:/usr/local/bin:/usr/local/sbin" $CMD 2>&1
+echo exec failed