Re: fastnetmon on OpenBSD 6.6 amd64 /var/run/fastnemon missing after reboot

2020-05-10 Thread Tom Smyth
just to clarify

Stuarts diff worked,
and Jerimies Diff with Jaspers addition worked fine also.
sorry I was trigger happy with the send earlier.


On Sun, 10 May 2020 at 15:04, Tom Smyth  wrote:
>
> Hello all,
>
> Tried manually with
>
> install -d -m 0750 -o ${daemon_user} -g ${daemon_user} /var/run/fastnetmon
>
> I was wondering about the world writable pid file .. I was wondering
> why it was needed...
>
> appreciate all your time and help
>
> thanks again
> Tom Smyth
>
> On Sun, 10 May 2020 at 14:48, Klemens Nanni  wrote:
> >
> > On Sun, May 10, 2020 at 03:42:02PM +0200, Jasper Lievisse Adriaanse wrote:
> > > Using 0750 sounds sane to me, OK with me with that bit updated.
> > Same here, OK kn.
>
>
>
> --
> Kindest regards,
> Tom Smyth.



-- 
Kindest regards,
Tom Smyth.



Re: fastnetmon on OpenBSD 6.6 amd64 /var/run/fastnemon missing after reboot

2020-05-10 Thread Tom Smyth
Hello all,

Tried manually with

install -d -m 0750 -o ${daemon_user} -g ${daemon_user} /var/run/fastnetmon

I was wondering about the world writable pid file .. I was wondering
why it was needed...

appreciate all your time and help

thanks again
Tom Smyth

On Sun, 10 May 2020 at 14:48, Klemens Nanni  wrote:
>
> On Sun, May 10, 2020 at 03:42:02PM +0200, Jasper Lievisse Adriaanse wrote:
> > Using 0750 sounds sane to me, OK with me with that bit updated.
> Same here, OK kn.



-- 
Kindest regards,
Tom Smyth.



Re: fastnetmon on OpenBSD 6.6 amd64 /var/run/fastnemon missing after reboot

2020-05-10 Thread Klemens Nanni
On Sun, May 10, 2020 at 03:42:02PM +0200, Jasper Lievisse Adriaanse wrote:
> Using 0750 sounds sane to me, OK with me with that bit updated.
Same here, OK kn.



Re: fastnetmon on OpenBSD 6.6 amd64 /var/run/fastnemon missing after reboot

2020-05-10 Thread Jasper Lievisse Adriaanse



> On 10 May 2020, at 15:39, Jeremie Courreges-Anglas  wrote:
> 
> 
> On Sun, May 10 2020, Stuart Henderson  > wrote:
>> 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}
> 
> Done :)
> 
>> The rc script should be changed to do that (and drop the PLIST entry).
> 
> Same diff, except I used
> 
>   install -m 750 -o _fastnetmon -g _fastnetmon
> 
> The reason for choosing group _fastnetmon and mode 750 is:
> 
> russell /usr/ports/net/fastnetmon$ doas ls -l /var/run/fastnetmon/
> total 4
> -rw-rw-rw-  1 _fastnetmon  _fastnetmon  6 May 10 15:33 fastnetmon.pid
> 
> Anyone can write to the pid file.  If /var/run/fastnetmon contents
> should be shared with other local users then some kind of fix is needed.

Using 0750 sounds sane to me, OK with me with that bit updated.

Thanks,
Jasper

> 
> [...]
> 
>> 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.rc11 Jul 2018 15:24:56 -  1.2
>> +++ pkg/fastnetmon.rc10 May 2020 13:08:14 -
>> @@ -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
>> 
>> 
> 
> -- 
> jca | PGP : 0x1524E7EE / 5135 92C1 AD36 5293 2BDF  DDCC 0DFA 74AE 1524 E7EE



Re: fastnetmon on OpenBSD 6.6 amd64 /var/run/fastnemon missing after reboot

2020-05-10 Thread Jeremie Courreges-Anglas


On Sun, May 10 2020, Stuart Henderson  wrote:
> 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}

Done :)

> The rc script should be changed to do that (and drop the PLIST entry).

Same diff, except I used

   install -m 750 -o _fastnetmon -g _fastnetmon

The reason for choosing group _fastnetmon and mode 750 is:

russell /usr/ports/net/fastnetmon$ doas ls -l /var/run/fastnetmon/
total 4
-rw-rw-rw-  1 _fastnetmon  _fastnetmon  6 May 10 15:33 fastnetmon.pid

Anyone can write to the pid file.  If /var/run/fastnetmon contents
should be shared with other local users then some kind of fix is needed.

[...]

> 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 -  1.2
> +++ pkg/fastnetmon.rc 10 May 2020 13:08:14 -
> @@ -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
>
>

-- 
jca | PGP : 0x1524E7EE / 5135 92C1 AD36 5293 2BDF  DDCC 0DFA 74AE 1524 E7EE



Re: fastnetmon on OpenBSD 6.6 amd64 /var/run/fastnemon missing after reboot

2020-05-10 Thread Tom Smyth
Hello Stuart, Jasper, all,

 Tried that  (manually) by  adding the diff to my /etc/rc.d/fasnetmon
on my install
(and I learned something new  about OpenBSD rcctl  in the process )

Thanks  Stuart, Jasper and all

appreciate your time and help

On Sun, 10 May 2020 at 14:09, Stuart Henderson  wrote:
>
> 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
> --- Makefile26 Apr 2020 20:18:58 -  1.8
> +++ Makefile10 May 2020 13:08:14 -
> @@ -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 -   1.2
> +++ pkg/PLIST   10 May 2020 13:08:14 -
> @@ -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 -  1.2
> +++ pkg/fastnetmon.rc   10 May 2020 13:08:14 -
> @@ -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
>
>


-- 
Kindest regards,
Tom Smyth.



Re: fastnetmon on OpenBSD 6.6 amd64 /var/run/fastnemon missing after reboot

2020-05-10 Thread Stuart Henderson
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
--- Makefile26 Apr 2020 20:18:58 -  1.8
+++ Makefile10 May 2020 13:08:14 -
@@ -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 -   1.2
+++ pkg/PLIST   10 May 2020 13:08:14 -
@@ -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 -  1.2
+++ pkg/fastnetmon.rc   10 May 2020 13:08:14 -
@@ -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