rpms/upstart/devel upstart-usr1-handler.patch, NONE, 1.1 .cvsignore, 1.10, 1.11 sources, 1.12, 1.13 upstart.spec, 1.43, 1.44

Petr Lautrbach plautrba at fedoraproject.org
Fri Jan 29 14:42:17 UTC 2010


Author: plautrba

Update of /cvs/pkgs/rpms/upstart/devel
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv11848

Modified Files:
	.cvsignore sources upstart.spec 
Added Files:
	upstart-usr1-handler.patch 
Log Message:
add SIGUSR1 handler and init-system-dbus.conf
Resolves: #559660


upstart-usr1-handler.patch:
 main.c |   32 ++++++++++++++++++++++++++++++++
 1 file changed, 32 insertions(+)

--- NEW FILE upstart-usr1-handler.patch ---
diff --git a/init/main.c b/init/main.c
index 2836583..0fb6a64 100644
--- a/init/main.c
+++ b/init/main.c
@@ -66,6 +66,7 @@ static void cad_handler     (void *data, NihSignal *signal);
 static void kbd_handler     (void *data, NihSignal *signal);
 static void pwr_handler     (void *data, NihSignal *signal);
 static void hup_handler     (void *data, NihSignal *signal);
+static void usr1_handler    (void *data, NihSignal *signal);
 #endif /* DEBUG */
 
 
@@ -234,6 +235,10 @@ main (int   argc,
 	/* SIGHUP instructs us to re-load our configuration */
 	nih_signal_set_handler (SIGHUP, nih_signal_handler);
 	NIH_MUST (nih_signal_add_handler (NULL, SIGHUP, hup_handler, NULL));
+
+	/* SIGHUSR1 instructs us to reconnect to system bus */
+	nih_signal_set_handler (SIGUSR1, nih_signal_handler);
+	NIH_MUST (nih_signal_add_handler (NULL, SIGUSR1, usr1_handler, NULL));
 #endif /* DEBUG */
 
 
@@ -465,4 +470,31 @@ hup_handler (void      *data,
 		}
 	}
 }
+
+/**
+ * usr1_handler:
+ * @data: unused,
+ * @signal: signal that called this handler.
+ *
+ * Handle having recieved the SIGHUSR1 signal, which we use to instruct us to
+ * connect to system bus.
+ **/
+static void
+usr1_handler (void      *data,
+	     NihSignal *signal)
+{
+
+	if (! control_bus) {
+		nih_info (_("Connecting to system bus"));
+
+		if (control_bus_open () < 0) {
+			NihError *err;
+
+			err = nih_error_get ();
+			nih_warn ("%s: %s", _("Unable to connect to the system bus"),
+				  err->message);
+			nih_free (err);
+		}
+	}
+}
 #endif /* DEBUG */


Index: .cvsignore
===================================================================
RCS file: /cvs/pkgs/rpms/upstart/devel/.cvsignore,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -p -r1.10 -r1.11
--- .cvsignore	27 Nov 2009 14:26:05 -0000	1.10
+++ .cvsignore	29 Jan 2010 14:42:17 -0000	1.11
@@ -1,2 +1,3 @@
 upstart-0.6.3.tar.bz2
 upstart-remove-tests.patch
+init-system-dbus.conf


Index: sources
===================================================================
RCS file: /cvs/pkgs/rpms/upstart/devel/sources,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -p -r1.12 -r1.13
--- sources	1 Dec 2009 11:53:24 -0000	1.12
+++ sources	29 Jan 2010 14:42:17 -0000	1.13
@@ -1 +1,2 @@
 ef9d2704426423f75d1e0c309ecfceb4  upstart-0.6.3.tar.bz2
+bf835fea1be622a5d68f168bd63f91e5  init-system-dbus.conf


Index: upstart.spec
===================================================================
RCS file: /cvs/pkgs/rpms/upstart/devel/upstart.spec,v
retrieving revision 1.43
retrieving revision 1.44
diff -u -p -r1.43 -r1.44
--- upstart.spec	17 Jan 2010 21:22:11 -0000	1.43
+++ upstart.spec	29 Jan 2010 14:42:17 -0000	1.44
@@ -1,12 +1,13 @@
 Name:           upstart
 Version:        0.6.3
-Release:        6%{?dist}
+Release:        7%{?dist}
 Summary:        An event-driven init system
 
 Group:          System Environment/Base
 License:        GPLv2 and LGPLv2+
 URL:            http://upstart.ubuntu.com
 Source0:        http://upstart.ubuntu.com/download/0.6/upstart-%{version}.tar.bz2
+Source1:        init-system-dbus.conf
 # remove tests which fail in koji
 Patch0:         upstart-remove-tests.patch
 Patch1:		upstart-telinit.patch
@@ -14,6 +15,8 @@ Patch2:		upstart-audit-events.patch
 # pulled from https://bugs.launchpad.net/ubuntu/+source/upstart/+bug/436758 
 # sparc specific allignment errors
 Patch3:         upstart-nih-alloc.patch
+# SIGUSR1 handler - connect to system dbus
+Patch4:         upstart-usr1-handler.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
@@ -31,6 +34,7 @@ during shutdown and supervising them whi
 %patch1 -p1 -b .u
 %patch2 -p1 -b .audit
 %patch3 -p1 -b .alignment
+%patch4 -p1 -b .usr1
 
 %build
 %configure --sbindir=/sbin --libdir=/%{_lib}
@@ -52,6 +56,7 @@ rm -rf %{buildroot}/%{_datadir}/aclocal/
 rm -rf %{buildroot}/%{_datadir}/aclocal/misc.m4
 # don't ship default jobs
 rm -f %{buildroot}/%{_sysconfdir}/init/*
+install -m 644 %{SOURCE1} %{buildroot}/%{_sysconfdir}/init/
 
 %find_lang %{name}
 
@@ -109,6 +114,9 @@ rm -rf %{buildroot}
 %{_mandir}/man8/telinit.8.gz
 
 %changelog
+* Fri Jan 29 2010 Petr Lautrbach <plautrba at redhat.com> 0.6.3-7
+- add SIGUSR1 handler and init-system-dbus.conf (#559660)
+
 * Sun Jan 17 2010 Dennis Gilmore <dennis at ausil.us> - 0.6.3-6
 - add patch from upstream fixing sparc alignment issues
 



More information about the scm-commits mailing list