File: admin.c

package info (click to toggle)
openldap2 2.0.23-6.3
  • links: PTS
  • area: main
  • in suites: woody
  • size: 7,816 kB
  • ctags: 6,366
  • sloc: ansic: 86,391; sh: 9,816; makefile: 1,270; cpp: 1,107; sql: 838; php: 700; perl: 134; tcl: 40
file content (44 lines) | stat: -rw-r--r-- 1,378 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
/* $OpenLDAP: pkg/ldap/servers/slurpd/admin.c,v 1.4.8.3 2000/07/29 01:53:17 kurt Exp $ */
/*
 * Copyright (c) 1996 Regents of the University of Michigan.
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms are permitted
 * provided that this notice is preserved and that due credit is given
 * to the University of Michigan at Ann Arbor. The name of the University
 * may not be used to endorse or promote products derived from this
 * software without specific prior written permission. This software
 * is provided ``as is'' without express or implied warranty.
 */

/*
 * admin.c - routines for performing administrative tasks, e.g. on-the-fly
 * reconfiguration of slurpd.
 */

#include "portable.h"

#include <stdio.h>

#include <ac/signal.h>

#include "slurp.h"
#include "globals.h"


/*
 * Eventually, do_admin will be the entry point for performing
 * administrative tasks.  General idea: put commands in a file
 * somewhere, send slurpd a USR2 signal.  The handler for
 * USR2 (this routine) reads the file and takes some action.
 *
 * For right now, this routine has been hijacked for debugging.  When
 * slurpd receives a USR2 signal, it will dump its replication 
 * queue to the disk file given by SLURPD_DUMPFILE.
 */
RETSIGTYPE
do_admin( int sig )
{
    sglob->rq->rq_dump( sglob->rq );
    (void) SIGNAL_REINSTALL( sig, do_admin );
}