Re: rspamd stop rc script doesn't work in OpenBSD 6.6

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

Re: rspamd stop rc script doesn't work in OpenBSD 6.6

Jordan Geoghegan-3

On 2019-10-27 17:29, Chris Narkiewicz wrote:

> Rspamd stop rc script doesn't work in OpenBSD 6.6.
>
> 1. Fresh OpenBSD 6.6 installation
> 2. pkg_add rspamd
> 3. rcctl start rspamd
>
> Works.
>
> 4. rcctl stop rspamd timeouts
>
> Looking at rspamd logs, it looks like it doesn not work
> well with SIGTERM. It waits for workers.
>
> Currently I work around it by adding custom rc_stop():
>
> rc_stop() {
>     pkill -KILL -T "${daemon_rtable}" -xf "${pexp}"
>     pkill -KILL -u _rspamd
> }
>
>
> Anybody can confirm if this is a problem?
>

Yes, can confirm. I think I read something the other day mentioning
sthen@ possibly having a diff floating around to fix the issue.
Hopefully the fix will be backported to -stable.

Reply | Threaded
Open this post in threaded view
|

Re: rspamd stop rc script doesn't work in OpenBSD 6.6

List
On Sun, 27 Oct 2019 21:29:41 -0700
Jordan Geoghegan <[hidden email]> wrote:

> On 2019-10-27 17:29, Chris Narkiewicz wrote:
> > Rspamd stop rc script doesn't work in OpenBSD 6.6.
> >
> > 1. Fresh OpenBSD 6.6 installation
> > 2. pkg_add rspamd
> > 3. rcctl start rspamd
> >
> > Works.
> >
> > 4. rcctl stop rspamd timeouts
> >
> > Looking at rspamd logs, it looks like it doesn not work
> > well with SIGTERM. It waits for workers.
> >
> > Currently I work around it by adding custom rc_stop():
> >
> > rc_stop() {
> >     pkill -KILL -T "${daemon_rtable}" -xf "${pexp}"
> >     pkill -KILL -u _rspamd
> > }
> >
> >
> > Anybody can confirm if this is a problem?
> >  
>
> Yes, can confirm. I think I read something the other day mentioning
> sthen@ possibly having a diff floating around to fix the issue.
> Hopefully the fix will be backported to -stable.
>

Hi,
I am myself running a MX that uses rspamd + postfix.
I did have the same issue. Especially when running rspamd and adding
redis to the setup.
I think what causes the problem is rspamd which uses JITs. These JITS
break W^X. If you enable rspamd etc on boot by (rcctl enable ...). And
reboot.. Everything works fine. At least for me did.
Don't hesitate asking.

Kind regards,
Stephan

prx
Reply | Threaded
Open this post in threaded view
|

Re: rspamd stop rc script doesn't work in OpenBSD 6.6

prx
* List <[hidden email]> le [29-10-2019 21:44:43 +0100]:

> On Sun, 27 Oct 2019 21:29:41 -0700
> Jordan Geoghegan <[hidden email]> wrote:
>
> > On 2019-10-27 17:29, Chris Narkiewicz wrote:
> > > Rspamd stop rc script doesn't work in OpenBSD 6.6.
> > >
> > > 1. Fresh OpenBSD 6.6 installation
> > > 2. pkg_add rspamd
> > > 3. rcctl start rspamd
> > >
> > > Works.
> > >
> > > 4. rcctl stop rspamd timeouts
> > >
> > > Looking at rspamd logs, it looks like it doesn not work
> > > well with SIGTERM. It waits for workers.
> > >
> > > Currently I work around it by adding custom rc_stop():
> > >
> > > rc_stop() {
> > >     pkill -KILL -T "${daemon_rtable}" -xf "${pexp}"
> > >     pkill -KILL -u _rspamd
> > > }
> > >
> > >
> > > Anybody can confirm if this is a problem?
> > >  
> >

Confirm, I had this issue too and must kill rspamd manually.
--
    prx

Reply | Threaded
Open this post in threaded view
|

Re: rspamd stop rc script doesn't work in OpenBSD 6.6

Stuart Henderson
In reply to this post by List
On 2019-10-29, List <[hidden email]> wrote:
> I think what causes the problem is rspamd which uses JITs. These JITS
> break W^X. If you enable rspamd etc on boot by (rcctl enable ...). And
> reboot..

This is incorrect. rspamd uses luajit (on arches where it's available),
but it is not a requirement that every JIT compiler makes W+X mappings -
in particular luajit *does* work with W^X.


Reply | Threaded
Open this post in threaded view
|

Re: rspamd stop rc script doesn't work in OpenBSD 6.6

Özgür Kazancci
In reply to this post by List
Hi Stephan,

I got the same trouble. Fresh installation of OpenBSD 6.6 and
redis+rspamd. Was google-ing regarding that issue and got your
workaround.

What you mean by "if you enable rspamd etc on boot by rcctl.."? Mine, is
already enabled (I issued rcctl enable rspamd after the installation)

Thank you,
Ozgur.



On 29/10/2019 23:44, List wrote:

> Hi,
> I am myself running a MX that uses rspamd + postfix.
> I did have the same issue. Especially when running rspamd and adding
> redis to the setup.
> I think what causes the problem is rspamd which uses JITs. These JITS
> break W^X. If you enable rspamd etc on boot by (rcctl enable ...). And
> reboot.. Everything works fine. At least for me did.
> Don't hesitate asking.
>
> Kind regards,
> Stephan

Reply | Threaded
Open this post in threaded view
|

Re: rspamd stop rc script doesn't work in OpenBSD 6.6

aisha
You need to use pkill -9 to kill rspamd, which i think should be added
to the stop part of the rspamd daemon.

At least this is what I have been using, any other methods would be nice
to know.

---
Aisha
blog.aisha.cc

On 2020-02-09 14:38, Özgür Kazancci wrote:

> Hi Stephan,
>
> I got the same trouble. Fresh installation of OpenBSD 6.6 and
> redis+rspamd. Was google-ing regarding that issue and got your
> workaround.
>
> What you mean by "if you enable rspamd etc on boot by rcctl.."? Mine,
> is already enabled (I issued rcctl enable rspamd after the
> installation)
>
> Thank you,
> Ozgur.
>
>
>
> On 29/10/2019 23:44, List wrote:
>> Hi,
>> I am myself running a MX that uses rspamd + postfix.
>> I did have the same issue. Especially when running rspamd and adding
>> redis to the setup.
>> I think what causes the problem is rspamd which uses JITs. These JITS
>> break W^X. If you enable rspamd etc on boot by (rcctl enable ...). And
>> reboot.. Everything works fine. At least for me did.
>> Don't hesitate asking.
>>
>> Kind regards,
>> Stephan

Reply | Threaded
Open this post in threaded view
|

Re: rspamd stop rc script doesn't work in OpenBSD 6.6

Jordan Geoghegan-3


On 2020-02-09 11:46, aisha wrote:
> You need to use pkill -9 to kill rspamd, which i think should be added
> to the stop part of the rspamd daemon.
>
> At least this is what I have been using, any other methods would be
> nice to know.
>

You dont need to restart rspamd if you're just modifying a config file.

You can just run "rcctl reload rspamd" to reload your config files if
you've made any changes.

The rspamd maintainer has acknowledged the issue, and the restarting
issue is fixed in current.

Reply | Threaded
Open this post in threaded view
|

Re: rspamd stop rc script doesn't work in OpenBSD 6.6

Stuart Henderson
In reply to this post by aisha
On 2020-02-09, aisha <[hidden email]> wrote:
> You need to use pkill -9 to kill rspamd, which i think should be added
> to the stop part of the rspamd daemon.
>
> At least this is what I have been using, any other methods would be nice
> to know.

Something wedges in rspamd in the version in 6.6 when you signal it to
shutdown, I didn't manage to track it down before 6.6 release. It was
fixed in newer rspamd so works just fine in -current, but that's too
big of an update to backport to 6.6-stable (and really the main practical
effect on 6.6 is that your reboots are ~30 seconds slower than they should
be).


Reply | Threaded
Open this post in threaded view
|

Re: rspamd stop rc script doesn't work in OpenBSD 6.6

Diana Eichert
In reply to this post by aisha
SIGKILL seems pretty harsh, have you tried SIGTERM instead?

On Sun, Feb 9, 2020 at 12:48 PM aisha <[hidden email]> wrote:

>
> You need to use pkill -9 to kill rspamd, which i think should be added
> to the stop part of the rspamd daemon.
>
> At least this is what I have been using, any other methods would be nice
> to know.
>
> ---
> Aisha
> blog.aisha.cc