On 2020/05/10 12:58, Tom Smyth wrote:
> Hello, porters
>
> I was working on fastnetmon on production system
> rcctl starts stops and restarts fastnetmon just fine
> but I noticed when I rebooted the box
> that if I reboot the box fastnetmon wont restart due to a missing
> .var/run/fastnetmon directory.
>
> when I re-create the directory
> mkdir /var/run/fastnemon
> chown _fastnetmon /var/run/fastnetmon
>
> rcctl starts, stops and restarts fastnetmon just fine once that
> directory is re-created and the permissions set...
>
> --
> Kindest regards,
> Tom Smyth.
>
+cc ${MAINTAINER}
The rc script should be changed to do that (and drop the PLIST entry).
Index: Makefile
===================================================================
RCS file: /cvs/ports/net/fastnetmon/Makefile,v
retrieving revision 1.8
diff -u -p -r1.8 Makefile
--- Makefile 26 Apr 2020 20:18:58 -0000 1.8
+++ Makefile 10 May 2020 13:08:14 -0000
@@ -5,7 +5,7 @@ COMMENT = DDoS detector with multiple p
GH_ACCOUNT = pavel-odintsov
GH_PROJECT = fastnetmon
GH_TAGNAME = v1.1.4
-REVISION = 0
+REVISION = 1
HOMEPAGE = https://fastnetmon.com/guides/
Index: pkg/PLIST
===================================================================
RCS file: /cvs/ports/net/fastnetmon/pkg/PLIST,v
retrieving revision 1.2
diff -u -p -r1.2 PLIST
--- pkg/PLIST 4 Sep 2018 12:46:17 -0000 1.2
+++ pkg/PLIST 10 May 2020 13:08:14 -0000
@@ -28,6 +28,5 @@ share/examples/fastnetmon/reformat_code_
share/examples/fastnetmon/reset_redis_stats
@owner _fastnetmon
@group _fastnetmon
-@sample /var/run/fastnetmon/
@sample /var/log/fastnetmon/
@sample /var/log/fastnetmon_attacks/
Index: pkg/fastnetmon.rc
===================================================================
RCS file: /cvs/ports/net/fastnetmon/pkg/fastnetmon.rc,v
retrieving revision 1.2
diff -u -p -r1.2 fastnetmon.rc
--- pkg/fastnetmon.rc 11 Jul 2018 15:24:56 -0000 1.2
+++ pkg/fastnetmon.rc 10 May 2020 13:08:14 -0000
@@ -7,4 +7,8 @@ daemon_user="_fastnetmon"
. /etc/rc.d/rc.subr
+rc_pre() {
+ install -d -o ${daemon_user} /var/run/fastnetmon
+}
+
rc_cmd $1