snaplock: snaplock_info.cpp Source File

snaplock  1.7.14
The multi-computer lock service.
snaplock_info.cpp
Go to the documentation of this file.
1 /*
2  * Text:
3  * snaplock/src/snaplock_info.cpp
4  *
5  * Description:
6  * A daemon to synchronize processes between any number of computers
7  * by blocking all of them but one.
8  *
9  * The interrupt implementation listens for the Ctrl-C or SIGINT Unix
10  * signal. When the signal is received, it calls the stop function
11  * of the snaplock object to simulate us receiving a STOP message.
12  *
13  * License:
14  * Copyright (c) 2016-2019 Made to Order Software Corp. All Rights Reserved
15  *
18  *
19  * Permission is hereby granted, free of charge, to any person obtaining a
20  * copy of this software and associated documentation files (the
21  * "Software"), to deal in the Software without restriction, including
22  * without limitation the rights to use, copy, modify, merge, publish,
23  * distribute, sublicense, and/or sell copies of the Software, and to
24  * permit persons to whom the Software is furnished to do so, subject to
25  * the following conditions:
26  *
27  * The above copyright notice and this permission notice shall be included
28  * in all copies or substantial portions of the Software.
29  *
30  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
31  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
32  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
33  * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
34  * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
35  * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
36  * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
37  */
38 
39 
40 // ourselves
41 //
42 #include "snaplock.h"
43 
44 // our lib
45 //
46 #include <snapwebsites/log.h>
47 
48 
49 namespace snaplock
50 {
51 
77  : snap_signal(SIGUSR1)
78  , f_snaplock(sl)
79 {
80  unblock_signal_on_destruction();
81  set_name("snap lock info");
82 }
83 
84 
99 {
100  // we simulate the STOP, so pass 'false' (i.e. not quitting)
101  //
102  f_snaplock->info();
103 }
104 
105 
106 
107 
108 
109 
110 }
111 // snaplock namespace
112 // vim: ts=4 sw=4 et
snaplock * f_snaplock
Definition: snaplock.h:127
snaplock_info(snaplock *sl)
The snaplock info initialization.
void info()
Output various data about the snaplock current status.
Definition: snaplock.cpp:1243
virtual void process_signal() override
Call the info function of the snaplock object.

This document is part of the Snap! Websites Project.

Copyright by Made to Order Software Corp.

Syndicate content

Snap! Websites
An Open Source CMS System in C++

Contact Us Directly