Hello,
On Wed, Jul 05, 2023 at 11:36:26AM +0300, Kapetanakis Giannis wrote:
> Tried to replicate the issue today with running relayd in debug mode in order
> to print more details.
>
> /usr/sbin/relayd -d -v
I did poke to sources. try to increase verbosity by using more 'v':
/usr/sbin/relayd -d -vvv
single '-v' does not seem to be enough to make log_debug() to print
anything at least '-vv' is required.
please retry with '-vv' at least.
>
> when relayd exited it only printed:
> pfe: check_table: cannot get table stats for dir-sieve@relayd/dir-sieve: No
> such file or directory
>
> nothing from:
> kill_tables():
> log_debug("%s: deleted %d tables", __func__, cnt);
>
> or
> flush_rulesets():
> log_debug("%s: flushed rules", __func__);
>
> are you sure table delete/removal is coming from there?
I did use 'grep DIOC' on relayd sources to see which pf ioctls
are being used there. The only place where relayd calls
DIOCRCLRTABLES is kill_tables() function. The only way to
get there is via
pfe_shutdown()
flush_rulesets()
kill_tables()
this is the only call stack I can think of when looking at source code.
also keep in mind the log message is displayed after all tables are
removed. so in theory if pfe_statistics() timer fires while tables
are being flushed it may find out table just got deleted and do exit
via fatal(). On the other hand this sounds unlikely given the
stats collection timer runs every minute only.
>
> In any case it shouldn't try to get stats for empty tables.
> Maybe a check should be added in pfe_statistics() ?
>
> G
>
thanks and
regards
sashan