el6: RGW init script failure
The current radosgw init script provided with CentOS package uses Debian specific init-functions.
The default apache user also differs from Debian (www-data) to CentOS (apache).
#4 Updated by Alexandre Marangone about 7 years ago
bash -x is set.
ceph-conf is called, ceph (no ceph-common for EL) package is not set as a radosgw dependency.
There is a difference in process owner between Debian and EL.
Debian launches the radosgw as root, EL as apache user, which seems odd based on the Debian startup script (I'm not very efficient with init-function if I'm honest).
This means that whatever path your rgw socket is in should have the correct permission for the apache user.
Is there a particular security risk associated with running the rgw as root?
Gary, ping me anytime if you want more info.
#5 Updated by Alexandre Marangone about 7 years ago
I was puzzled by this so I took a look further:
The -u or --user option for start-stop-daemon do not launch the process as the user specified, it is the role of the -c (--chuid).
The -u option is used to check if the process is already running with a user specified by -u. If this is the case, you will get a nice '<process> already running'.
On Debian, the check is wrong since we launch with user root and check against user www-data. The fix is either:
start-stop-daemon --start -u root -x $RADOSGW -- -n $name #if we want to launch the process as root, or
start-stop-daemon --start -u $user -c $user -x $RADOSGW -- -n $name #if we wan to launch the process as www-data
On CentOS, the check is done by checking if the PID file exists.
#7 Updated by Alexandre Marangone about 7 years ago
Seems like the branch failed to build.
I tested the init script by pulling it from git.
Forgot to mention yesterday that there is a cosmetic issue because echos are before the call to daemon.
I attached a small diff that fixes it.
#11 Updated by Anonymous almost 7 years ago
- Status changed from Fix Under Review to Resolved
Resolved with the following commit to next:
Author: Gary Lowell <email@example.com>
Date: Tue Feb 19 17:25:27 2013 -0800
init-radosgw.sysv: New radosgw init file for rpm based systems
Added init-radosgw.sys file for rpm based systems, added it to
the tarball list in the makefile, and updated the specfile to
install it. Also added the a dependency in ceph since it uses
utility routes from that package (On debian systems these are
packaged in ceph-common). Incorporated review comments from
Alex. (Bug #4571)
Signed-off-by: Gary Lowell <firstname.lastname@example.org>
Reviewed-by: Alexandre Marangone <email@example.com>