Debian Codegraph @

src/SysV.hpp

raw
1 // For all support, instructions and copyright go to:
2 // http://e2guardian.org/
3 // Released under the GPL v2, with the OpenSSL exception described in the README file.
4
5 #ifndef __HPP_SYSV
6 #define __HPP_SYSV
7
8 // INCLUDES
9
10 #include "OptionContainer.hpp"
11
12 #include <sys/types.h>
13 #include <string>
14
15 // DECLARATIONS
16
17 // Kill the process specified in the given pidfile, optionally deleting the pidfile while we're at it,
18 // along with the UNIX domain sockets for the old logger & url cache
19 int sysv_kill(std::string pidfile, bool dounlink = true);
20
21 // show PID of running E2 process
22 int sysv_showpid(std::string pidfile);
23 // check that the process in the pidfile is running
24 bool sysv_amirunning(std::string pidfile);
25
26 // delete any existing file with this name, and create a new one with relevant mode flags
27 int sysv_openpidfile(std::string pidfile);
28 // write our pid to the given file & close it
29 int sysv_writepidfile(int pidfilefd,pid_t master_pid);
30
31 // send HUP or USR1 to the process in the pidfile
32 int sysv_hup(std::string pidfile);
33 int sysv_usr1(std::string pidfile);
34
35 #endif