From: Owen Synge Date: Wed, 3 Jun 2015 10:55:01 +0000 (+0200) Subject: Added tmpfiles.d for rgw: templated user and group. X-Git-Tag: v9.1.0~439^2~22 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=61240190c7775d93e7316cbf2c27eb17400ddb6a;p=ceph.git Added tmpfiles.d for rgw: templated user and group. tmpfiles.d are part of system.d and define how temporary directories are setup. rgw needs a socket directory. To do this we template tmpfiles.d user and group for rgw and fill in the values using autotools. Note1: Added to spec file. Note2: Name changed to rgw from radosgw as is preferred name by Sage. Note3: Adds configure options --with-rgw-user=UserName --with-rgw-group=GroupName Note4: Defaults set for debian Note5: spec file overrides defaults for redhat and suse Signed-off-by: Owen Synge --- diff --git a/.gitignore b/.gitignore index 0cd3caaea247..3190b6544039 100644 --- a/.gitignore +++ b/.gitignore @@ -53,6 +53,7 @@ py-compile release stamp-h1 systemd/ceph-osd@.service +systemd/ceph-rgw.tmpfiles.d vgcore.* # specific local dir files diff --git a/ceph.spec.in b/ceph.spec.in index 5447c09d20d1..1dc6319458c1 100644 --- a/ceph.spec.in +++ b/ceph.spec.in @@ -494,9 +494,13 @@ export RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS | sed -e 's/i386/i486/'` --with-librocksdb-static=check \ %if 0%{?rhel} || 0%{?fedora} --with-systemd-libexec-dir=/usr/libexec/ceph \ + --with-rgw-user=apache \ + --with-rgw-group=apache \ %endif %if 0%{?opensuse} || 0%{?suse_version} --with-systemd-libexec-dir=/usr/lib/ceph/ \ + --with-rgw-user=wwwrun \ + --with-rgw-group=www \ %endif $MY_CONF_OPT \ %{?_with_ocf} \ @@ -534,6 +538,7 @@ install -D src/init-rbdmap $RPM_BUILD_ROOT%{_initrddir}/rbdmap install -D src/rbdmap $RPM_BUILD_ROOT%{_sysconfdir}/ceph/rbdmap %if 0%{?_with_systemd} install -m 0644 -D systemd/ceph.tmpfiles.d $RPM_BUILD_ROOT%{_tmpfilesdir}/%{name}.conf + install -m 0644 -D systemd/ceph-rgw.tmpfiles.d $RPM_BUILD_ROOT%{_tmpfilesdir}/%{name}-rgw.conf %endif mkdir -p $RPM_BUILD_ROOT%{_sbindir} ln -sf ../../etc/init.d/ceph %{buildroot}/%{_sbindir}/rcceph @@ -818,6 +823,9 @@ fi %config %{_sysconfdir}/bash_completion.d/radosgw-admin %dir %{_localstatedir}/log/radosgw/ %dir %{_localstatedir}/lib/ceph/radosgw +%if 0%{?_with_systemd} +%{_tmpfilesdir}/%{name}-rgw.conf +%endif %post radosgw /sbin/ldconfig diff --git a/configure.ac b/configure.ac index 2e9f72ba4dec..3257cae76944 100644 --- a/configure.ac +++ b/configure.ac @@ -1197,6 +1197,50 @@ AC_ARG_WITH( ] ) +dnl rgw-user +AC_SUBST(user_rgw) +AC_ARG_WITH( + rgw-user, + AS_HELP_STRING( + [--with-rgw-user=USER], + [systemd unit directory @<:@USER_RGW@:>@ + Defaults to "www-data"] + ), + [ + user_rgw="$withval" + ], + [ + if test "x$USER_RGW" = "x"; then + user_rgw=www-data + else + user_rgw="$USER_RGW" + fi + ] +) + + +dnl rgw-group +AC_SUBST(group_rgw) +AC_ARG_WITH( + rgw-group, + AS_HELP_STRING( + [--with-rgw-group=GROUP], + [systemd unit directory @<:@GROUP_RGW@:>@ + Defaults to "www-data"] + ), + [ + group_rgw="$withval" + ], + [ + if test "x$GROUP_RGW" = "x"; then + group_rgw=www-data + else + group_rgw="$GROUP_RGW" + fi + ] +) + + # Checks for typedefs, structures, and compiler characteristics. #AC_HEADER_STDBOOL #AC_C_CONST @@ -1260,5 +1304,6 @@ AC_CONFIG_FILES([Makefile man/Makefile doc/Makefile systemd/ceph-osd@.service + systemd/ceph-rgw.tmpfiles.d ceph.spec]) AC_OUTPUT diff --git a/systemd/ceph-rgw.tmpfiles.d.in b/systemd/ceph-rgw.tmpfiles.d.in new file mode 100644 index 000000000000..7cffe65a2b68 --- /dev/null +++ b/systemd/ceph-rgw.tmpfiles.d.in @@ -0,0 +1,2 @@ +# create rgw socket directory +d /var/run/ceph-rgw 0755 @user_rgw@ @group_rgw@ - -