pkgsrc-WIP-changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

suricata: add initial rc.d script



Module Name:	pkgsrc-wip
Committed By:	kami <kisskamizeg%gmail.com@localhost>
Pushed By:	kami
Date:		Fri Oct 3 20:27:30 2025 +0200
Changeset:	4cd05c37f421b9cfe2d97ca902a540d1bf4f2de9

Modified Files:
	suricata/Makefile
	suricata/TODO
Added Files:
	suricata/files/suricata.sh

Log Message:
suricata: add initial rc.d script

To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=4cd05c37f421b9cfe2d97ca902a540d1bf4f2de9

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

diffstat:
 suricata/Makefile          |  4 +++-
 suricata/TODO              |  6 +++---
 suricata/files/suricata.sh | 44 ++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 50 insertions(+), 4 deletions(-)

diffs:
diff --git a/suricata/Makefile b/suricata/Makefile
index cb9a562e7d..c6358abdc3 100644
--- a/suricata/Makefile
+++ b/suricata/Makefile
@@ -29,6 +29,8 @@ PKG_OPTIONS_VAR=	PKG_OPTIONS.suricata
 PKG_SUPPORTED_OPTIONS=	enable-unittests enable-debug enable-profiling
 #PKG_SUGGESTED_OPTIONS=
 
+RCD_SCRIPTS+=		suricata
+
 .include "../../mk/bsd.prefs.mk"
 
 .include "../../mk/bsd.options.mk"
@@ -53,7 +55,7 @@ post-install:
 	&& env ${INSTALL_ENV} ${MAKE_ENV} \
 		${MAKE_PROGRAM} install-conf \
 			&& ${MV} ${DESTDIR}${PREFIX}/etc/suricata/* ${DESTDIR}${EGDIR} \
-				&& find ${DESTDIR}{EGDIR} -type f -print | sort \
+				&& find ${DESTDIR}${EGDIR} -type f -print | sort \
 					> ${WRKDIR}/PLIST_DYNAMIC
 # plist gen helper
 PLIST.SRC+=	${WRKDIR}/PLIST_DYNAMIC
diff --git a/suricata/TODO b/suricata/TODO
index 7101cf29c1..e1e03b172f 100644
--- a/suricata/TODO
+++ b/suricata/TODO
@@ -10,15 +10,15 @@
   and add support
 
 * Build / porting
-- revise creation and use of cpu sets
   
 * Tests
 - enable and run tests, evaluate and fix them
 - run executables, fix errors
 
-* Package
+* Package / Install
+- fix localstatedir [PREFIX/var] and create subdirs
+  - log/suricata
 
-* Install
 
 * Possible vulnerabilities to investigate and fix if possible
 - CVE-2025-59147
diff --git a/suricata/files/suricata.sh b/suricata/files/suricata.sh
new file mode 100644
index 0000000000..5dec6c9fca
--- /dev/null
+++ b/suricata/files/suricata.sh
@@ -0,0 +1,44 @@
+#!@RCD_SCRIPTS_SHELL@
+#
+# $NetBSD$
+#
+# PROVIDE: suricata
+# REQUIRE: DAEMON
+# KEYWORD: shutdown
+
+if [ -f /etc/rc.subr ]; then
+	. /etc/rc.subr
+fi
+
+: ${suricata_conf:=@PKG_SYSCONFDIR@/suricata.yaml}
+
+name="suricata"
+rcvar=$name
+command="@PREFIX@/sbin/${name}"
+pidfile="@VARBASE@/run/${name}.pid"
+required_files="${suricata_conf}"
+command_args="-D"
+
+if [ -f /etc/rc.subr -a -f /etc/rc.conf -a -f /etc/rc.d/DAEMON ]; then
+	load_rc_config $name
+	run_rc_command "$1"
+else
+	if [ -f /etc/rc.conf ]; then
+		. /etc/rc.conf
+	fi
+	case $1 in
+	start)
+		start_cmd="${command} ${suricata_flags} ${command_args}"
+		if [ -x ${command} -a -f ${suricata_conf} ] ; then
+			${start_cmd}
+		fi
+		;;
+	stop)
+		${stop_cmd}
+		;;
+	*)
+		@ECHO@ "Usage: $0 {start|stop}" 1>&2
+		exit 64
+		;;
+	esac
+fi


Home | Main Index | Thread Index | Old Index