suricata
util-pidfile.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

int SCPidfileCreate (const char *)
 Write a pid file (used at the startup) This commonly needed by the init scripts. More...
 
void SCPidfileRemove (const char *)
 Remove the pid file (used at the startup) More...
 
int SCPidfileTestRunning (const char *pid_filename)
 Check the Suricata pid file (used at the startup) More...
 

Detailed Description

Function Documentation

int SCPidfileCreate ( const char *  pidfile)

Write a pid file (used at the startup) This commonly needed by the init scripts.

Parameters
pointerto the name of the pid file to write (optarg)
Return values
0if succes
-1on failure

Definition at line 41 of file util-pidfile.c.

References len, O_NOFOLLOW, SC_ERR_PIDFILE_OPEN, SC_ERR_PIDFILE_SNPRINTF, SC_ERR_PIDFILE_WRITE, SCEnter, SCLogError, and SCReturnInt.

Referenced by RegisterAllModules().

Here is the caller graph for this function:

void SCPidfileRemove ( const char *  pid_filename)

Remove the pid file (used at the startup)

Parameters
pointerto the name of the pid file to write (optarg)

Definition at line 83 of file util-pidfile.c.

Referenced by GlobalsInitPreConfig().

Here is the caller graph for this function:

int SCPidfileTestRunning ( const char *  pid_filename)

Check the Suricata pid file (used at the startup)

This commonly needed by the init scripts.

This function will fail if the PID file exists, but tries to log a meaningful message if appears Suricata is running, or if the PID file appears to be stale.

Parameters
pointerto the name of the pid file to write (optarg)
Return values
0if succes
-1on failure

Definition at line 105 of file util-pidfile.c.

References SC_ERR_INITIALIZATION, and SCLogError.

Referenced by RegisterAllModules().

Here is the caller graph for this function: