From aee6db4f7ea71e3bf92b0839dba082cdf3c22127 Mon Sep 17 00:00:00 2001 From: Tim Waugh Date: Fri, 24 Sep 2004 10:56:57 +0000 Subject: [PATCH] - Write a pid file (bug #132987). --- cups-pid.patch | 36 ++++++++++++++++++++++++++++++++++++ cups.spec | 11 ++++++++--- 2 files changed, 44 insertions(+), 3 deletions(-) create mode 100644 cups-pid.patch diff --git a/cups-pid.patch b/cups-pid.patch new file mode 100644 index 0000000..ab4ff84 --- /dev/null +++ b/cups-pid.patch @@ -0,0 +1,36 @@ +--- cups-1.1.21/scheduler/main.c.pid 2004-09-24 11:29:05.073748138 +0100 ++++ cups-1.1.21/scheduler/main.c 2004-09-24 11:44:35.826446564 +0100 +@@ -349,6 +349,8 @@ + * Setup signal handlers for the parent... + */ + ++ pid_t pid; ++ + #ifdef HAVE_SIGSET /* Use System V signals over POSIX to avoid bugs */ + sigset(SIGUSR1, parent_handler); + sigset(SIGCHLD, parent_handler); +@@ -372,7 +374,7 @@ + signal(SIGHUP, SIG_IGN); + #endif /* HAVE_SIGSET */ + +- if (fork() > 0) ++ if ((pid = fork()) > 0) + { + /* + * OK, wait for the child to startup and send us SIGUSR1 or to crash +@@ -384,7 +386,15 @@ + sleep(1); + + if (parent_signal == SIGUSR1) ++ { ++ FILE *f = fopen ("/var/run/cupsd.pid", "w"); ++ if (f) ++ { ++ fprintf (f, "%d\n", pid); ++ fclose (f); ++ } + return (0); ++ } + + if (wait(&i) < 0) + { diff --git a/cups.spec b/cups.spec index 866f637..c07d135 100644 --- a/cups.spec +++ b/cups.spec @@ -6,7 +6,7 @@ Summary: Common Unix Printing System Name: cups Version: 1.1.21 -Release: 2 +Release: 3 License: GPL Group: System Environment/Daemons Source: ftp://ftp.easysw.com/pub/cups/test/cups-%{version}-source.tar.bz2 @@ -38,7 +38,8 @@ Patch25: cups-enabledisable.patch Patch28: cups-no-propagate-ipp-port.patch Patch30: cups-session-printing.patch Patch31: cups-overread.patch -Patch32: cups-dbus.patch +Patch32: cups-pid.patch +Patch33: cups-dbus.patch Epoch: 1 Url: http://www.cups.org/ BuildRoot: %{_tmppath}/%{name}-root @@ -112,8 +113,9 @@ natively, without needing the lp/lpr commands. %patch28 -p1 -b .no-propagate-ipp-port #%patch30 -p1 -b .session-printing %patch31 -p1 -b .overread +%patch32 -p1 -b .pid %if %use_dbus -%patch32 -p1 -b .dbus +%patch33 -p1 -b .dbus %endif perl -pi -e 's,^#(Printcap\s+/etc/printcap),$1,' conf/cupsd.conf.in aclocal -I config-scripts @@ -326,6 +328,9 @@ rm -rf $RPM_BUILD_ROOT %{_includedir}/cups %changelog +* Fri Sep 24 2004 Tim Waugh 1:1.1.21-3 +- Write a pid file (bug #132987). + * Thu Sep 23 2004 Tim Waugh 1:1.1.21-2 - 1.1.21.