From c7ee798a0f9ddb79f799fe19dba0873efa4fdcfa Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Thu, 6 Aug 2015 11:37:30 -0400 Subject: [PATCH] set nofile ulimit in /etc/security/limits.d/ceph only Specify the nofile ulimit in one standard place, where everyone expects it to be. Drop it from the ceph-osd unit file. Leave upstart and sysvinit untouched for the time being to avoid compat issues. Signed-off-by: Sage Weil --- Makefile.am | 1 + ceph.spec.in | 1 + debian/ceph-common.install | 1 + debian/rules | 1 + etc/ceph.limits.d | 9 +++++++++ systemd/ceph-osd@.service.in | 1 - 6 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 etc/ceph.limits.d diff --git a/Makefile.am b/Makefile.am index d6f7bbdf19e..fcf40707d45 100644 --- a/Makefile.am +++ b/Makefile.am @@ -10,6 +10,7 @@ EXTRA_DIST += \ src/test/cli \ src/test/downloads \ systemd/ceph.tmpfiles.d \ + etc/ceph.limits.d \ udev/50-rbd.rules \ udev/60-ceph-partuuid-workaround.rules \ udev/95-ceph-osd.rules \ diff --git a/ceph.spec.in b/ceph.spec.in index 7b0fc3bdf0c..bc0e981c0b5 100644 --- a/ceph.spec.in +++ b/ceph.spec.in @@ -577,6 +577,7 @@ find $RPM_BUILD_ROOT -type f -name "*.la" -exec rm -f {} ';' find $RPM_BUILD_ROOT -type f -name "*.a" -exec rm -f {} ';' install -D src/rbdmap $RPM_BUILD_ROOT%{_sysconfdir}/ceph/rbdmap install -D src/init-rbdmap $RPM_BUILD_ROOT%{_initrddir}/rbdmap +install -D ceph.limits.d $RPM_BUILD_ROOT%{_sysconfdir}/security/limits.d/ceph %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 diff --git a/debian/ceph-common.install b/debian/ceph-common.install index 4e21adff9c4..1fa4c1309f0 100644 --- a/debian/ceph-common.install +++ b/debian/ceph-common.install @@ -25,5 +25,6 @@ usr/share/ceph/id_dsa_drop.ceph.com usr/share/ceph/id_dsa_drop.ceph.com.pub etc/ceph/rbdmap etc/init.d/rbdmap +etc/security/limits.d/ceph lib/udev/rules.d/50-rbd.rules usr/lib/python*/dist-packages/ceph_argparse.py* diff --git a/debian/rules b/debian/rules index bb0aeaf3da1..5521d05bb2f 100755 --- a/debian/rules +++ b/debian/rules @@ -85,6 +85,7 @@ install: build install -D -m 644 udev/95-ceph-osd.rules $(DESTDIR)/lib/udev/rules.d/95-ceph-osd.rules install -D -m 644 src/rbdmap $(DESTDIR)/etc/ceph/rbdmap install -D -m 755 src/init-rbdmap $(DESTDIR)/etc/init.d/rbdmap + install -D -m 644 etc/ceph.limits.d $(DESTDIR)/etc/security/limits.d/ceph # Add here commands to install the package into debian/testpack. # Build architecture-independent files here. diff --git a/etc/ceph.limits.d b/etc/ceph.limits.d new file mode 100644 index 00000000000..702aa0332ec --- /dev/null +++ b/etc/ceph.limits.d @@ -0,0 +1,9 @@ +# /etc/security/limits.d/ceph +# +# +# + +# We want a very large value for nofile for the ceph user as the ceph +# clients and daemons consume lots and lots of file descriptors. + +ceph - nofile 4194304 diff --git a/systemd/ceph-osd@.service.in b/systemd/ceph-osd@.service.in index 69ab8c358a5..5c7f77c7fe7 100644 --- a/systemd/ceph-osd@.service.in +++ b/systemd/ceph-osd@.service.in @@ -9,7 +9,6 @@ EnvironmentFile=-/etc/sysconfig/ceph Environment=CLUSTER=ceph ExecStart=/usr/bin/ceph-osd -f --cluster ${CLUSTER} --id %i --setuser ceph --setgroup ceph ExecStartPre=/usr/libexec/ceph/ceph-osd-prestart.sh --cluster ${CLUSTER} --setuser ceph --setgroup ceph --id %i -LimitNOFILE=131072 ExecReload=/bin/kill -HUP $MAINPID [Install]