With another slight modification it now works:
pexp="perl: .*postgrey.*${daemon_flags:+ ${daemon_flags}}.*“
(added -* after postgrey)

So to summarize:
# emacs rc.d/postgrey        
# rm /var/run/rc.d/postgrey  
# rcctl check postgrey       
postgrey(ok)
# rcctl restart postgrey     
postgrey(ok)
postgrey(ok)
# rcctl check postgrey   
postgrey(ok)
# cat /var/run/rc.d/postgrey 
daemon_class=daemon
daemon_flags=--inet=10023
daemon_rtable=0
daemon_timeout=30
daemon_user=root
pexp=perl: .*postgrey.* --inet=10023.*
# cat /etc/rc.d/postgrey     
#!/bin/ksh
#
# $OpenBSD: postgrey.rc,v 1.4 2018/01/11 19:27:04 rpe Exp $

daemon="/usr/local/libexec/postgrey -d"
daemon_flags="--inet=10023"

. /etc/rc.d/rc.subr

pexp="perl: .*postgrey.*${daemon_flags:+ ${daemon_flags}}.*"

rc_cmd $1
# ps auxwww|grep postgrey    
_postgre 79666  0.0  0.3 15996 12640 ??  I       3:58PM    0:00.12 perl: 
postgrey -d --inet=10023 (perl)
root     17938  0.0  0.0    92   248 p0  R+/0    4:01PM    0:00.00 grep postgrey
# 


Thanks for your help!
-- 
Mike Fischer
> Am 19.11.2020 um 15:53 schrieb Stuart Henderson <s...@spacehopper.org>:
> 
> On 2020/11/19 15:17, Mike Fischer wrote:
>> Hi Stuart!
>> 
>> Wow that was fast, thanks!
>> 
>> I have tried this as follows:
>> - Edited /etc/rc.d/postgrey to make the change to:
>> pexp="perl: ${daemon}${daemon_flags:+ ${daemon_flags}}.*"
> 
> Ah sorry, I missed a bit, it no longer has the full path to the script
> either. Can you try this please?
> 
> pexp="perl: .*postgrey${daemon_flags:+ ${daemon_flags}}.*"
> 
> 
> 
>> - # mv /var/run/rc.d/postgrey /var/run/rc.d/postgrey.old   (for testing…)
>> 
>> - # rcctl check postgrey
>> postgrey(failed)
>> # rcctl start postgrey 
>> postgrey(ok)
>> # rcctl check postgrey 
>> postgrey(failed)
>> # cat /var/run/rc.d/postgrey 
>> daemon_class=daemon
>> daemon_flags=--inet=10023
>> daemon_rtable=0
>> daemon_timeout=30
>> daemon_user=root
>> pexp=perl: /usr/local/libexec/postgrey -d --inet=10023.*
>> # 
>> 
>> So it appears the change is being used but it is not solving the problem.
>> 
>> ?
>> -- 
>> Mike Fischer
>>> Am 19.11.2020 um 15:03 schrieb Stuart Henderson <s...@spacehopper.org>:
>>> 
>>> On 2020/11/19 14:50, Mike Fischer wrote:
>>>> Hi Stuart,
>>>> 
>>>> Here it is:
>>>> # cat /var/run/rc.d/postgrey
>>>> daemon_class=daemon
>>>> daemon_flags=--inet=10023
>>>> daemon_rtable=0
>>>> daemon_timeout=30
>>>> daemon_user=root
>>>> pexp=perl: /usr/local/libexec/postgrey -d --inet=10023
>>>> # 
>>>> 
>>>> Thanks!
>>> 
>>> This will fix things (I've just committed it to -current). You'll need
>>> to rm /var/run/rc.d/postgrey to get it to notice the changed pexp value.
>>> 
>>> Index: Makefile
>>> ===================================================================
>>> RCS file: /cvs/ports/mail/postgrey/Makefile,v
>>> retrieving revision 1.25
>>> diff -u -p -r1.25 Makefile
>>> --- Makefile        31 Aug 2019 15:55:55 -0000      1.25
>>> +++ Makefile        19 Nov 2020 14:02:00 -0000
>>> @@ -3,6 +3,7 @@
>>> COMMENT=    postfix greylist daemon
>>> 
>>> DISTNAME=   postgrey-1.37
>>> +REVISION=  0
>>> CATEGORIES= mail
>>> 
>>> HOMEPAGE=   https://postgrey.schweikert.ch/
>>> Index: pkg/postgrey.rc
>>> ===================================================================
>>> RCS file: /cvs/ports/mail/postgrey/pkg/postgrey.rc,v
>>> retrieving revision 1.4
>>> diff -u -p -r1.4 postgrey.rc
>>> --- pkg/postgrey.rc 11 Jan 2018 19:27:04 -0000      1.4
>>> +++ pkg/postgrey.rc 19 Nov 2020 14:02:00 -0000
>>> @@ -7,6 +7,6 @@ daemon_flags="--inet=10023"
>>> 
>>> . /etc/rc.d/rc.subr
>>> 
>>> -pexp="perl: ${daemon}${daemon_flags:+ ${daemon_flags}}"
>>> +pexp="perl: ${daemon}${daemon_flags:+ ${daemon_flags}}.*"
>>> 
>>> rc_cmd $1
>>> 
>> 

Reply via email to