-
Notifications
You must be signed in to change notification settings - Fork 43
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
mail/spamassassin rc.d script needs command_interpreter=/usr/local/bin/perl #129
Comments
Thanks, I made the change at the ports level and fixed some other ports with interpreters of /usr/bin/perl at the same time. |
pavalos, can you review this PR? Allegedly, this change broke FreeBSD and is "wrong". I find that a bit hard to believe myself, but what do you think? |
Interesting that behavior on FreeBSD is the opposite (what we are trying to fix) of ours. Without command_interpreter, we can't stop or restart spamd. I'm about to hop on a flight, but I'll try to see where the incompatibility is (gotta be rc.subr) after i land.
|
There's no rush. John is going to back out the change in the meantime. AdamAdam Weinberger
|
pavalos, have you had a chance to review both dragonfly and freebsd's handling of command_interpreter? I backed out your changes upon Adam's request, but the idea is that we figure out where the problem is and submit a change request if necessary. It seems dragonfly is using command_interpreter correctly, so it could be a bug in FreeBSD |
DragonFly: ps -o "pid,command" -p 782825PID COMMAND FreeBSD: (Note the lack of “perl: “ in FreeBSD’s output) So this is why FreeBSD is failing with command_interpreter set, but I haven’t figured out why FreeBSD does this… —Peter |
I thought you were on an email that explained the "perl" gets lost when spamd gets daemonized, at least on FreeBSD |
(but obviously not) |
Well I just looked at the FreeBSD PR, and there’s some discussion there that I wasn't tracking on…So I agree that /usr/local/bin/spamd rewrites its command title in the daemonize routine on line 2929, but that still doesn’t explain why the interpreter (perl: ) part goes away. That line in /usr/local/bin/spamd makes it go from: /usr/local/bin/perl -T -w /usr/local/bin/spamd -c -d -r /var/run/spamd/spamd.pid to: But note that FreeBSD doesn’t have the interpreter listed (as “perl: “), regardless of that line in spamd. But I don’t know why...= |
You said that "command interpreter" is working on FreeBSD, but then you describe the "ps" mechanism that prevents it from working due to the behavior of ps. This is why I was thinking there is actually a bug in FreeBSD. It's not working as advertised. It actually breaks if command_interpreter is specified. |
Looking at it from another point of view…Why does our ps include “perl: “? Not all daemonized perl programs do that…Look at munin-node on DragonFly: —Peter= |
You tell me. :) |
After some consultation with Sascha Wildner, he pointed me to this gem in perl’s mg.c: #ifdef HAS_SETPROCTITLE if __FreeBSD_version > 410001
else /* old FreeBSDs, NetBSD, OpenBSD, anyBSD */
endifDragonFly’s setproctitle() has the “-“ capability, so if we were to patch perl, then the ps output will not have perl in it, and command_interpreter will not be necessary. What do you think? |
pro: it would make us more compatible with ports requirement if we don't do anything: multiple dragonfly-only patches to "fix" ports. The answer is not clear cut. |
Well if DragonFly maintains setproctitle’s “-“ capability and perl wants to use it, then we should go in that direction (by patching perl source by adding a || defined(__DragonFly) to that section of mg.c. As far as handling non-patched versions of perl, then we have command_interpreter…It’s not great, but I’m not sure what else to do… |
Okay, I patched all 3 version of perl. |
mail/spamassassin installs an rc.d script (sa-spamd), but restart doesn't work since spamd is actually a perl script. Adding "command_interpreter=/usr/local/bin/perl" to rc.d/sa-spamd makes it work.
The text was updated successfully, but these errors were encountered: