IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 19790


Ignore:
Timestamp:
Sep 30, 2008, 11:55:44 AM (18 years ago)
Author:
jhoblitt
Message:

add a pid file to neb-admin so only one instance can be run at a time

Location:
trunk/Nebulous-Server
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Nebulous-Server/Changes

    r19641 r19790  
    44    - add so_id/name idxs to storage_object_xattr table
    55    - rename neb-addvol -> neb-voladd
     6    - add a pid file to neb-admin so only one instance can be run at a time
    67
    780.15 Thu Sep 11 13:00:59 HST 2008
  • trunk/Nebulous-Server/bin/neb-admin

    r18457 r19790  
    33# Copyright (C) 2005-2008  Joshua Hoblitt
    44#
    5 # $Id: neb-admin,v 1.8 2008-07-10 02:40:33 jhoblitt Exp $
     5# $Id: neb-admin,v 1.9 2008-09-30 21:55:44 jhoblitt Exp $
    66
    77use strict;
     
    1212
    1313use DBI;
     14use Nebulous::Client;
    1415use Nebulous::Server::SQL;
    15 use Nebulous::Client;
     16use Net::Server::Daemonize qw( check_pid_file create_pid_file unlink_pid_file );
    1617use URI;
    1718
     
    4748# set default limit to 5
    4849$limit ||= 5;
     50
     51# check to make sure that only one instance of neb-admin is running
     52my $pidfile = '/var/tmp/neb-admin';
     53$SIG{TERM} = sub { unlink_pid_file($pidfile); exit(); };
     54# abort if an instance is already running
     55check_pid_file($pidfile);
     56create_pid_file($pidfile);
    4957
    5058my $dbh = DBI->connect(
Note: See TracChangeset for help on using the changeset viewer.