From: Sage Weil Date: Thu, 6 Aug 2015 15:37:30 +0000 (-0400) Subject: set nofile ulimit in /etc/security/limits.d/ceph only X-Git-Tag: v9.1.0~294^2~23 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=c7ee798a0f9ddb79f799fe19dba0873efa4fdcfa;p=ceph.git 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 --- diff --git a/Makefile.am b/Makefile.am index d6f7bbdf19ed..fcf40707d45c 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 7b0fc3bdf0cc..bc0e981c0b5b 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 4e21adff9c47..1fa4c1309f08 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 bb0aeaf3da18..5521d05bb2fd 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 000000000000..702aa0332ecb --- /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 69ab8c358a5a..5c7f77c7fe72 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]