From 70215e395ae28521ddb6112f2337dff825f3aed8 Mon Sep 17 00:00:00 2001 From: Jesse Keating Date: Tue, 29 Sep 2009 07:13:19 +0000 Subject: [PATCH 1/5] Initialize branch F-12 for upstart --- branch | 1 + 1 file changed, 1 insertion(+) create mode 100644 branch diff --git a/branch b/branch new file mode 100644 index 0000000..06de2d2 --- /dev/null +++ b/branch @@ -0,0 +1 @@ +F-12 From 329377d83985e8ee0fd9d4f368b364524d7de92e Mon Sep 17 00:00:00 2001 From: Bill Nottingham Date: Thu, 26 Nov 2009 01:15:33 +0000 Subject: [PATCH 2/5] Fix typo that causes a failure to update the common directory. (releng #2781) --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 7d2ec21..b4ab50a 100644 --- a/Makefile +++ b/Makefile @@ -1,10 +1,10 @@ # Makefile for source rpm: upstart -# $Id$ +# $Id: Makefile,v 1.1 2008/02/07 02:32:39 kevin Exp $ NAME := upstart SPECFILE = $(firstword $(wildcard *.spec)) define find-makefile-common -for d in common ../common ../../common ; do if [ -f $$d/Makefile.common ] ; then if [ -f $$d/CVS/Root -a -w $$/Makefile.common ] ; then cd $$d ; cvs -Q update ; fi ; echo "$$d/Makefile.common" ; break ; fi ; done +for d in common ../common ../../common ; do if [ -f $$d/Makefile.common ] ; then if [ -f $$d/CVS/Root -a -w $$d/Makefile.common ] ; then cd $$d ; cvs -Q update ; fi ; echo "$$d/Makefile.common" ; break ; fi ; done endef MAKEFILE_COMMON := $(shell $(find-makefile-common)) From 13bccc55f249aa25388189d170084323aa1b0d6a Mon Sep 17 00:00:00 2001 From: Petr Lautrbach Date: Wed, 10 Mar 2010 09:55:40 +0000 Subject: [PATCH 3/5] Update utmp and wtmp records when process die Resolves: #470004 --- upstart-utmp.patch | 81 ++++++++++++++++++++++++++++++++++++++++++++++ upstart.spec | 8 ++++- 2 files changed, 88 insertions(+), 1 deletion(-) create mode 100644 upstart-utmp.patch diff --git a/upstart-utmp.patch b/upstart-utmp.patch new file mode 100644 index 0000000..814c108 --- /dev/null +++ b/upstart-utmp.patch @@ -0,0 +1,81 @@ +diff --git a/init/job.c b/init/job.c +index ddf4369..fb0cf1b 100644 +--- a/init/job.c ++++ b/init/job.c +@@ -35,6 +35,8 @@ + #include + #include + #include ++#include ++#include + + #include + #include +@@ -1563,6 +1565,8 @@ job_child_reaper (void *data, + Job *job; + ProcessType process; + int failed = FALSE, stop = FALSE, state = TRUE; ++ struct utmpx utmp; ++ struct utmpx *utmptr; + + nih_assert (data == NULL); + nih_assert (pid > 0); +@@ -1732,6 +1736,39 @@ job_child_reaper (void *data, + job->kill_timer = NULL; + } + ++ ++ /* Find existing utmp entry for the process pid */ ++ /* clean out an utmp struct. */ ++ memset(&utmp, 0, sizeof(utmp)); ++ ++ setutxent(); ++ while ((utmptr = getutxent()) != NULL) { ++ if (utmptr->ut_pid == job->process[process]->pid) { ++ struct timeval tv; ++ ++ /* set type and clean ut_user, ut_host, ++ * ut_time as described in utmp(5) */ ++ utmptr->ut_type = DEAD_PROCESS; ++ memset(utmptr->ut_user, 0, UT_NAMESIZE); ++ memset(utmptr->ut_host, 0, UT_HOSTSIZE); ++ utmptr->ut_time = 0; ++ /* Update existing utmp file. */ ++ setutxent(); ++ pututxline(utmptr); ++ ++ /* set ut_time for log */ ++ gettimeofday(&tv, NULL); ++ utmptr->ut_tv.tv_sec = tv.tv_sec; ++ utmptr->ut_tv.tv_usec = tv.tv_usec; ++ /* Write wtmp entry */ ++ updwtmpx (_PATH_WTMP, utmptr); ++ ++ break; ++ } ++ } ++ endutxent(); ++ ++ + /* Clear the process pid field */ + job->process[process]->pid = 0; + +diff --git a/init/paths.h b/init/paths.h +index ead1ca9..0b8ea6e 100644 +--- a/init/paths.h ++++ b/init/paths.h +@@ -92,4 +92,14 @@ + #endif + + ++/** ++ * _PATH_WTMP: ++ * ++ * This is the wtmp filename. ++ **/ ++#ifndef _PATH_WTMP ++#define _PATH_WTMP "/var/log/wtmp" ++#endif ++ ++ + #endif /* INIT_PATHS_H */ diff --git a/upstart.spec b/upstart.spec index d6ccf30..e89396e 100644 --- a/upstart.spec +++ b/upstart.spec @@ -1,6 +1,6 @@ Name: upstart Version: 0.3.11 -Release: 3%{?dist} +Release: 4%{?dist} Summary: An event-driven init system Group: System Environment/Base @@ -15,6 +15,8 @@ Patch3: upstart-telinit-u.patch Patch4: upstart-initctl-man.patch Patch5: upstart-save-state-across-reexec.patch Patch6: upstart-audit-events.patch +# Update utmp and wtmp records when process die +Patch7: upstart-utmp.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) Obsoletes: SysVinit < 2.86-24, sysvinit < 2.86-24 Provides: SysVinit = 2.86-24, sysvinit = 2.86-24 @@ -34,6 +36,7 @@ during shutdown and supervising them while the system is running. %patch4 -p1 %patch5 -p1 %patch6 -p1 +%patch7 -p1 %build %configure --enable-compat=sysv --sbindir=/sbin --libdir=/%{_lib} @@ -99,6 +102,9 @@ rm -rf %{buildroot} %{_mandir}/man8/telinit.8.gz %changelog +* Tue Mar 09 2010 Petr Lautrbach 0.3.11-4 +- Update utmp and wtmp records when process die (#470004) + * Fri Aug 21 2009 Tomas Mraz - 0.3.11-3 - rebuilt with new audit From c3d8587b6b1206ff78573b5b66324107687cdbfb Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Thu, 29 Jul 2010 14:46:18 +0000 Subject: [PATCH 4/5] dist-git conversion --- .cvsignore => .gitignore | 0 Makefile | 21 --------------------- branch | 1 - 3 files changed, 22 deletions(-) rename .cvsignore => .gitignore (100%) delete mode 100644 Makefile delete mode 100644 branch diff --git a/.cvsignore b/.gitignore similarity index 100% rename from .cvsignore rename to .gitignore diff --git a/Makefile b/Makefile deleted file mode 100644 index b4ab50a..0000000 --- a/Makefile +++ /dev/null @@ -1,21 +0,0 @@ -# Makefile for source rpm: upstart -# $Id: Makefile,v 1.1 2008/02/07 02:32:39 kevin Exp $ -NAME := upstart -SPECFILE = $(firstword $(wildcard *.spec)) - -define find-makefile-common -for d in common ../common ../../common ; do if [ -f $$d/Makefile.common ] ; then if [ -f $$d/CVS/Root -a -w $$d/Makefile.common ] ; then cd $$d ; cvs -Q update ; fi ; echo "$$d/Makefile.common" ; break ; fi ; done -endef - -MAKEFILE_COMMON := $(shell $(find-makefile-common)) - -ifeq ($(MAKEFILE_COMMON),) -# attept a checkout -define checkout-makefile-common -test -f CVS/Root && { cvs -Q -d $$(cat CVS/Root) checkout common && echo "common/Makefile.common" ; } || { echo "ERROR: I can't figure out how to checkout the 'common' module." ; exit -1 ; } >&2 -endef - -MAKEFILE_COMMON := $(shell $(checkout-makefile-common)) -endif - -include $(MAKEFILE_COMMON) diff --git a/branch b/branch deleted file mode 100644 index 06de2d2..0000000 --- a/branch +++ /dev/null @@ -1 +0,0 @@ -F-12 From 001a2458dbe4e6d9976b3d3de73b299f63bd6823 Mon Sep 17 00:00:00 2001 From: Petr Lautrbach Date: Mon, 20 Sep 2010 22:34:07 +0200 Subject: [PATCH 5/5] don't rewind utmp file pointer (#632568) --- upstart-utmp.patch | 5 ++--- upstart.spec | 5 ++++- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/upstart-utmp.patch b/upstart-utmp.patch index 814c108..c19e012 100644 --- a/upstart-utmp.patch +++ b/upstart-utmp.patch @@ -1,5 +1,5 @@ diff --git a/init/job.c b/init/job.c -index ddf4369..fb0cf1b 100644 +index ddf4369..b4a73d8 100644 --- a/init/job.c +++ b/init/job.c @@ -35,6 +35,8 @@ @@ -20,7 +20,7 @@ index ddf4369..fb0cf1b 100644 nih_assert (data == NULL); nih_assert (pid > 0); -@@ -1732,6 +1736,39 @@ job_child_reaper (void *data, +@@ -1732,6 +1736,38 @@ job_child_reaper (void *data, job->kill_timer = NULL; } @@ -41,7 +41,6 @@ index ddf4369..fb0cf1b 100644 + memset(utmptr->ut_host, 0, UT_HOSTSIZE); + utmptr->ut_time = 0; + /* Update existing utmp file. */ -+ setutxent(); + pututxline(utmptr); + + /* set ut_time for log */ diff --git a/upstart.spec b/upstart.spec index e89396e..f5d93a4 100644 --- a/upstart.spec +++ b/upstart.spec @@ -1,6 +1,6 @@ Name: upstart Version: 0.3.11 -Release: 4%{?dist} +Release: 5%{?dist} Summary: An event-driven init system Group: System Environment/Base @@ -102,6 +102,9 @@ rm -rf %{buildroot} %{_mandir}/man8/telinit.8.gz %changelog +* Mon Sep 20 2010 Petr Lautrbach 0.3.11-5 +- Don't rewind utmp file pointer (#632568) + * Tue Mar 09 2010 Petr Lautrbach 0.3.11-4 - Update utmp and wtmp records when process die (#470004)