]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
Added tmpfiles.d for rgw: templated user and group.
authorOwen Synge <osynge@suse.com>
Wed, 3 Jun 2015 10:55:01 +0000 (12:55 +0200)
committerSage Weil <sage@redhat.com>
Sat, 1 Aug 2015 13:58:33 +0000 (09:58 -0400)
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>
.gitignore
ceph.spec.in
configure.ac
systemd/ceph-rgw.tmpfiles.d.in [new file with mode: 0644]

index 0cd3caaea247ccc4a7013ce95864c79ef2419abd..3190b6544039bb9edf0dfda8995c7b94ac09eb91 100644 (file)
@@ -53,6 +53,7 @@ py-compile
 release
 stamp-h1
 systemd/ceph-osd@.service
+systemd/ceph-rgw.tmpfiles.d
 vgcore.*
 
 # specific local dir files
index 5447c09d20d1c82328e2beffa458153667420f81..1dc6319458c1420d059cef0b1d54911d99923b68 100644 (file)
@@ -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
index 2e9f72ba4dec7d01be749aee49feae037d3983c5..3257cae769443492ec029e37df5e7c621fecf772 100644 (file)
@@ -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 (file)
index 0000000..7cffe65
--- /dev/null
@@ -0,0 +1,2 @@
+# create rgw socket directory
+d /var/run/ceph-rgw 0755 @user_rgw@ @group_rgw@ - -