[rabbitmq-discuss] Unnecessarily complex packaging (Fedora)

Lionel Cons lionel.cons at cern.ch
Fri Sep 28 13:30:20 BST 2012


I've looked at the init script as part of rabbitmq-server-2.8.7-1.noarch.rpm
and I find it unnecessarily complex.

The script contains:

NAME=rabbitmq-server
DAEMON=/usr/sbin/${NAME}
CONTROL=/usr/sbin/rabbitmqctl
START_PROG="runuser rabbitmq --session-command"

To start RabbitMQ, START_PROG is used:

  RABBITMQ_PID_FILE=$PID_FILE $START_PROG $DAEMON \

But not to stop it:

  $CONTROL stop ${PID_FILE} > ${INIT_LOG_DIR}/shutdown_log 2> ${INIT_LOG_DIR}/shutdown_err

This magically works because /usr/sbin/rabbitmqctl is a wrapper (optionally)
using su and calling the eponymous script under /usr/lib/rabbitmq/bin.

/usr/sbin/rabbitmq-server is also a wrapper (the exact same one in fact) but
this is not needed since the change of user is already done by START_PROG in
/etc/rc.d/init.d/rabbitmq-server.

Hence my questions:
 - why using sometimes runuser and sometimes su to change user?
 - why changing user in two different places (init script and wrapper)?

Cheers,

Lionel


More information about the rabbitmq-discuss mailing list