suricata
util-daemon.c File Reference
#include "suricata.h"
#include "suricata-common.h"
#include "runmodes.h"
#include "util-daemon.h"
#include "util-debug.h"
#include "conf.h"
#include <sys/wait.h>
#include <sys/stat.h>
#include <fcntl.h>
Include dependency graph for util-daemon.c:

Go to the source code of this file.

Functions

void Daemonize (void)
 Daemonize the process. More...
 
int CheckValidDaemonModes (int daemon, int mode)
 Check for a valid combination daemon/mode. More...
 

Detailed Description

Author
Gerardo Iglesias Galvan igles.nosp@m.iasg.nosp@m.@gmai.nosp@m.l.co.nosp@m.m

Daemonization process

Definition in file util-daemon.c.

Function Documentation

int CheckValidDaemonModes ( int  daemon,
int  mode 
)

Check for a valid combination daemon/mode.

Parameters
daemondaemon on or off
modeselected mode
Return values
1valid combination
0invalid combination

Definition at line 174 of file util-daemon.c.

References RUNMODE_PCAP_FILE, RUNMODE_UNITTEST, SC_ERR_INVALID_RUNMODE, SCLogDebug, and SCLogError.

Referenced by PostRunDeinit().

Here is the caller graph for this function:

void Daemonize ( void  )

Daemonize the process.

Todo:
We should check if wie allow more than 1 instance to run simultaneously. Maybe change the behaviour through conf file

Definition at line 102 of file util-daemon.c.

References ConfGet(), SC_ERR_DAEMON, SCLogDebug, and SCLogError.

Referenced by GetProgramVersion().

Here is the call graph for this function:

Here is the caller graph for this function: