Index: trunk/Nebulous-Server/Changes
===================================================================
--- trunk/Nebulous-Server/Changes	(revision 19740)
+++ trunk/Nebulous-Server/Changes	(revision 19790)
@@ -4,4 +4,5 @@
     - add so_id/name idxs to storage_object_xattr table
     - rename neb-addvol -> neb-voladd
+    - add a pid file to neb-admin so only one instance can be run at a time
 
 0.15 Thu Sep 11 13:00:59 HST 2008
Index: trunk/Nebulous-Server/bin/neb-admin
===================================================================
--- trunk/Nebulous-Server/bin/neb-admin	(revision 19740)
+++ trunk/Nebulous-Server/bin/neb-admin	(revision 19790)
@@ -3,5 +3,5 @@
 # Copyright (C) 2005-2008  Joshua Hoblitt
 #
-# $Id: neb-admin,v 1.8 2008-07-10 02:40:33 jhoblitt Exp $
+# $Id: neb-admin,v 1.9 2008-09-30 21:55:44 jhoblitt Exp $
 
 use strict;
@@ -12,6 +12,7 @@
 
 use DBI;
+use Nebulous::Client;
 use Nebulous::Server::SQL;
-use Nebulous::Client;
+use Net::Server::Daemonize qw( check_pid_file create_pid_file unlink_pid_file );
 use URI;
 
@@ -47,4 +48,11 @@
 # set default limit to 5
 $limit ||= 5;
+
+# check to make sure that only one instance of neb-admin is running
+my $pidfile = '/var/tmp/neb-admin';
+$SIG{TERM} = sub { unlink_pid_file($pidfile); exit(); };
+# abort if an instance is already running
+check_pid_file($pidfile);
+create_pid_file($pidfile);
 
 my $dbh = DBI->connect(
