Changeset 19877
- Timestamp:
- Oct 2, 2008, 5:27:59 PM (18 years ago)
- Location:
- trunk/Nebulous-Server
- Files:
-
- 2 edited
-
Changes (modified) (1 diff)
-
bin/nebdiskd (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Nebulous-Server/Changes
r19797 r19877 14 14 on hung NFS mounts 15 15 - document neb-voladd --host option 16 - add --user and --group options to nebdiskd to select the user/group that 17 daemon will run as 16 18 17 19 0.15 Thu Sep 11 13:00:59 HST 2008 -
trunk/Nebulous-Server/bin/nebdiskd
r19871 r19877 3 3 # Copyright (C) 2007 Joshua Hoblitt 4 4 # 5 # $Id: nebdiskd,v 1. 9 2008-10-03 00:41:55jhoblitt Exp $5 # $Id: nebdiskd,v 1.10 2008-10-03 03:27:59 jhoblitt Exp $ 6 6 7 7 use strict; … … 22 22 use Pod::Usage qw( pod2usage ); 23 23 24 my ($debug, $db, $dbhost, $dbuser, $dbpass, $pidfile, $stop, $restart, $verbose); 24 my ( 25 $debug, 26 $db, 27 $dbhost, 28 $dbuser, 29 $dbpass, 30 $pidfile, 31 $stop, 32 $restart, 33 $verbose, 34 $user, 35 $group, 36 ); 37 25 38 GetOptions( 26 'db|d=s' => \$db, 27 'debug' => \$debug, 28 'host|h=s' => \$dbhost, 29 'pass|p=s' => \$dbpass, 30 'pidfile=s' => \$pidfile, 31 'restart|r' => \$restart, 32 'stop|s' => \$stop, 33 'user|u=s' => \$dbuser, 34 'verbose|v' => \$verbose, 39 'dbhost|h=s' => \$dbhost, 40 'dbpass|p=s' => \$dbpass, 41 'dbuser|u=s' => \$dbuser, 42 'db|D=s' => \$db, 43 'debug|d' => \$debug, 44 'group|g=s' => \$group, 45 'pidfile=s' => \$pidfile, 46 'restart|r' => \$restart, 47 'stop|s' => \$stop, 48 'user=s' => \$user, 49 'verbose|v' => \$verbose, 35 50 ) || pod2usage( 2 ); 36 51 … … 40 55 my $c = read_rcfile($rcfile); 41 56 42 $db ||= $c->get_db || $ENV{'NEB_DB'}; 43 $dbhost ||= $c->get_dbhost || $ENV{'NEB_DBHOST'} || 'localhost'; 44 $dbuser ||= $c->get_dbuser || $ENV{'NEB_USER'}; 45 $dbpass ||= $c->get_dbpass || $ENV{'NEB_PASS'}; 46 $pidfile ||= $c->get_pidfile || "/var/tmp/nebdiskd"; 57 $db ||= $c->get_db || $ENV{'NEB_DB'}; 58 $dbhost ||= $c->get_dbhost || $ENV{'NEB_DBHOST'} || 'localhost'; 59 $dbuser ||= $c->get_dbuser || $ENV{'NEB_USER'}; 60 $dbpass ||= $c->get_dbpass || $ENV{'NEB_PASS'}; 61 $pidfile ||= $c->get_pidfile || "/var/tmp/nebdiskd"; 62 $user ||= $c->get_user || $<; # user 63 $group ||= $c->get_group || $); # group 64 47 65 my $mounts = $c->get_mounts; 48 66 my $poll_interval = $c->get_poll_interval || 5; … … 66 84 67 85 daemonize( 68 $ <, # User69 $ ), # Group86 $user, # User 87 $group, # Group, 70 88 $pidfile, # PID file 71 89 ) unless $debug;
Note:
See TracChangeset
for help on using the changeset viewer.
