rpms/upstart/OLPC-4 upstart-olpc-init.patch, NONE, 1.1 .cvsignore, 1.6, 1.7 sources, 1.7, 1.8 upstart.spec, 1.26, 1.27

Dennis Gilmore ausil at fedoraproject.org
Wed Nov 12 19:37:52 UTC 2008


Author: ausil

Update of /cvs/pkgs/rpms/upstart/OLPC-4
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv23297

Modified Files:
	.cvsignore sources upstart.spec 
Added Files:
	upstart-olpc-init.patch 
Log Message:
revert back to the OLPC-3 branch contents sinec it works and is the same as whats shipping in F-10


upstart-olpc-init.patch:

--- NEW FILE upstart-olpc-init.patch ---
diff -ru upstart-0.3.9/init/control.c upstart-0.3.9/init/control.c
--- upstart-0.3.9/init/control.c	2008-05-06 23:45:35.000000000 -0400
+++ upstart-0.3.9/init/control.c	2008-05-06 23:43:31.000000000 -0400
@@ -26,6 +26,8 @@
 
 
 #include <sys/types.h>
+#include <sys/socket.h>
+#include <sys/un.h>
 
 #include <errno.h>
 #include <unistd.h>
@@ -134,7 +136,69 @@
 
 	UPSTART_MESSAGE_LAST
 };
+/**
+ * upstart_addr:
+ * @addr: address structure to fill,
+ * @pid: process id.
+ *
+ * Fills the given address structure with the address that a process of
+ * @pid should be listening for responses on.
+ *
+ * The AF_UNIX abstract namespace is used with the init daemon (process #1)
+ * bound to /com/ubuntu/upstart and clients bound to /com/ubuntu/upstart/$PID
+ *
+ * Returns: size of address.
+ **/
+static size_t
+upstart_init_addr (struct sockaddr_un *addr,
+	      pid_t               pid)
+{
+	size_t addrlen;
+
+	nih_assert (addr != NULL);
+	nih_assert (pid > 0);
+
+	addr->sun_family = AF_UNIX;
+	addr->sun_path[0] = '\0';
 
+	addrlen = offsetof (struct sockaddr_un, sun_path) + 1;
+		addrlen += snprintf (addr->sun_path + 1,
+				     sizeof (addr->sun_path) - 1,
+				     "/com/ubuntu/upstart");
+
+	return addrlen;
+}
+
+int
+upstart_init_open (void)
+{
+	struct sockaddr_un addr;
+	size_t             addrlen;
+	int                sock, optval;
+
+	/* Communication is performed using a unix datagram socket */
+	sock = socket (PF_UNIX, SOCK_DGRAM, 0);
+	if (sock < 0)
+		nih_return_system_error (-1);
+
+	/* Bind the socket so we can receive responses */
+	addrlen = upstart_init_addr (&addr, getpid ());
+	if (bind (sock, (struct sockaddr *)&addr, addrlen) < 0)
+		goto error;
+
+	/* Always requests credentials */
+	optval = 1;
+	if (setsockopt (sock, SOL_SOCKET, SO_PASSCRED, &optval,
+			sizeof (optval)) < 0)
+		goto error;
+
+	return sock;
+
+error:
+	nih_error_raise_system ();
+	close (sock);
+	return -1;
+}
 
 /**
  * control_open:
@@ -150,7 +214,7 @@
 {
 	int sock;
 
-	sock = upstart_open ();
+	sock = upstart_init_open ();
 	if (sock < 0)
 		return NULL;
 
diff -ru upstart-0.3.9/init/main.c ./main.c
--- upstart-0.3.9/init/main.c	2008-05-06 23:45:35.000000000 -0400
+++ ./main.c	2008-05-06 23:37:53.000000000 -0400
@@ -95,6 +95,8 @@
  **/
 static int rescue = FALSE;
 
+static int snarf = FALSE;
+
 
 /**
  * options:
@@ -102,8 +104,9 @@
  * Command-line options we accept.
  **/
 static NihOption options[] = {
-	{ 0, "restart", NULL, NULL, NULL, &restart, NULL },
-	{ 0, "rescue", NULL, NULL, NULL, &rescue, NULL },
+	{ 'd', "restart", "Restart init (bad idea?)", NULL, NULL, &restart, NULL },
+	{ 's', "rescue", "Perform rescue operations?", NULL, NULL, &rescue, NULL },
+	{ 'i', "init", "Snarf PID happily.", NULL, NULL, &snarf, NULL },
 
 	/* Ignore invalid options */
 	{ '-', "--", NULL, NULL, NULL, NULL, NULL },
@@ -139,7 +142,9 @@
 	}
 
 	/* Check we're process #1 */
-	if (getpid () > 1) {
+	if (snarf) {
+		int pid = getpid();
+	} else if (getpid () > 1) {
 		execv (TELINIT, argv);
 		/* Ignore failure, probably just that telinit doesn't exist */
 
@@ -147,7 +152,6 @@
 		exit (1);
 	}
 
-
 	/* Clear our arguments from the command-line, so that we show up in
 	 * ps or top output as /sbin/init, with no extra flags.
 	 *
diff -ru upstart-0.3.9/upstart/message.c ./main.c
--- upstart-0.3.9/upstart/message.c	2008-05-07 10:45:31.000000000 -0400
+++ upstart-0.3.9/upstart/message.c	2008-05-07 10:46:00.000000000 -0400
@@ -515,30 +515,6 @@
 		 */
 	}
 
-	/* Check the origin of the message, this is a safety trap so we
-	 * don't even bother parsing memory if the process shouldn't be able
-	 * to talk to us.
-	 *
-	 * Only the init daemon accepts messages from any process, others
-	 * will only accept messages from the init daemon or themselves.
-	 *
-	 * In addition, we only permit messages to come from a process
-	 * running as root or our own user id (though this may be relaxed
-	 * for the init daemon later).
-	 */
-	if (! upstart_disable_safeties) {
-		if (cred.pid == 0)
-			goto illegal;
-
-		if ((cred.pid != UPSTART_INIT_DAEMON)
-		    && (cred.pid != getpid ())
-		    && (getpid () != UPSTART_INIT_DAEMON))
-			goto illegal;
-
-		if ((cred.uid != 0) && (cred.uid != getuid ()))
-			goto illegal;
-	}
-
 
 	/* Read the header from the message, which tells us what type of
 	 * message follows.


Index: .cvsignore
===================================================================
RCS file: /cvs/pkgs/rpms/upstart/OLPC-4/.cvsignore,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- .cvsignore	12 Aug 2008 18:57:16 -0000	1.6
+++ .cvsignore	12 Nov 2008 19:37:19 -0000	1.7
@@ -1 +1 @@
-upstart-0.5.0.tar.bz2
+upstart-0.3.9.tar.bz2


Index: sources
===================================================================
RCS file: /cvs/pkgs/rpms/upstart/OLPC-4/sources,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- sources	12 Aug 2008 18:57:16 -0000	1.7
+++ sources	12 Nov 2008 19:37:19 -0000	1.8
@@ -1 +1 @@
-c040227c746d22f87c0cd20cd1ca865b  upstart-0.5.0.tar.bz2
+794208083d405ece123ad59a02f3e233  upstart-0.3.9.tar.bz2


Index: upstart.spec
===================================================================
RCS file: /cvs/pkgs/rpms/upstart/OLPC-4/upstart.spec,v
retrieving revision 1.26
retrieving revision 1.27
diff -u -r1.26 -r1.27
--- upstart.spec	12 Aug 2008 18:57:16 -0000	1.26
+++ upstart.spec	12 Nov 2008 19:37:20 -0000	1.27
@@ -1,26 +1,24 @@
-#%define build_str 20080730bzr_dbus_userspace_1046
-%define build_str 0
-%if %build_str
-%define build_rel 0.%{build_str}_
-%define build_pkg -%{build_str}
-%else
-%define build_rel %{nil}
-%define build_pkg %{nil}
-%endif
-
 Name:           upstart
-Version:        0.5.0
-Release:        %{build_rel}1%{?dist}
+Version:        0.3.9
+Release:        19%{?dist}.1
 Summary:        An event-driven init system
+
 Group:          System Environment/Base
 License:        GPLv2+
 URL:            http://upstart.ubuntu.com
-Source0:        http://upstart.ubuntu.com/download/0.3/upstart-%{version}%{build_pkg}.tar.bz2
-Source1:        events.5
+Source0:        http://upstart.ubuntu.com/download/0.3/upstart-%{version}.tar.bz2
+Source1:	events.5
+Patch0:         upstart-gcc43.patch
+Patch1:         upstart-force-on-shutdown-reboot.patch
+Patch2:         upstart-tty-stack.patch
+Patch3:         upstart-rpm.patch
+Patch4:         upstart-fedora-buglist.patch
+Patch5:         upstart-telinit-u.patch
+Patch6:	        upstart-initctl-man.patch
+Patch7:         upstart-olpc-init.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
-Requires: dbus >= 1.2.1-4
 BuildRequires:  gettext
 
 %description
@@ -28,11 +26,16 @@
 handles starting of tasks and services during boot, stopping them
 during shutdown and supervising them while the system is running.
 
-%post
-kill -TERM 1
-
 %prep
-%setup -q -n upstart-%{version}%{build_pkg}
+%setup -q
+%patch0 -p1
+%patch1 -p1
+%patch2
+%patch3
+%patch4 -p1
+%patch5 -p1
+%patch6 -p1
+%patch7 -p1
 
 %build
 %configure --enable-compat=sysv --sbindir=/sbin --libdir=/%{_lib}
@@ -42,11 +45,20 @@
 rm -rf %{buildroot}
 make install DESTDIR=%{buildroot}
 
-mkdir -p %{buildroot}/%{_sysconfdir}/init/jobs.d/
-
 mkdir -p %{buildroot}/%{_mandir}/man5
 install -m 644 %{SOURCE1} %{buildroot}/%{_mandir}/man5/events.5
 
+# libupstart and libnih aren't shipped
+rm -f %{buildroot}/%{_lib}/libupstart.*
+rm -f %{buildroot}/%{_lib}/libnih.*
+rm -f %{buildroot}/%{_includedir}/libnih.h
+rm -f %{buildroot}/%{_includedir}/libupstart.h
+rm -rf %{buildroot}/%{_includedir}/nih
+rm -rf %{buildroot}/%{_includedir}/upstart
+rm -rf %{buildroot}/%{_datadir}/aclocal/compiler.m4
+rm -rf %{buildroot}/%{_datadir}/aclocal/linker.m4
+rm -rf %{buildroot}/%{_datadir}/aclocal/misc.m4
+
 %find_lang %{name}
 
 %clean
@@ -60,11 +72,12 @@
 %doc README
 %doc TODO
 %doc HACKING
-%{_sysconfdir}/init/
-%{_sysconfdir}/dbus-1/system.d/Upstart.conf
+%{_sysconfdir}/event.d/
+%config(noreplace) %{_sysconfdir}/event.d/logd
 /sbin/halt
 /sbin/init
 /sbin/initctl
+/sbin/logd
 /sbin/poweroff
 /sbin/reboot
 /sbin/runlevel
@@ -77,6 +90,7 @@
 %{_mandir}/man8/halt.8.gz
 %{_mandir}/man8/init.8.gz
 %{_mandir}/man8/initctl.8.gz
+%{_mandir}/man8/logd.8.gz
 %{_mandir}/man8/poweroff.8.gz
 %{_mandir}/man8/reboot.8.gz
 %{_mandir}/man8/runlevel.8.gz
@@ -87,40 +101,8 @@
 %{_mandir}/man8/telinit.8.gz
 
 %changelog
-* Tue Aug 12 2008 Casey Dahlin <cdahlin at redhat.com - 0.5.0
-- New upstream release
-
-* Thu Jul 31 2008 Casey Dahlin <cdahlin at redhat.com - 0.5.0-20080730bzr_dbus_userspace_1046_2
-- Rebase to upstream
-- To retrieve source:
-    bzr clone lp:upstart/0.5 -r 1046
-    bzr branch lp:~cjdahlin/libnih/event-loop-async-fix -r 596
-
-* Wed Jul 23 2008 Casey Dahlin <cdahlin at redhat.com - 0.5.0-20080723bzr_dbus_userspace_1045_1
-- More reflective tarball name
-- Retrieve source with `bzr clone lp:~cjdahlin/upstart/trunk -r 1045`
-
-* Tue Jul 22 2008 Casey Dahlin <cdahlin at redhat.com - 0.5.0-0.0.7
-- Fix bug in environment substitution
-
-* Tue Jul 22 2008 Casey Dahlin <cdahlin at redhat.com - 0.5.0-0.0.6
-- Fix reboot issue
-
-* Mon Jul 21 2008 Casey Dahlin <cdahlin at redhat.com - 0.5.0-0.0.5
-- Propagate runlevel calculation glitch fix to /sbin/shutdown
-
-* Fri Jul 18 2008 Casey Dahlin <cdahlin at redhat.com - 0.5.0-0.0.4
-- Fix runlevel calculation glitch
-- Remove some loose comments from spec
-
-* Wed Jul 16 2008 Casey Dahlin <cdahlin at redhat.com - 0.5.0-0.0.3
-- Bump dbus timeout to INT_MAX
-
-* Wed Jul 16 2008 Casey Dahlin <cdahlin at redhat.com - 0.5.0-0.0.2
-- Fix mishandling of multiline scripts
-
-* Wed Jul 16 2008 Casey Dahlin <cdahlin at redhat.com - 0.5.0-0.0.1
-- Upstream to lp:upstart/dbus-userspace
+* Wed May 07 2008 Dennis Gilmore <dennis at laptop.org> - 0.3.9-19.1
+- apply patch from Blake Setlow allowing upstart to run as a PID other than 1
 
 * Fri Apr 25 2008 Bill Nottingham <notting at redhat.com> - 0.3.9-19
 - with the merge of event-compat-sysv, move the sysvinit obsoletes/provides here




More information about the scm-commits mailing list