]> git.sur5r.net Git - openldap/blob - servers/slurpd/admin.c
fix controls propagation (ITS#3813)
[openldap] / servers / slurpd / admin.c
1 /* $OpenLDAP$ */
2 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
3  *
4  * Copyright 1998-2005 The OpenLDAP Foundation.
5  * All rights reserved.
6  *
7  * Redistribution and use in source and binary forms, with or without
8  * modification, are permitted only as authorized by the OpenLDAP
9  * Public License.
10  *
11  * A copy of this license is available in file LICENSE in the
12  * top-level directory of the distribution or, alternatively, at
13  * <http://www.OpenLDAP.org/license.html>.
14  */
15 /* Portions Copyright (c) 1996 Regents of the University of Michigan.
16  * All rights reserved.
17  *
18  * Redistribution and use in source and binary forms are permitted
19  * provided that this notice is preserved and that due credit is given
20  * to the University of Michigan at Ann Arbor. The name of the University
21  * may not be used to endorse or promote products derived from this
22  * software without specific prior written permission. This software
23  * is provided ``as is'' without express or implied warranty.
24  */
25 /* ACKNOWLEDGEMENTS:
26  * This work was originally developed by the University of Michigan
27  * (as part of U-MICH LDAP).
28  */
29
30 /*
31  * admin.c - routines for performing administrative tasks, e.g. on-the-fly
32  * reconfiguration of slurpd.
33  */
34
35 #include "portable.h"
36
37 #include <stdio.h>
38 #include <ac/stdlib.h>
39
40 #include <ac/signal.h>
41
42 #include "slurp.h"
43 #include "globals.h"
44
45
46 /*
47  * Eventually, do_admin will be the entry point for performing
48  * administrative tasks.  General idea: put commands in a file
49  * somewhere, send slurpd a USR2 signal.  The handler for
50  * USR2 (this routine) reads the file and takes some action.
51  *
52  * For right now, this routine has been hijacked for debugging.  When
53  * slurpd receives a USR2 signal, it will dump its replication 
54  * queue to the disk file given by SLURPD_DUMPFILE.
55  */
56 RETSIGTYPE
57 do_admin( int sig )
58 {
59     sglob->rq->rq_dump( sglob->rq );
60     (void) SIGNAL_REINSTALL( sig, do_admin );
61 }