From bdbcf83e8290d12c43b8740edd63e7cb7abd38dd Mon Sep 17 00:00:00 2001 From: Siddhesh Poyarekar Date: Thu, 27 Feb 2014 00:31:15 +0530 Subject: [PATCH] Use nscd service files from glibc sources and make the service forking Currently the nscd service is installed in systemd as a simple service, which means that it is able to handle its own errors and does not quit. Since nscd does not fit that description, i.e. it can exit on errors like, say, failing to parse nscd.conf, it should be declared as forking instead. --- glibc-nscd-sysconfig.patch | 12 +++++++++++ glibc-rh1070416.patch | 41 ++++++++++++++++++++++++++++++++++++++ glibc.spec | 15 ++++++++++---- nscd.service | 18 ----------------- nscd.socket | 8 -------- 5 files changed, 64 insertions(+), 30 deletions(-) create mode 100644 glibc-nscd-sysconfig.patch create mode 100644 glibc-rh1070416.patch delete mode 100644 nscd.service delete mode 100644 nscd.socket diff --git a/glibc-nscd-sysconfig.patch b/glibc-nscd-sysconfig.patch new file mode 100644 index 0000000..01bfead --- /dev/null +++ b/glibc-nscd-sysconfig.patch @@ -0,0 +1,12 @@ +--- a/nscd/nscd.service 2014-02-27 00:04:13.684640521 +0530 ++++ b/nscd/nscd.service 2014-02-27 00:06:14.996635380 +0530 +@@ -6,7 +6,8 @@ + + [Service] + Type=forking +-ExecStart=/usr/sbin/nscd ++EnvironmentFile=-/etc/sysconfig/nscd ++ExecStart=/usr/sbin/nscd $NSCD_OPTIONS + ExecStop=/usr/sbin/nscd --shutdown + ExecReload=/usr/sbin/nscd -i passwd + ExecReload=/usr/sbin/nscd -i group diff --git a/glibc-rh1070416.patch b/glibc-rh1070416.patch new file mode 100644 index 0000000..67dbcb3 --- /dev/null +++ b/glibc-rh1070416.patch @@ -0,0 +1,41 @@ +diff --git a/nscd/nscd.service b/nscd/nscd.service +index 99c7563..a970186 100644 +--- a/nscd/nscd.service ++++ b/nscd/nscd.service +@@ -2,17 +2,20 @@ + + [Unit] + Description=Name Service Cache Daemon ++After=syslog.target + + [Service] +-Type=simple +-ExecStart=/usr/sbin/nscd --foreground ++Type=forking ++ExecStart=/usr/sbin/nscd + ExecStop=/usr/sbin/nscd --shutdown + ExecReload=/usr/sbin/nscd -i passwd + ExecReload=/usr/sbin/nscd -i group + ExecReload=/usr/sbin/nscd -i hosts + ExecReload=/usr/sbin/nscd -i services ++ExecReload=/usr/sbin/nscd -i netgroup + Restart=always + PIDFile=/run/nscd/nscd.pid + + [Install] + WantedBy=multi-user.target ++Also=nscd.socket +diff --git a/nscd/nscd.socket b/nscd/nscd.socket +new file mode 100644 +index 0000000..7e512d5 +--- /dev/null ++++ b/nscd/nscd.socket +@@ -0,0 +1,8 @@ ++[Unit] ++Description=Name Service Cache Daemon Socket ++ ++[Socket] ++ListenDatagram=/var/run/nscd/socket ++ ++[Install] ++WantedBy=sockets.target diff --git a/glibc.spec b/glibc.spec index 13823c9..7bc74eb 100644 --- a/glibc.spec +++ b/glibc.spec @@ -1,6 +1,6 @@ %define glibcsrcdir glibc-2.19-76-g3ea0f74 %define glibcversion 2.19.90 -%define glibcrelease 3%{?dist} +%define glibcrelease 4%{?dist} # Pre-release tarballs are pulled in from git using a command that is # effectively: # @@ -93,8 +93,6 @@ Source1: build-locale-archive.c Source2: glibc_post_upgrade.c Source3: libc-lock.h Source4: nscd.conf -Source5: nscd.service -Source6: nscd.socket Source7: nsswitch.conf Source8: power6emul.c @@ -183,6 +181,8 @@ Patch0044: %{name}-rh1009145.patch # Allow applications to call pthread_atfork without libpthread.so. Patch0046: %{name}-rh1013801.patch +Patch0047: %{name}-nscd-sysconfig.patch + # # Patches from upstream # @@ -214,6 +214,7 @@ Patch2028: %{name}-rh1025126.patch # Separate ftell logic from fseek Patch2029: %{name}-rh1069559-1.patch Patch2030: %{name}-rh1069559-2.patch +Patch2031: %{name}-rh1070416.patch ############################################################################## # End of glibc patches. @@ -541,6 +542,8 @@ package or when debugging this package. %patch2028 -p1 %patch2029 -p1 %patch2030 -p1 +%patch2031 -p1 +%patch0047 -p1 ############################################################################## # %%prep - Additional prep required... @@ -956,7 +959,7 @@ install -m 644 nscd/nscd.conf $RPM_BUILD_ROOT/etc mkdir -p $RPM_BUILD_ROOT%{_tmpfilesdir} install -m 644 %{SOURCE4} %{buildroot}%{_tmpfilesdir} mkdir -p $RPM_BUILD_ROOT/lib/systemd/system -install -m 644 %{SOURCE5} %{SOURCE6} $RPM_BUILD_ROOT/lib/systemd/system +install -m 644 nscd/nscd.service nscd/nscd.socket $RPM_BUILD_ROOT/lib/systemd/system %endif # Include ld.so.conf @@ -1627,6 +1630,10 @@ rm -f *.filelist* %endif %changelog +* Thu Feb 27 2014 Siddhesh Poyarekar - 2.19.90-4 +- Use nscd service files from glibc sources. +- Make nscd service forking in systemd service file. + * Tue Feb 25 2014 Siddhesh Poyarekar - 2.19.90-3 - Sync with upstream master. - Separate ftell from fseek logic and avoid modifying FILE data (#1069559). diff --git a/nscd.service b/nscd.service deleted file mode 100644 index 744a5c8..0000000 --- a/nscd.service +++ /dev/null @@ -1,18 +0,0 @@ -[Unit] -Description=Name Service Cache Daemon -After=syslog.target - -[Service] -EnvironmentFile=-/etc/sysconfig/nscd -ExecStart=/usr/sbin/nscd --foreground $NSCD_OPTIONS -ExecStop=/usr/sbin/nscd --shutdown -ExecReload=/usr/sbin/nscd -i passwd -ExecReload=/usr/sbin/nscd -i group -ExecReload=/usr/sbin/nscd -i hosts -ExecReload=/usr/sbin/nscd -i services -ExecReload=/usr/sbin/nscd -i netgroup -Restart=always - -[Install] -WantedBy=multi-user.target -Also=nscd.socket diff --git a/nscd.socket b/nscd.socket deleted file mode 100644 index 7e512d5..0000000 --- a/nscd.socket +++ /dev/null @@ -1,8 +0,0 @@ -[Unit] -Description=Name Service Cache Daemon Socket - -[Socket] -ListenDatagram=/var/run/nscd/socket - -[Install] -WantedBy=sockets.target