]> git.sur5r.net Git - openldap/blob - servers/slurpd/admin.c
Converted ch_malloc and ch_calloc calls to SLAP_MALLOC and SLAP_CALLOC.
[openldap] / servers / slurpd / admin.c
1 /* $OpenLDAP$ */
2 /*
3  * Copyright 1998-2002 The OpenLDAP Foundation, All Rights Reserved.
4  * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
5  */
6 /*
7  * Copyright (c) 1996 Regents of the University of Michigan.
8  * All rights reserved.
9  *
10  * Redistribution and use in source and binary forms are permitted
11  * provided that this notice is preserved and that due credit is given
12  * to the University of Michigan at Ann Arbor. The name of the University
13  * may not be used to endorse or promote products derived from this
14  * software without specific prior written permission. This software
15  * is provided ``as is'' without express or implied warranty.
16  */
17
18 /*
19  * admin.c - routines for performing administrative tasks, e.g. on-the-fly
20  * reconfiguration of slurpd.
21  */
22
23 #include "portable.h"
24
25 #include <stdio.h>
26 #include <ac/stdlib.h>
27
28 #include <ac/signal.h>
29
30 #include "slurp.h"
31 #include "globals.h"
32
33
34 /*
35  * Eventually, do_admin will be the entry point for performing
36  * administrative tasks.  General idea: put commands in a file
37  * somewhere, send slurpd a USR2 signal.  The handler for
38  * USR2 (this routine) reads the file and takes some action.
39  *
40  * For right now, this routine has been hijacked for debugging.  When
41  * slurpd receives a USR2 signal, it will dump its replication 
42  * queue to the disk file given by SLURPD_DUMPFILE.
43  */
44 RETSIGTYPE
45 do_admin( int sig )
46 {
47     sglob->rq->rq_dump( sglob->rq );
48     (void) SIGNAL_REINSTALL( sig, do_admin );
49 }