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

◆ SCPidfileCreate()

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 42 of file util-pidfile.c.

References len, O_NOFOLLOW, SCEnter, SCLogError, and SCReturnInt.

◆ SCPidfileRemove()

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 GlobalsDestroy().

Here is the caller graph for this function:

◆ SCPidfileTestRunning()

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 SCLogError.