Start qrunner on ElCapitan (MacOS X Server)

Hello, I’m trying to start mailman on startup with ElCapitan.
I tried a plist in LaunchDaemons - that was working in the past with the command: /usr/local/mailman/bin/mailmanctl -s start
this produces now the error: Service only ran for 2 seconds. Pushing respawn out by 8 seconds
the error log says: The master qrunner lock could not be acquired because it appears as if another master qrunner is already running
So it starts, creates a lock as localhost … and then it tries to start again.
than I created a startup script as described here: https://developer.apple.com/library/content/documentation/MacOSX/Conceptual/...
and it does … nothing
the only thing which works currently is starting it manually with sudo and this is kind of inconvenient
I installed mailman manually without using macports or something like that.
I hope someone on the list can share some insight here.
thanks Matthias

Am 18.10.2016 um 10:57 schrieb Matthias Schmidt via Mailman-Users:
Hello, I’m trying to start mailman on startup with ElCapitan.
I tried a plist in LaunchDaemons - that was working in the past with the command: /usr/local/mailman/bin/mailmanctl -s start
this produces now the error: Service only ran for 2 seconds. Pushing respawn out by 8 seconds
the error log says: The master qrunner lock could not be acquired because it appears as if another master qrunner is already running
So it starts, creates a lock as localhost … and then it tries to start again.
than I created a startup script as described here: https://developer.apple.com/library/content/documentation/MacOSX/Conceptual/...
and it does … nothing
the only thing which works currently is starting it manually with sudo and this is kind of inconvenient
I installed mailman manually without using macports or something like that.
I hope someone on the list can share some insight here.
Do you shutdown mailman cleanly? If not, you leave a pid file behind, which will prevent mailman from starting.
Kind regards, Christian Mack

Am 18.10.2016 um 22:50 schrieb mailman-admin <mailman-admin@uni-konstanz.de>:
Am 18.10.2016 um 10:57 schrieb Matthias Schmidt via Mailman-Users:
Hello, I’m trying to start mailman on startup with ElCapitan.
I tried a plist in LaunchDaemons - that was working in the past with the command: /usr/local/mailman/bin/mailmanctl -s start
this produces now the error: Service only ran for 2 seconds. Pushing respawn out by 8 seconds
the error log says: The master qrunner lock could not be acquired because it appears as if another master qrunner is already running
So it starts, creates a lock as localhost … and then it tries to start again.
than I created a startup script as described here: https://developer.apple.com/library/content/documentation/MacOSX/Conceptual/...
and it does … nothing
the only thing which works currently is starting it manually with sudo and this is kind of inconvenient
I installed mailman manually without using macports or something like that.
I hope someone on the list can share some insight here.
Do you shutdown mailman cleanly?
mailman was not running before startup and for the test I made sure that there are no pid files present
If not, you leave a pid file behind, which will prevent mailman from starting.
the -s option should fix that problem ;-) but if mailman is started as local then -s doesn’t remove a stray pid file.
cheers Matthias

On 10/18/2016 07:39 AM, Matthias Schmidt via Mailman-Users wrote:
the -s option should fix that problem ;-)
If it can determine that the lock is stale.
but if mailman is started as local then -s doesn’t remove a stray pid file.
What do you mean by "if mailman is started as local"?
What is the output from 'mailmanctl -s start'?
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan

Mark,
Am 19.10.2016 um 13:04 schrieb Mark Sapiro <mark@msapiro.net>:
On 10/18/2016 07:39 AM, Matthias Schmidt via Mailman-Users wrote:
the -s option should fix that problem ;-)
If it can determine that the lock is stale.
but if mailman is started as local then -s doesn’t remove a stray pid file.
What do you mean by “if mailman is started as local"?
oh I had that before, it was starting as localhost, that was at least the message.
Now I get in the system log: com.apple.xpc.launchd[1] (org.mailman): Service only ran for 1 seconds. Pushing respawn out by 9 seconds.
and after that I get: The master qrunner lock could not be acquired because it appears as if another master qrunner is already running. in mailman’s error log
after unloading the plist and running mailmanctl -s start again, I get the same error as output. When I delete these 2 lock files and run mailmanctl start as sudo all is fine.
So starting mailman manually is not a problem. I just don’t get it started via a plist with launchd.
I also created a script like this and pointed the plist to the script: #!/bin/sh function fstartup() { /usr/local/mailman/bin/mailmanctl -s start } function fshutdown() { /usr/local/mailman/bin/mailmanctl stop tail -f /dev/null & wait $! }
trap fshutdown SIGTERM trap fshutdown SIGKILL fstartup;
this seams to do nothing at all …at least there’s nothing in the logs.
cheers Matthias

On 10/19/2016 02:51 AM, Matthias Schmidt wrote:
Now I get in the system log: com.apple.xpc.launchd[1] (org.mailman): Service only ran for 1 seconds. Pushing respawn out by 9 seconds.
and after that I get: The master qrunner lock could not be acquired because it appears as if another master qrunner is already running. in mailman’s error log
Because the original master IS still running. The PID in the lockfile exists. The problem is 'mailmanctl start' forks a watcher process. The original mailmanctl exits so launchd thinks it only ran for 1 second, but it's child and all the qrunners are still running.
after unloading the plist and running mailmanctl -s start again, I get the same error as output. When I delete these 2 lock files and run mailmanctl start as sudo all is fine.
All is not fine. You have 2 Mailman instances running. See <https://wiki.list.org/x/4030715>.
I don't know how to set up plist's for launchd. There may be some sort of daemon option to account for processes that fork a daemon and then exit.
See <https://wiki.list.org/x/4030523> and posts linked therefrom, in particular <http://www.mail-archive.com/mailman-users@python.org/msg56923.html>. This is for 10.6, and I don't know if 10.11 is different in this respect or not. I think there is more recent discussion in this list's archives which you may find by searching at <http://www.mail-archive.com/mailman-users@python.org/>.
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan

Mark,
thanks.
Am 19.10.2016 um 23:55 schrieb Mark Sapiro <mark@msapiro.net>:
On 10/19/2016 02:51 AM, Matthias Schmidt wrote:
Now I get in the system log: com.apple.xpc.launchd[1] (org.mailman): Service only ran for 1 seconds. Pushing respawn out by 9 seconds.
and after that I get: The master qrunner lock could not be acquired because it appears as if another master qrunner is already running. in mailman’s error log
Because the original master IS still running. The PID in the lockfile exists. The problem is 'mailmanctl start' forks a watcher process. The original mailmanctl exits so launchd thinks it only ran for 1 second, but it’s child and all the qrunners are still running.
after unloading the plist and running mailmanctl -s start again, I get the same error as output. When I delete these 2 lock files and run mailmanctl start as sudo all is fine.
All is not fine. You have 2 Mailman instances running. See <https://wiki.list.org/x/4030715>.
I don't know how to set up plist's for launchd. There may be some sort of daemon option to account for processes that fork a daemon and then exit.
that was the right hint, adding sleep 1 to my script did the trick :-)
thank you :-)
Matthias
See <https://wiki.list.org/x/4030523> and posts linked therefrom, in particular <http://www.mail-archive.com/mailman-users@python.org/msg56923.html>. This is for 10.6, and I don't know if 10.11 is different in this respect or not. I think there is more recent discussion in this list's archives which you may find by searching at <http://www.mail-archive.com/mailman-users@python.org/>.
participants (3)
-
mailman-admin
-
Mark Sapiro
-
Matthias Schmidt