Skip to content

Commit

Permalink
Added tmpfiles.d for rgw: templated user and group.
Browse files Browse the repository at this point in the history
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 <osynge@suse.com>
  • Loading branch information
oms4suse authored and liewegas committed Aug 1, 2015
1 parent 95db160 commit 6124019
Show file tree
Hide file tree
Showing 4 changed files with 56 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ py-compile
release
stamp-h1
systemd/ceph-osd@.service
systemd/ceph-rgw.tmpfiles.d
vgcore.*

# specific local dir files
Expand Down
8 changes: 8 additions & 0 deletions ceph.spec.in
Original file line number Diff line number Diff line change
Expand Up @@ -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} \
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
45 changes: 45 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
2 changes: 2 additions & 0 deletions systemd/ceph-rgw.tmpfiles.d.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# create rgw socket directory
d /var/run/ceph-rgw 0755 @user_rgw@ @group_rgw@ - -

0 comments on commit 6124019

Please sign in to comment.