Index: trunk/Nebulous-Server/bin/nebdiskd
===================================================================
--- trunk/Nebulous-Server/bin/nebdiskd	(revision 19871)
+++ trunk/Nebulous-Server/bin/nebdiskd	(revision 19877)
@@ -3,5 +3,5 @@
 # Copyright (C) 2007  Joshua Hoblitt
 # 
-# $Id: nebdiskd,v 1.9 2008-10-03 00:41:55 jhoblitt Exp $
+# $Id: nebdiskd,v 1.10 2008-10-03 03:27:59 jhoblitt Exp $
 
 use strict;
@@ -22,15 +22,30 @@
 use Pod::Usage qw( pod2usage );
 
-my ($debug, $db, $dbhost, $dbuser, $dbpass, $pidfile, $stop, $restart, $verbose);
+my (
+    $debug, 
+    $db, 
+    $dbhost, 
+    $dbuser, 
+    $dbpass, 
+    $pidfile, 
+    $stop, 
+    $restart, 
+    $verbose,
+    $user,
+    $group,
+);
+
 GetOptions(
-    'db|d=s'    => \$db,
-    'debug'     => \$debug,
-    'host|h=s'  => \$dbhost,
-    'pass|p=s'  => \$dbpass,
-    'pidfile=s' => \$pidfile,
-    'restart|r' => \$restart,
-    'stop|s'    => \$stop,
-    'user|u=s'  => \$dbuser,
-    'verbose|v' => \$verbose,
+    'dbhost|h=s'    => \$dbhost,
+    'dbpass|p=s'    => \$dbpass,
+    'dbuser|u=s'    => \$dbuser,
+    'db|D=s'        => \$db,
+    'debug|d'       => \$debug,
+    'group|g=s'     => \$group,
+    'pidfile=s'     => \$pidfile,
+    'restart|r'     => \$restart,
+    'stop|s'        => \$stop,
+    'user=s'        => \$user,
+    'verbose|v'     => \$verbose,
 ) || pod2usage( 2 );
 
@@ -40,9 +55,12 @@
 my $c = read_rcfile($rcfile);
 
-$db     ||= $c->get_db      || $ENV{'NEB_DB'};
-$dbhost ||= $c->get_dbhost  || $ENV{'NEB_DBHOST'} || 'localhost';
-$dbuser ||= $c->get_dbuser  || $ENV{'NEB_USER'};
-$dbpass ||= $c->get_dbpass  || $ENV{'NEB_PASS'};
-$pidfile ||= $c->get_pidfile || "/var/tmp/nebdiskd";
+$db         ||= $c->get_db      || $ENV{'NEB_DB'};
+$dbhost     ||= $c->get_dbhost  || $ENV{'NEB_DBHOST'} || 'localhost';
+$dbuser     ||= $c->get_dbuser  || $ENV{'NEB_USER'};
+$dbpass     ||= $c->get_dbpass  || $ENV{'NEB_PASS'};
+$pidfile    ||= $c->get_pidfile || "/var/tmp/nebdiskd";
+$user       ||= $c->get_user    || $<; # user
+$group      ||= $c->get_group   || $); # group
+
 my $mounts = $c->get_mounts;
 my $poll_interval = $c->get_poll_interval || 5;
@@ -66,6 +84,6 @@
 
 daemonize(
-    $<,     # User
-    $),     # Group
+    $user,     # User
+    $group,    # Group,
     $pidfile,  # PID file
 ) unless $debug;
