FreeBSD Bugzilla – Attachment 187220 Details for
Bug 223052
[PATCH] security/suricata: fix suricata stale pid file issue
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
v1 - patch - suricata pre_cmd and new config variables
suricata.patch (text/plain), 1.95 KB, created by
Reshad Patuck
on 2017-10-16 19:10:20 UTC
(
hide
)
Description:
v1 - patch - suricata pre_cmd and new config variables
Filename:
MIME Type:
Creator:
Reshad Patuck
Created:
2017-10-16 19:10:20 UTC
Size:
1.95 KB
patch
obsolete
>Index: security/suricata/Makefile >=================================================================== >--- security/suricata/Makefile (revision 452198) >+++ security/suricata/Makefile (working copy) >@@ -3,6 +3,7 @@ > > PORTNAME= suricata > PORTVERSION= 4.0.0 >+PORTREVISION= 1 > CATEGORIES= security > MASTER_SITES= http://www.openinfosecfoundation.org/download/ > >Index: security/suricata/files/suricata.in >=================================================================== >--- security/suricata/files/suricata.in (revision 452198) >+++ security/suricata/files/suricata.in (working copy) >@@ -19,13 +19,17 @@ > # Default: 8000 > # suricata_netmap (str): Set to YES to enable netmap (Inline Mode) > # Default: NO >+# suricata_user (str): Set the user to run suricata as >+# Default: root >+# suricata_pidfile (str): Pidfile to store pid of suricata process >+# Default: /var/run/suricata.pid > >- > . /etc/rc.subr > > name="suricata" > rcvar=suricata_enable > >+start_precmd="suricata_check_pid" > command="%%PREFIX%%/bin/suricata" > > load_rc_config $name >@@ -35,6 +39,8 @@ > [ -z "$suricata_flags" ] && suricata_flags="-D" > [ -z "$suricata_divertport" ] && suricata_divertport="8000" > [ -z "$suricata_netmap" ] && suricata_netmap="NO" >+[ -z "$suricata_user" ] && suricata_user="root" >+[ -z "$suricata_pidfile" ] && suricata_pidfile="/var/run/suricata.pid" > > if [ -n "$suricata_interface" ]; then > for interface in $suricata_interface; do >@@ -47,9 +53,23 @@ > info "Inline Mode on divert port $suricata_divertport (suricata_interface not defined)" > fi > >-pidfile="/var/run/suricata.pid" >+pidfile=$suricata_pidfile > suricata_flags="$suricata_flags --pidfile $pidfile" > > [ -n "$suricata_conf" ] && suricata_flags="$suricata_flags -c $suricata_conf" > >+suricata_check_pid() >+{ >+ run_rc_command status > /dev/null 2>&1 >+ status=$? >+ if [ "$status" == "1" ] >+ then >+ if [ -e $pidfile ] >+ then >+ echo "Stale pid file detected, cleaning up" >+ rm $pidfile >+ fi >+ fi >+} >+ > run_rc_command "$1"
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 223052
:
187220
|
188145