Get pidfile from config file if not available in command options

remotes/origin/master-1.2.x
deltay 13 years ago committed by Victor Julien
parent 262a7300d7
commit 211193b0af

@ -1383,6 +1383,11 @@ int main(int argc, char **argv)
if (daemon == 1) {
Daemonize();
if (pid_filename == NULL) {
if (ConfGet("pid-file", &pid_filename) == 1) {
SCLogInfo("Use pid file %s from config file.", pid_filename);
}
}
if (pid_filename != NULL) {
if (SCPidfileCreate(pid_filename) != 0) {
pid_filename = NULL;

@ -19,6 +19,10 @@
# to get the runmode custom modes that can be used here for a particular runmode.
#runmode: auto
# Default pid file.
# Will use this file if no --pidfile in command options.
#pid-file: /var/run/suricata.pid
# Preallocated size for packet. Default is 1514 which is the classical
# size for pcap on ethernet. You should adjust this value to the highest
# packet size (MTU + hardware header) on your system.

Loading…
Cancel
Save