[rabbitmq-discuss] Unnecessarily complex packaging (Fedora)
simon at rabbitmq.com
Fri Sep 28 13:54:17 BST 2012
On 28/09/12 13:30, Lionel Cons wrote:
> I've looked at the init script as part of rabbitmq-server-2.8.7-1.noarch.rpm
> and I find it unnecessarily complex.
It *is* complex. I *think* all the complexity is necessary.
<snip description of how it all works>
> Hence my questions:
> - why using sometimes runuser and sometimes su to change user?
We originally always used su. However, su is considered to start a login
session, which means that under some common PAM configurations the
"rabbitmq" user was considered always logged in. This prevented users
from shutting down desktops / laptops on which rabbitmq-server was
So why not use runuser all the time? Well, we want to try to keep the
distro-specific parts of the server package as minimal as possible - the
init script is distro specific but the wrapper scripts are not.
So on Debian / Ubuntu we start the server with start-stop-daemon rather
than runuser. In fact it's not obvious that runuser is right for RPMs
either, see thread here:
Maybe we should be using "daemon" instead, at least on RHEL/Fedora RPMs.
But if we use start-stop-daemon / daemon to start the server, we
certainly shouldn't use the same thing to invoke rabbitmqctl.
rabbitmqctl is not a daemon. And we use rabbitmqctl to stop the server.
> - why changing user in two different places (init script and wrapper)?
We need to change user in the init script in order to do the
distro-specific magic that marks the process as a daemon. We need to
change user in the wrapper so that rabbitmqctl can work. We also (to
some extent) want to support running the server by invoking
/usr/sbin/rabbitmq-server, in case you only want to start it for
So it's certainly possible that this could be arranged differently. We
could have a separate wrapper for rabbitmq-server and make that wrapper
vary by distro. I don't think that would count as any simpler though.
More information about the rabbitmq-discuss