--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/lib/scripts/process Mon Sep 20 23:36:26 2010 +0200
@@ -0,0 +1,34 @@
+#!/usr/bin/env perl
+#
+# Author: Makarius
+#
+# exec process - with optional process group and report of pid
+#
+
+use warnings;
+use strict;
+
+# args
+
+my ($group, $pid_name, $cmd_line) = @ARGV;
+
+
+# process group
+
+if ($group eq "group") {
+ use POSIX "setsid";
+ POSIX::setsid || die $!;
+}
+
+
+# pid
+
+open (PID_FILE, ">", $pid_name) || die $!;
+print PID_FILE "$$";
+close PID_FILE;
+
+
+# exec process
+
+exec "$cmd_line";
+