Bug List: (This bug is not in your last search results)   Show last search results      Search page      Enter new bug
Bug#: 215031
Alias:
Product:
Component:
Status: RESOLVED
Resolution: FIXED
Assigned To: Net-Mail Packages <net-mail@gentoo.org>
Hardware:
OS:
Version:
Priority:
Severity:
Reporter: Frittella Laurento <mrfree@infinito.it>
Add CC:
CC:
Remove selected CCs
URL:
Summary:
Status Whiteboard:
Keywords:

Filename Description Type Creator Created Size Actions
postgrey-openrc-fix.patch postgrey-openrc-fix.patch patch Guillaume Castagnino 2008-04-16 17:36 0000 300 bytes Details | Diff
postgrey-initrc-pidfile.patch add --pidfile to start-stop-daemon in start() patch Bernhard Frauendienst 2008-05-18 15:21 0000 383 bytes Details | Diff
Create a New Attachment (proposed patch, testcase, etc.) View All

Bug 215031 depends on: Show dependency tree
Bug 215031 blocks:
Votes: 0    Show votes for this bug    Vote for this bug

Additional Comments: (this is where you put emerge --info)


Not eligible to see or edit group visibility for this bug.






View Bug Activity   |   Format For Printing   |   XML   |   Clone This Bug


Description:   Opened: 2008-03-27 11:44 0000
For the problem with OpenRC replacing the --exec args with the following is
enough:

start-stop-daemon --start --quiet --background \
  --exec /usr/bin/perl -- -T -w /usr/sbin/postgrey \
  --${POSTGREY_ADDR} \
  --daemonize \
  --pidfile=${POSTGREY_PID} \
  ${POSTGREY_DELAY_ARG} \
  ${POSTGREY_OPTS} \
  "${POSTGREY_TEXT_ARG}"

(I inverted the last two args as suggested in #213709 too)


When the service starts (it happens with the in-tree init script too):
 * Starting Postgrey ...                  [ok]
 * start-stop-daemon: caught an interrupt [ok]

but the daemon works well

------- Comment #1 From Jakub Moc (RETIRED) 2008-03-27 11:58:09 0000 -------
Please, attach a unified diff next time; a whole lot easier to review any
changes.

------- Comment #2 From Tobias Scherbaum 2008-04-06 15:43:41 0000 -------
Fixed in CVS.

------- Comment #3 From Peter Fern 2008-04-08 12:51:44 0000 -------
And this breaks without openrc, suggest you find some other way of fixing the
problem than by breaking sysvinit.

If there's another perl script running start-stop-daemon dies with
'/usr/bin/perl already running'.  Suggest reversion until someone comes up with
a new fix for openrc.

------- Comment #4 From Tobias Scherbaum 2008-04-08 16:42:06 0000 -------
uhrm, I did test this with both latest (stable) baselayout and openrc ...
please give me a few more details on your setup please.

------- Comment #5 From Peter Fern 2008-04-08 19:19:48 0000 -------
(In reply to comment #4)
> uhrm, I did test this with both latest (stable) baselayout and openrc ...
> please give me a few more details on your setup please.
> 

# qlist -IvC baselayout sysvinit postgrey
mail-filter/postgrey-1.31-r1
sys-apps/baselayout-1.12.11.1
sys-apps/sysvinit-2.86-r10

All latest stable as of yesterday except for postgrey.  Error only occurs if
there is another perl daemon running (I'm guessing spamd in my case, though I
haven't bothered to trace it since calling /usr/sbin/postgrey directly instead
of /usr/bin/perl resolved it for me.

Anything further I can provide that will help you verify it?  I guess I could
strace it and post the log if you want, so you can see where the conflict
occurs...

------- Comment #6 From Tobias Scherbaum 2008-04-10 17:09:50 0000 -------
I reverted the change for now. If someone has a proper fix for this ... please
post a diff ;)

------- Comment #7 From Guillaume Castagnino 2008-04-16 17:36:52 0000 -------
Created an attachment (id=149963) [details]
postgrey-openrc-fix.patch

I suggest adding a "--name" option to start-stop-daemon
Seems to fix the problem with openrc. I have no baselayout 1.12 box to do a
non-regression test, but I do not think it hurts...

------- Comment #8 From Tobias Scherbaum 2008-04-16 18:04:09 0000 -------
(In reply to comment #7)
> Created an attachment (id=149963) [edit] [details]
> postgrey-openrc-fix.patch
> 
> I suggest adding a "--name" option to start-stop-daemon
> Seems to fix the problem with openrc. I have no baselayout 1.12 box to do a
> non-regression test, but I do not think it hurts...
> 

tested on systems with both OpenRC plus baselayout 1.12 - working and committed
to CVS. Thanks for your patch!

------- Comment #9 From Bernhard Frauendienst 2008-05-18 15:21:01 0000 -------
(In reply to comment #7)
> Created an attachment (id=149963) [edit] [details]
> postgrey-openrc-fix.patch
> 
> I suggest adding a "--name" option to start-stop-daemon
> Seems to fix the problem with openrc. I have no baselayout 1.12 box to do a
> non-regression test, but I do not think it hurts...
> 

I know this bug is closed, but I think the more elegant solution would be to
use --pidfile with both start-stop-daemon and postgrey. After all, that's what
the PID file is for ;) Patch coming right up.

------- Comment #10 From Bernhard Frauendienst 2008-05-18 15:21:56 0000 -------
Created an attachment (id=153563) [details]
add --pidfile to start-stop-daemon in start()

------- Comment #11 From Tobias Scherbaum 2008-05-21 18:16:38 0000 -------
(In reply to comment #10)
> Created an attachment (id=153563) [edit] [details]
> add --pidfile to start-stop-daemon in start()
> 

--pidfile is already set ...

<-- snip -->
start-stop-daemon --start --quiet --background \
                --name postgrey \
                --exec /usr/sbin/postgrey -- \
                --${POSTGREY_ADDR} \
                --daemonize \
                --pidfile=${POSTGREY_PID} \
                ${POSTGREY_DELAY_ARG} \
                ${POSTGREY_OPTS} \
                "${POSTGREY_TEXT_ARG}"
        eend ${?}
<-- snip -->

------- Comment #12 From Bernhard Frauendienst 2008-05-21 18:31:12 0000 -------
(In reply to comment #11)
> (In reply to comment #10)
> > Created an attachment (id=153563) [edit] [details]
> > add --pidfile to start-stop-daemon in start()
> > 
> 
> --pidfile is already set ...

--pidfile is set as a param to postgrey, which results in the pidfile being
created in the first place. But if you also pass it to start-stop-daemon, it
checks for the pidfile/pid instead of the name passed to --exec, which solves
the mentioned problem (in a more elegant way than using --name, imho). Hence
the patch.

------- Comment #13 From Tobias Scherbaum 2008-05-21 18:46:16 0000 -------
(In reply to comment #12)
> --pidfile is set as a param to postgrey, which results in the pidfile being
> created in the first place. But if you also pass it to start-stop-daemon, it
> checks for the pidfile/pid instead of the name passed to --exec, which solves
> the mentioned problem (in a more elegant way than using --name, imho). Hence
> the patch.
> 

Missed that ... added the patch and added =postgrey-1.31-r2 to CVS. Thanks
Bernhard!

Bug List: (This bug is not in your last search results)   Show last search results      Search page      Enter new bug