Increase max inotify instance
authorSangjung Woo <sangjung.woo@samsung.com>
Mon, 13 May 2013 11:05:52 +0000 (20:05 +0900)
committerSangjung Woo <sangjung.woo@samsung.com>
Mon, 13 May 2013 11:05:52 +0000 (20:05 +0900)
Because of the limit to the amount of inotify fd instance (i.e = 128),
total instances of application execution might be limited. Some _bad_
application, moreover, could use a lot of inotify fd instances
abnormally using eglibc API.

In order to prevent this situation, this work sets the max inotify fd
instance to 1024 as defult value.

Change-Id: Ibb2efdf2de3e0ccb2bf92996a375e694358eaf55
Signed-off-by: Sangjung Woo <sangjung.woo@samsung.com>
packaging/max_user_inotify.conf [new file with mode: 0644]
packaging/systemd.spec

diff --git a/packaging/max_user_inotify.conf b/packaging/max_user_inotify.conf
new file mode 100644 (file)
index 0000000..2139f95
--- /dev/null
@@ -0,0 +1 @@
+fs.inotify.max_user_instances=1024
index b8df3f3..8472293 100644 (file)
@@ -9,6 +9,7 @@ URL:        http://www.freedesktop.org/wiki/Software/systemd
 Source0:    http://www.freedesktop.org/software/systemd/%{name}-%{version}.tar.xz
 Source1:    pamconsole-tmp.conf
 Source1001: systemd.manifest
+Source1002: max_user_inotify.conf
 Patch1:     0002-systemd-fsck-disable-l-until-linux.patch
 Patch2:     add-tmp.mount-as-tmpfs.patch
 Patch3:     tizen-login-location.patch
@@ -230,6 +231,10 @@ mkdir -p %{buildroot}/etc/systemd/system/basic.target.wants
 mkdir -p %{buildroot}/etc/systemd/system/getty.target.wants
 mkdir -p %{buildroot}%{_libdir}/systemd/system/getty.target.wants
 
+# Modify inotify max_user_instances
+mkdir -p %{buildroot}/%{_libdir}/sysctl.d
+cp %{SOURCE1002} %{buildroot}%{_libdir}/sysctl.d/
+
 #console-ttyMFD2
 ln -s ../serial-getty@.service %{buildroot}%{_libdir}/systemd/system/getty.target.wants/serial-getty@ttyMFD2.service
 
@@ -292,6 +297,7 @@ ln -sf /proc/self/mounts /etc/mtab
 %{_libdir}/libsystemd-id128.so.0.0.2
 %{_libdir}/libsystemd-journal.so.0
 %{_libdir}/libsystemd-journal.so.0.0.2
+%{_libdir}/sysctl.d/*
 %{_datadir}/dbus-1/*/org.freedesktop.systemd1.*
 %{_defaultdocdir}/systemd
 %{_datadir}/polkit-1/actions/org.freedesktop.systemd1.policy