--- upstart-0.3.9.orig/debian/upstart-logd.dirs +++ upstart-0.3.9/debian/upstart-logd.dirs @@ -0,0 +1 @@ +usr/share/doc --- upstart-0.3.9.orig/debian/upstart.docs +++ upstart-0.3.9/debian/upstart.docs @@ -0,0 +1,2 @@ +AUTHORS +NEWS --- upstart-0.3.9.orig/debian/system-services.dirs +++ upstart-0.3.9/debian/system-services.dirs @@ -0,0 +1,3 @@ +etc/event.d +usr/lib/upstart +usr/share/doc --- upstart-0.3.9.orig/debian/copyright +++ upstart-0.3.9/debian/copyright @@ -0,0 +1,19 @@ +This is the Ubuntu package of upstart, the event-based init daemon. + +Copyright © 2007 Canonical Ltd. +Copyright © 2007 Scott James Remnant + +Licence: + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +On Ubuntu systems, the complete text of the GNU General Public License +can be found in ‘/usr/share/common-licenses/GPL’. --- upstart-0.3.9.orig/debian/README.Debian +++ upstart-0.3.9/debian/README.Debian @@ -0,0 +1,247 @@ +upstart +======= + +Upstart is a replacement for the traditional sysvinit package, and +runs as process #1. Through upstart, we are able to have an +event-driven process, whilst at the same time retaining compatibility +for the original sysvinit behaviour. + +This file documents how to do a few common operations with the new +system. + + +Where are initscripts installed? +-------------------------------- + +This has not changed, they are installed in /etc/init.d. See +/etc/init.d/README. + +Important system jobs are no longer shipped as initscripts, but as +upstart jobs. These are installed in /etc/event.d. + + +How are initscripts started and stopped? +---------------------------------------- + +This has not changed, symlinks are made from the initscript in the +/etc/init.d directory to the /etc/rc?.d directories. See +/etc/init.d/README and /etc/rc?.d/README. + + +What order are initscripts started and stopped in? +-------------------------------------------------- + +This has not changed, the symlinks are named SNNname or KNNname, where +NN is a number from 00 to 99. The K scripts are run first in +numerical order, followed by the S scripts in numerical order. + + +How do I find the current/previous runlevel? +-------------------------------------------- + +This has not changed, use the "runlevel" command provided by the +upstart-compat-sysv package. See runlevel(8). + + +How do I change the runlevel? +----------------------------- + +This has not changed, use the "telinit" command or just invoke "init" +directly. See telinit(8). + + +How do I change the default runlevel? +------------------------------------- + +Edit the /etc/inittab file, if you installed hardy fresh you'll need to +create it. Locate, or write, the following line: + + id:N:initdefault: + +Where N is the default runlevel, change this to match. + + +How do I shutdown the machine? +------------------------------ + +This has not changed, use the "shutdown" command provided by the +upstart package; you may also use the "reboot"/"halt"/"poweroff" +commands as a short-cut. See shutdown(8) and reboot(8). + +You can also press Control-Alt-Delete on a console to reboot the +machine. + + +How do I change the behaviour of Control-Alt-Delete? +---------------------------------------------------- + +Edit the /etc/event.d/control-alt-delete file, the line beginning +"exec" is what upstart will run when this key combination is pressed. + +To not do anything, you can simply delete this file. After deleting +the file, you need to "kill 1" to ensure that the job is removed from +its memory. + + +How do I enter single-user mode? +-------------------------------- + +This hasn't changed, choose the "(recovery mode)" option from GRUB; +add "-s", "S" or "single" to the kernel command-line; or from a +running machine, run "telinit 1" or "shutdown now". + + +How do I reduce the number of gettys? +------------------------------------- + +Also see "How do I change which runlevels gettys are run in?" + +In /etc/event.d there is a file named ttyN for each getty that will be +started, where N is numbered 1 to 6. Remove any that you do not +want. + +This will not take immediate effect, however you can run "stop ttyN" +to stop one that is running. + + +How do I change getty parameters? +--------------------------------- + +In /etc/event.d there is a file named ttyN for each getty that will be +started, where N is numbered 1 to 6. Edit these files, the line +beginning "respawn" is what upstart will run. + +This will not take immediate effect, run "stop ttyN" followed by +"start ttyN" or just kill the running getty to respawn with the new +parameters. + + +How do I change which runlevels gettys are run in? +-------------------------------------------------- + +In /etc/event.d there is a file named ttyN for each getty that will be +started, where N is numbered 1 to 6. Edit these files, there are a +series of lines of either "start on runlevel N" or +"stop on runlevel N". + +Change "stop" to "start" or "start" to "stop" to match your taste. + +This will not take immediate effect, however you can run "stop ttyN" +to stop one that is running or "start ttyN" to start one that isn't. + + +How do I increase the number of gettys? +--------------------------------------- + +In /etc/event.d there is a file named ttyN for each getty that will be +started, where N is numbered 1 to 6. + +Copy one of these files to a new name, we suggest you simply name it +after the tty, e.g. "ttyS0". + +Edit that file, change the "respawn" line to match your requirements; +in particular you'll need to change the tty the getty should be run +on. + +This will not take immediate effect, however you can run "start ttyN" +to start the getty. + + +How do I add a serial console? +------------------------------ + +See "How do I increase the number of gettys?" + + +Where are the boot messages logged? +----------------------------------- + +Messages output by the rc scripts can be found in /var/log/boot, if +you have the upstart-logd package installed. + + +How can I see boot messages on the console? +------------------------------------------- + +This is nothing to do with upstart, but I'll answer this anyway. +Remove "quiet" from the kernel command-line. + +To make this permanent, edit /boot/grub/menu.lst and edit the line +that begins "# defoptions=" (yes, it looks like a comment). + +This will change both usplash and the LSB init logging. + + +Upstart isn't working, how do I debug it? +----------------------------------------- + +Add "--debug" to the kernel command-line, and be sure to remove "quiet" +and "splash". You'll now see debugging messages as upstart works. + + +Upstart does nothing, what's wrong? +----------------------------------- + +You probably don't have the upstart-compat-sysv or system-services +packages installed, likely because you've accidentally removed +ubuntu-minimal in the past. + +Here's a quick guide to rescuing your system: + + 1. Edit the kernel command-line, remove "quiet" and "splash", + add "init=/bin/bash". + + The machine will boot into a root shell. + + 2. Run "/etc/init.d/rcS" + + The machine will set up the basic necessities such as hardware + and networking. + + 3. Run "aptitude update" + + The machine will update the package lists against the Ubuntu archive. + + 4. Run "aptitude install ubuntu-minimal" + + The machine will now install the missing packages. + + 5. Check that there are now files in /etc/event.d + + 6. Run "reboot -f" + + The machine will now reboot. + +Hopefully your machine should now boot normally. + + +Can I query upstart for a list of jobs? +--------------------------------------- + +Yes, "initctl list" will list the known jobs and their status. You +can receive notification of any changes with "initctl jobs". + + +How do I manually start or stop a job? +-------------------------------------- + +Use "start JOB" or "stop JOB". + + +How do I find the status of a job? +---------------------------------- + +Use "status JOB". + + +Can I receive notification of events? +------------------------------------- + +Yes, "initctl events" will display them as they are emitted. + + +Can I emit an event by hand? +---------------------------- + +Yes, "initctl emit EVENT" will emit the named event and cause any +jobs waiting for it to be started or stopped as appropriate. --- upstart-0.3.9.orig/debian/changelog +++ upstart-0.3.9/debian/changelog @@ -0,0 +1,338 @@ +upstart (0.3.9-5) intrepid; urgency=low + + * Correct build problem on amd64 and ia64 by only building libnih and + libupstart statically. The shared objects were unwanted, and conflict + with -fPIE. + + -- Scott James Remnant Wed, 04 Jun 2008 17:07:12 +0100 + +upstart (0.3.9-4) intrepid; urgency=low + + * Add missing limits.h, required to build with current libc. + + -- Scott James Remnant Wed, 04 Jun 2008 13:09:32 +0100 + +upstart (0.3.9-3) intrepid; urgency=low + + * Change dependency from sysvutils to sysvinit-utils. LP: #237276. + * Compile with stack -fstack-protector, -fPIE, -z relro, -z now and -pie + (MMmm, pie) + + -- Scott James Remnant Wed, 04 Jun 2008 12:59:11 +0100 + +upstart (0.3.9-2) hardy; urgency=low + + * Start the getty on tty1 after the rc script has stopped rather then + at the same time it starts to avoid overwriting by console messages. + tty2..6 will still be active if you want an early login. LP: #65230. + * If the recovery menu is available start that instead of sulogin when + entering single-user-mode. + + -- Scott James Remnant Fri, 11 Apr 2008 13:38:50 +0100 + +upstart (0.3.9-1) hardy; urgency=low + + * New upstream release: + - many bug fixes. + + * Update reference to "edgy" in README.Debian to "hardy". LP: #140037. + + -- Scott James Remnant Sun, 28 Oct 2007 10:51:59 -0400 + +upstart (0.3.8-2) gutsy; urgency=low + + * Fix broken migration of old-style 'respawn process' stanzas which + produced corrupted 'exec' stanzas. Try to fix up files previously + corrupted by this. LP: #95210 + + -- Scott James Remnant Sun, 28 Oct 2007 10:50:36 -0400 + +upstart (0.3.8-1) feisty; urgency=low + + * New upstream release: + - much improved initctl tool. + + * Update my standard prep_/undo_/rm_conffile functions to take into account + current dpkg behaviour wrt obsolete conffiles. The conffile is now moved + out of the way in preinst and the moved file deleted in postinst, or moved + back in postrm abort-upgrade. This means it's not there when dpkg + configures the new version, so the conffile is not left in the list. + * Purge backups of modified obsolete conffiles when the package is purged. + + * Update runlevel and respawn rule generated in migrate-inittab.pl + LP: #89314 + + * Drop 00-libnih-update.patch and 01-libnih-sparc-ftbfs.patch; new upstream + release includes an up-to-date libnih which contains both patches. + * Drop 10-cant-stop-execless-job.patch; included upstream. + * Drop 20-complex-event-config.patch; this is going to be significantly + changed upstream, and we don't want to ship something strange. + * Drop 30-fix-warnings.patch; included upstream. + + -- Scott James Remnant Sun, 11 Mar 2007 19:19:00 +0000 + +upstart (0.3.5-2) feisty; urgency=low + + * Changed "start script" to "pre-start script" in sulogin event, the former + is no longer recognised. + + * Applied 01-libnih-sparc-ftbfs.patch; this updates the signal name list + to exclude signals not available on that architecture, and add one that's + unique to it. + * Applied 30-fix-warnings.patch; this corrects a few warnings that spoiled + an otherwise clean build log. + + -- Scott James Remnant Tue, 13 Feb 2007 15:56:33 +0000 + +upstart (0.3.5-1) feisty; urgency=low + + * New upstream release: + - inotify file descriptor leak fixed. LP: #83099. + - inotify support is no longer required. LP: #68904. + - new job state machine + - new event structure, can now include arguments and environment + + * Applied 00-libnih-update.patch; this updates the libnih library to the + latest bzr trunk version, required for the complex-event-config patch. + * Applied 10-cant-stop-execless-job.patch from upstream; this corrects a + bug where jobs without an "exec" or "script" stanza cannot be stopped. + * Applied 20-complex-event-config.patch from upstream; this is an + experimental implementation of the "on" keyword that allows definition + of complex system states. + + * System V compatibility jobs updated to match new event names. + * rcS job now sets PREVLEVEL and RUNLEVEL. LP: #76304. + + * NOTE: After this upgrade, init will appear to have "forgotten" the + process ids of your gettys, etc. This is not a critical problem and + will be fixed before release. Shutdown will still work as normal. + + -- Scott James Remnant Mon, 12 Feb 2007 13:51:40 +0000 + +upstart (0.3.1-1) feisty; urgency=low + + * New upstream release: + - start, stop and status are now symlinks to initctl, not to a + different, separate utility. + - initctl completely rewritten to behave properly. + - some upstart-specific options to shutdown and reboot dropped, as + these are considered SysV-compat tools. + - "console none" fixed. LP: #70782. + - improved documentation. LP: #68805. + + * shutdown and reboot moved to upstart-compat-sysv. + + * Replace the /usr/share/doc/* directory in upstart-logd, + upstart-compat-sysv, system-services and startup-tasks with a symlink to + /usr/share/doc/upstart. This was actually done in a previous package, + but the migration missed. LP: #70895. + + -- Scott James Remnant Wed, 13 Dec 2006 17:27:37 +0000 + +upstart (0.2.7-7) edgy; urgency=low + + * Don't abort the postinst if we can't send init SIGTERM. Ubuntu: #64499. + + -- Scott James Remnant Tue, 10 Oct 2006 10:13:05 +0100 + +upstart (0.2.7-6) edgy; urgency=low + + * Don't start gettys on tty2 thru tty6 in runlevels 4 and 5 (matches + our sysvinit configuration). + * Migrate common changes made to /etc/inittab to /etc/event.d by + adjusting the installed conffiles. Ubuntu: #61539. + + * Include missing AUTHORS and NEWS file in the upstart package. + * Include README.Debian which answers common questions. Ubuntu: #60429. + + -- Scott James Remnant Thu, 5 Oct 2006 16:08:34 +0100 + +upstart (0.2.7-5) edgy; urgency=low + + * Don't set the current runlevel in /var/run/utmp to 0 or 6 if it is + already either of those two values. That way we don't end up with + either 0 or 6 in the PREVLEVEL variable, which can cause + /etc/init.d/rc to be "efficient" and not bother doing + anything. Ubuntu: #63852. + + -- Scott James Remnant Wed, 4 Oct 2006 14:06:18 +0100 + +upstart (0.2.7-4) edgy; urgency=low + + * Can't just start rc-default once in single-user mode, because if we + boot into that, that will just return us back to sulogin again. Copy + the script out of rc-default into rcS-sulogin to call telinit with the + right default runlevel. Ubuntu: #62189. + + * Add Build-Depend on dpkg-dev (>= 1.13.19) due to our use of + ${binary:Version}. Ubuntu: #61693. + + -- Scott James Remnant Tue, 26 Sep 2006 17:20:42 +0100 + +upstart (0.2.7-3) edgy; urgency=low + + * Set the runlevel to "S" when we enter sulogin so that it appears + in utmp. + + -- Scott James Remnant Thu, 21 Sep 2006 05:37:25 +0100 + +upstart (0.2.7-2) edgy; urgency=low + + * Ensure that the same version of upstart is installed as the version of + upstart-compat-sysv and upstart-logd; as the IPC protocol may change + between releases. + + * Adjust the rcS-sulogin job so that if sulogin exits the default runlevel + is entered; but if the job is stopped (e.g. by shutdown) it isn't. The + solves the regression introduced in the previous release. + + * Revert upstream logd/"quiet" change in favour of doing it in our + lsb logging functions instead; seems to work better (fsvo better). + + -- Scott James Remnant Thu, 21 Sep 2006 03:12:33 +0100 + +upstart (0.2.7-1) edgy; urgency=low + + * New upstream release: + - logd now writes to the console unless "quiet" is specified + - runaway jobs caught when they start rather than respawn. Ubuntu: #59807 + + * Fix failure to shutdown while in single-user mode, however this means + that for edgy you can't exit the sulogin shell to enter the default + runlevel; explicitly say what works. Ubuntu: #60626. + * Drop unnecessary dependency on util-linux. + * Drop sulogin hack, instead depend on the version of sysvutils that + includes the real one. Ubuntu: #60965. + + -- Scott James Remnant Wed, 20 Sep 2006 05:39:16 +0100 + +upstart (0.2.6-1) edgy; urgency=low + + * New upstream release: + - fix infinite loop caused by bad waitid() call. Ubuntu: #59459. + - halt now behaves as "shutdown -h now". Ubuntu: #59720. + + -- Scott James Remnant Wed, 13 Sep 2006 22:16:17 +0100 + +upstart (0.2.5-1) edgy; urgency=low + + * New upstream release: + - no longer spins when no stalled event handler. Ubuntu: #59170. + - shutdown works when under sysvinit. Ubuntu: #58523; + - shutdown -k implemented. Ubuntu: #58723. + - telinit sends shutdown event for 0, 1 and 6. Ubuntu: #58913. + - basic manual pages included. Ubuntu: #58724. + + * upstart-compat-sysv Replaces: sysvinit. Ubuntu: #59427. + * upstart Recommends: upstart-compat-sysv, startup-tasks & system-services. + + * New upstart-logd package includes the logd daemon that can will log + output of jobs with "console logged" (the default) in their description + to /var/log/boot. + + * Add /etc/event.d/rc0 that is run on the "halt" event (neither -H or -P + given), and modify rc0-halt to run on "system-halt" (-H given) and + rc0-poweroff to run on "power-off" (-P given). Ubuntu: #59134. + * Fix the control-alt-delete job to run on the "ctrlaltdel" event so + that it's triggered properly. Ubuntu: #59398. + * Fix single-user mode. + + -- Scott James Remnant Sat, 9 Sep 2006 05:10:12 +0100 + +upstart (0.2.1-7) edgy; urgency=low + + * Remove the Essential tags again, they didn't solve the problem we + hoped they would (dpkg/apt still won't remove sysvinit without + serious persuasion) and I don't think these packages should be. + + -- Scott James Remnant Thu, 7 Sep 2006 02:42:33 +0100 + +upstart (0.2.1-6) edgy; urgency=low + + * Make packages Essential, and change Depends to Pre-Depends so that the + packages work when unconfigured (nothing interesting is performed in + postinst). Ubuntu: #59005. + * Sync priority in debian/control with that in the archive (required) + * Drop warning of dire consequences if you install upstart, seeing as it's + installed by default. + + * Add new startup-tasks and system-services packages which will contain + the /etc/event.d files themselves (other than the main ones). + * Move tty definitions into system-services. + * Modify tty definitions to start when the rcS task has finished. This + puts them in the "right" place when compared to gdm. Ubuntu: #58630. + + * Correct rcS compatibility script to ignore any information in utmp so + that all scripts are always run. Ubuntu: #59203. + * Make rcS the console owner while it runs, temporary fix for + Ubuntu: #58609, #58794, #58796 + * Include default control-alt-delete handler that reboots the machine. + + -- Scott James Remnant Wed, 6 Sep 2006 21:52:48 +0100 + +upstart (0.2.1-5) edgy; urgency=low + + * upstart-compat-sysv Depends: initscripts (closes: Malone #58979). + + -- Colin Watson Tue, 5 Sep 2006 12:22:50 +0100 + +upstart (0.2.1-4) edgy; urgency=low + + * Add missing #! line to top of postrm + + -- Scott James Remnant Mon, 4 Sep 2006 08:11:16 +0100 + +upstart (0.2.1-3) edgy; urgency=low + + * Remove the rc0 configuration file shipped in 0.1.0 that causes all + reboots to become shutdowns. Ubuntu: #58557. + + -- Scott James Remnant Sun, 3 Sep 2006 23:24:41 +0100 + +upstart (0.2.1-2) edgy; urgency=low + + * Don't send the SIGTERM signal unless we're upgrading from a version + of upstart that supports re-exec; older versions would cause a kernel + PANIC and change from sysvinit does nothing. + + -- Scott James Remnant Sat, 2 Sep 2006 17:18:38 +0100 + +upstart (0.2.1-1) edgy; urgency=low + + * New upstream release: + - compilation fixes. + + -- Scott James Remnant Fri, 1 Sep 2006 19:51:41 +0100 + +upstart (0.2.0-1) edgy; urgency=low + + * New upstream release: + - upstart includes shutdown, reboot, halt, poweroff, start, stop, status, + runlevel and telinit utilities. + - "initctl list" will list active jobs. + - Events vastly simplified to just simple strings. + + * Compatibility tasks for old rc scripts, along with runlevel and telinit + utilities now shipped in upstart-compat-sysv package. + + -- Scott James Remnant Fri, 1 Sep 2006 02:38:44 +0100 + +upstart (0.1.1-1) edgy; urgency=low + + * New upstream release: + - set PATH and TERM in processes + + -- Scott James Remnant Fri, 25 Aug 2006 16:17:52 +0200 + +upstart (0.1.0-2) edgy; urgency=low + + * Oops, rename /sbin/init to /sbin/upstart as documented. Lost this + while battling bzr. + + -- Scott James Remnant Thu, 24 Aug 2006 16:30:54 +0200 + +upstart (0.1.0-1) edgy; urgency=low + + * Initial release. + + -- Scott James Remnant Thu, 24 Aug 2006 14:27:47 +0200 --- upstart-0.3.9.orig/debian/upstart-compat-sysv.dirs +++ upstart-0.3.9/debian/upstart-compat-sysv.dirs @@ -0,0 +1,2 @@ +etc/event.d +usr/share/doc --- upstart-0.3.9.orig/debian/system-services.postinst +++ upstart-0.3.9/debian/system-services.postinst @@ -0,0 +1,46 @@ +#!/bin/sh -e +# This script can be called in the following ways: +# +# After the package was installed: +# configure +# +# +# If prerm fails during upgrade or fails on failed upgrade: +# abort-upgrade +# +# If prerm fails during deconfiguration of a package: +# abort-deconfigure in-favour +# removing +# +# If prerm fails during replacement due to conflict: +# abort-remove in-favour + + +# Migrate changes to /etc/inittab to /etc/event.d +migrate_inittab() +{ + if [ -f /etc/inittab ]; then + /usr/lib/upstart/migrate-inittab.pl + fi +} + + +case "$1" in + configure) + # On new installation, migrate /etc/inittab + if [ -z "$2" ]; then + migrate_inittab + fi + ;; + + abort-upgrade|abort-deconfigure|abort-remove) + ;; + + *) + echo "$0 called with unknown argument \`$1'" 1>&2 + exit 1 + ;; +esac + +#DEBHELPER# +exit 0 --- upstart-0.3.9.orig/debian/upstart-compat-sysv.postinst +++ upstart-0.3.9/debian/upstart-compat-sysv.postinst @@ -0,0 +1,57 @@ +#!/bin/sh -e +# This script can be called in the following ways: +# +# After the package was installed: +# configure +# +# +# If prerm fails during upgrade or fails on failed upgrade: +# abort-upgrade +# +# If prerm fails during deconfiguration of a package: +# abort-deconfigure in-favour +# removing +# +# If prerm fails during replacement due to conflict: +# abort-remove in-favour + + +# Remove a no-longer used conffile +rm_conffile() +{ + CONFFILE="$1" + + if [ -e "$CONFFILE".dpkg-obsolete ]; then + echo "Removing obsolete conffile $CONFFILE" + rm -f "$CONFFILE".dpkg-obsolete + fi +} + + +# Remove obsolete jobs +rm_obsolete_jobs() +{ + rm_conffile /etc/event.d/rc0-halt + rm_conffile /etc/event.d/rc0-poweroff +} + + +case "$1" in + configure) + # Upgrade from edgy + if dpkg --compare-versions "$2" lt "0.3.5-1"; then + rm_obsolete_jobs + fi + ;; + + abort-upgrade|abort-deconfigure|abort-remove) + ;; + + *) + echo "$0 called with unknown argument \`$1'" 1>&2 + exit 1 + ;; +esac + +#DEBHELPER# +exit 0 --- upstart-0.3.9.orig/debian/upstart.dirs +++ upstart-0.3.9/debian/upstart.dirs @@ -0,0 +1 @@ +etc/event.d --- upstart-0.3.9.orig/debian/compat +++ upstart-0.3.9/debian/compat @@ -0,0 +1 @@ +5 --- upstart-0.3.9.orig/debian/control +++ upstart-0.3.9/debian/control @@ -0,0 +1,49 @@ +Source: upstart +Section: base +Priority: required +Maintainer: Scott James Remnant +Standards-Version: 3.7.2.1 +Build-Depends: debhelper (>= 5.0), dpkg-dev (>= 1.13.19) +Vcs-Bzr: http://bazaar.launchpad.net/~scott/upstart/ubuntu + +Package: upstart +Architecture: any +Pre-Depends: ${shlibs:Depends}, sysvutils (>= 2.86.ds1-14.1ubuntu11) +Recommends: upstart-compat-sysv, upstart-logd, startup-tasks, system-services +Conflicts: sysvinit +Replaces: sysvinit +Description: event-based init daemon + upstart is a replacement for the /sbin/init daemon which handles + starting of tasks and services during boot, stopping them during + shutdown and supervising them while the system is running. + +Package: upstart-compat-sysv +Architecture: any +Depends: ${shlibs:Depends}, upstart (= ${binary:Version}), sysvutils (>= 2.86.ds1-14.1ubuntu11), sysv-rc, initscripts +Replaces: upstart (<< 0.3.1-1), sysvinit +Description: compatibility for System-V-like init + This package contains compatibility tasks and utilities that emulate + the behaviour of the original sysvinit package, including runlevels, + and ensures that the initscripts in /etc/rc*.d are still run. + +Package: upstart-logd +Architecture: any +Depends: ${shlibs:Depends}, upstart (= ${binary:Version}) +Description: boot logging daemon + This package contains the logd daemon used by /sbin/init to log output + of jobs started with "console logged" in their definitions. + +Package: startup-tasks +Architecture: any +Depends: upstart (>= 0.2.0) +Description: definitions of essential tasks to run on startup + This package contains the definitions of tasks essential for normal + startup of a Linux system. + +Package: system-services +Architecture: any +Depends: upstart (>= 0.2.0), upstart-compat-sysv +Replaces: upstart (<< 0.2.1-6) +Description: definitions of essential system services + This package contains the definitions of services essential for the + normal operation of a Linux system. --- upstart-0.3.9.orig/debian/migrate-inittab.pl +++ upstart-0.3.9/debian/migrate-inittab.pl @@ -0,0 +1,143 @@ +#!/usr/bin/perl + +use strict; +use warnings; + +my %gettys; +my $have_cad = 0; + + +#-----------------------------------------------------------------------------# +# Parse /etc/inittab +#-----------------------------------------------------------------------------# + +open INITTAB, "/etc/inittab" + or die "Unable to open /etc/inittab: $!"; + +while () { + chomp; + s/^\s*//; + + next if /^\#/; + next unless length; + + my ($id, $rlevel, $action, $process) = split /:/, $_, 4; + + warn "missing id field" and next + unless defined $id and length $id; + warn "missing runlevel field" and next + unless defined $rlevel; + warn "missing action field" and next + unless defined $action and length $action; + warn "missing process field" and next + unless defined $process; + + + $have_cad = 1 if $action eq "ctrlaltdel"; + $gettys{$1} = [ $rlevel, $process ] if $process =~ /getty.*\b(tty\w+)/; +} + +close INITTAB + or warn "Error while closing /etc/inittab: $!"; + + +#-----------------------------------------------------------------------------# +# Alter /etc/event.d +#-----------------------------------------------------------------------------# + +unlink "/etc/event.d/control-alt-delete" + unless $have_cad; + +foreach (qw/tty1 tty2 tty3 tty4 tty5 tty6/) { + unlink "/etc/event.d/$_" + unless exists $gettys{$_}; +} + +foreach (sort keys %gettys) { + my ($rlevel, $process) = @{$gettys{$_}}; + + my @job; + if (-f "/etc/event.d/$_") { + open JOB, "/etc/event.d/$_" + or warn "Unable to open /etc/event.d/$_: $!" and next; + @job = ; + chomp @job; + close JOB + or warn "Error while closing /etc/event,d/$_: $!" and next; + + foreach my $rl (qw/2 3 4 5/) { + my $idx; + for ($idx = 0; $idx < @job; $idx++) { + last if $job[$idx] =~ /^\s*(start|stop)\s+on\s+runlevel\s+$rl\b/; + } + + if ($idx < @job) { + if ($rlevel =~ /$rl/) { + $job[$idx] =~ s/^(\s*)stop(\s+)/$1start$2/; + } else { + $job[$idx] =~ s/^(\s*)start(\s+)/$1stop$2/; + } + } else { + if ($rlevel =~ /$rl/) { + push @job, "start on runlevel $rl"; + } else { + push @job, "stop on runlevel $rl"; + } + } + } + + my $idx; + for ($idx = 0; $idx < @job; $idx++) { + last if $job[$idx] =~ /^\s*respawn\s*/; # match bare 'respawn' too + } + + if ($idx < @job) { + # only match old-style 'respawn process', not bare 'respawn' + $job[$idx] =~ s/^(\s*respawn\s+).*/$1$process/; + } else { + push @job, "respawn"; + push @job, "exec $process"; + } + + # Try to fix up effects of previous broken migrations + if (@job and $job[$#job] =~ /.*(.+?)exec (\1)$/) { + $job[$#job] = "exec $1"; + } + + } else { + push @job, "# $_ - getty"; + push @job, "#"; + push @job, "# Converted from /etc/inittab entry"; + push @job, ""; + + foreach my $rl (qw/2 3 4 5/) { + if ($rlevel =~ /$rl/) { + push @job, "start on runlevel $rl"; + } else { + push @job, "stop on runlevel $rl"; + } + } + push @job, ""; + + push @job, "stop on shutdown"; + push @job, ""; + + push @job, "respawn"; + push @job, "exec $process"; + } + + open JOB, ">/etc/event.d/.$_" + or warn "Unable to write to /etc/event.d/.$_: $!" and next; + print JOB map { "$_\n" } @job; + unless (close JOB) { + warn "Error while closing /etc/event.d/.$_: $!"; + unlink "/etc/event.d/.$_"; + next; + } + + unless (rename "/etc/event.d/.$_", "/etc/event.d/$_") { + warn "Unable to replace /etc/event.d/$_: $!"; + unlink "/etc/event.d/.$_"; + next; + } +} --- upstart-0.3.9.orig/debian/upstart.postinst +++ upstart-0.3.9/debian/upstart.postinst @@ -0,0 +1,44 @@ +#!/bin/sh -e +# This script can be called in the following ways: +# +# After the package was installed: +# configure +# +# +# If prerm fails during upgrade or fails on failed upgrade: +# abort-upgrade +# +# If prerm fails during deconfiguration of a package: +# abort-deconfigure in-favour +# removing +# +# If prerm fails during replacement due to conflict: +# abort-remove in-favour + + +# Tell init to re-exec itself +reexec_init() +{ + kill 1 || true +} + + +case "$1" in + configure) + # On upgrade from a capable upstart version, tell it to re-exec + if dpkg --compare-versions "$2" ge "0.2.0-1"; then + reexec_init + fi + ;; + + abort-upgrade|abort-deconfigure|abort-remove) + ;; + + *) + echo "$0 called with unknown argument \`$1'" 1>&2 + exit 1 + ;; +esac + +#DEBHELPER# +exit 0 --- upstart-0.3.9.orig/debian/upstart-compat-sysv.postrm +++ upstart-0.3.9/debian/upstart-compat-sysv.postrm @@ -0,0 +1,96 @@ +#!/bin/sh -e +# This script can be called in the following ways: +# +# After the package was removed: +# remove +# +# After the package was purged: +# purge +# +# After the package was upgraded: +# upgrade +# if that fails: +# failed-upgrade +# +# +# After all of the packages files have been replaced: +# disappear +# +# +# If preinst fails during install: +# abort-install +# +# If preinst fails during upgrade of removed package: +# abort-install +# +# If preinst fails during upgrade: +# abort-upgrade + + +# Undo removal of a no-longer used conffile +undo_rm_conffile() +{ + CONFFILE="$1" + + if [ ! -e "$CONFFILE" ]; then + if [ -e "$CONFFILE".dpkg-bak ]; then + echo "Restoring modified conffile $CONFFILE" + mv -f "$CONFFILE".dpkg-bak "$CONFFILE" + elif [ -e "$CONFFILE".dpkg-obsolete ]; then + mv -f "$CONFFILE".dpkg-obsolete "$CONFFILE" + fi + fi +} + +# Finish removal of a no-longer used conffile +finish_rm_conffile() +{ + CONFFILE="$1" + + if [ -e "$CONFFILE".dpkg-bak ]; then + rm -f "$CONFFILE".dpkg-bak + fi +} + + +# Undo removal of obsolete jobs +undo_rm_obsolete_jobs() +{ + undo_rm_conffile /etc/event.d/rc0-halt + undo_rm_conffile /etc/event.d/rc0-poweroff +} + +# Finish removal of obsolete jobs +finish_rm_obsolete_jobs() +{ + finish_rm_conffile /etc/event.d/rc0-halt + finish_rm_conffile /etc/event.d/rc0-poweroff +} + + +case "$1" in + remove) + ;; + + purge) + finish_rm_obsolete_jobs + ;; + + upgrade|failed-upgrade|disappear) + ;; + + abort-install|abort-upgrade) + # Abort upgrade from edgy + if dpkg --compare-versions "$2" lt "0.3.5-1"; then + undo_rm_obsolete_jobs + fi + ;; + + *) + echo "$0 called with unknown argument \`$1'" 1>&2 + exit 1 + ;; +esac + +#DEBHELPER# +exit 0 --- upstart-0.3.9.orig/debian/upstart-compat-sysv.install +++ upstart-0.3.9/debian/upstart-compat-sysv.install @@ -0,0 +1,12 @@ +sbin/reboot +sbin/runlevel +sbin/shutdown +sbin/telinit +sbin/halt +sbin/poweroff +usr/share/man/man8/reboot.8 +usr/share/man/man8/runlevel.8 +usr/share/man/man8/shutdown.8 +usr/share/man/man8/telinit.8 +usr/share/man/man8/halt.8 +usr/share/man/man8/poweroff.8 --- upstart-0.3.9.orig/debian/upstart.install +++ upstart-0.3.9/debian/upstart.install @@ -0,0 +1,10 @@ +sbin/init +sbin/initctl +sbin/start +sbin/stop +sbin/status +usr/share/man/man8/init.8 +usr/share/man/man8/initctl.8 +usr/share/man/man8/start.8 +usr/share/man/man8/stop.8 +usr/share/man/man8/status.8 --- upstart-0.3.9.orig/debian/system-services.preinst +++ upstart-0.3.9/debian/system-services.preinst @@ -0,0 +1,51 @@ +#!/bin/sh -e +# This script can be called in the following ways: +# +# Before the package is installed: +# install +# +# Before removed package is upgraded: +# install +# +# Before the package is upgraded: +# upgrade +# +# +# If postrm fails during upgrade or fails on failed upgrade: +# abort-upgrade + + +# Replace the documentation directory with a symlink to the common one. +replace_doc_dir() +{ + DOCDIR="/usr/share/doc/system-services" + + if [ -d "$DOCDIR" ] && [ ! -L "$DOCDIR" ]; then + rm -rf "$DOCDIR" + ln -sf "upstart" "$DOCDIR" + fi +} + + +case "$1" in + install) + ;; + + upgrade) + # Upgrade from edgy + if dpkg --compare-versions "$2" lt "0.3.1-1"; then + replace_doc_dir + fi + ;; + + abort-upgrade) + ;; + + *) + echo "$0 called with unknown argument \`$1'" 1>&2 + exit 1 + ;; +esac + +#DEBHELPER# +exit 0 --- upstart-0.3.9.orig/debian/event.d/upstart-compat-sysv/rc2 +++ upstart-0.3.9/debian/event.d/upstart-compat-sysv/rc2 @@ -0,0 +1,20 @@ +# rc2 - runlevel 2 compatibility +# +# This task runs the old sysv-rc runlevel 2 ("multi-user") scripts. It +# is usually started by the telinit compatibility wrapper. + +start on runlevel 2 + +stop on runlevel [!2] + +console output +script + set $(runlevel --set 2 || true) + if [ "$1" != "unknown" ]; then + PREVLEVEL=$1 + RUNLEVEL=$2 + export PREVLEVEL RUNLEVEL + fi + + exec /etc/init.d/rc 2 +end script --- upstart-0.3.9.orig/debian/event.d/upstart-compat-sysv/rc4 +++ upstart-0.3.9/debian/event.d/upstart-compat-sysv/rc4 @@ -0,0 +1,20 @@ +# rc4 - runlevel 4 compatibility +# +# This task runs the old sysv-rc runlevel 4 (user defined) scripts. It +# is usually started by the telinit compatibility wrapper. + +start on runlevel 4 + +stop on runlevel [!4] + +console output +script + set $(runlevel --set 4 || true) + if [ "$1" != "unknown" ]; then + PREVLEVEL=$1 + RUNLEVEL=$2 + export PREVLEVEL RUNLEVEL + fi + + exec /etc/init.d/rc 4 +end script --- upstart-0.3.9.orig/debian/event.d/upstart-compat-sysv/rc1 +++ upstart-0.3.9/debian/event.d/upstart-compat-sysv/rc1 @@ -0,0 +1,19 @@ +# rc1 - runlevel 1 compatibility +# +# This task runs the old sysv-rc runlevel 1 ("single-user") scripts. + +start on runlevel 1 + +stop on runlevel [!1] + +console output +script + set $(runlevel --set 1 || true) + if [ "$1" != "unknown" ]; then + PREVLEVEL=$1 + RUNLEVEL=$2 + export PREVLEVEL RUNLEVEL + fi + + exec /etc/init.d/rc 1 +end script --- upstart-0.3.9.orig/debian/event.d/upstart-compat-sysv/rc0 +++ upstart-0.3.9/debian/event.d/upstart-compat-sysv/rc0 @@ -0,0 +1,25 @@ +# rc0 - runlevel 0 compatibility +# +# This task runs the old sysv-rc runlevel 0 ("halt/poweroff") scripts with +# the decision as to whether to halt or power off the system left up to the +# script (and thus /etc/default/poweroff). + +start on runlevel 0 + +stop on runlevel [!0] + +console output +script + set $(runlevel || true) + if [ "$2" != "0" ] && [ "$2" != "6" ]; then + set $(runlevel --set 0 || true) + fi + + if [ "$1" != "unknown" ]; then + PREVLEVEL=$1 + RUNLEVEL=$2 + export PREVLEVEL RUNLEVEL + fi + + exec /etc/init.d/rc 0 +end script --- upstart-0.3.9.orig/debian/event.d/upstart-compat-sysv/rcS +++ upstart-0.3.9/debian/event.d/upstart-compat-sysv/rcS @@ -0,0 +1,20 @@ +# rcS - runlevel compatibility +# +# This task runs the old sysv-rc startup scripts. + +start on startup + +stop on runlevel + +# Note: there can be no previous runlevel here, if we have one it's bad +# information (we enter rc1 not rcS for maintenance). +console output +script + runlevel --set S >/dev/null || true + + PREVLEVEL=N + RUNLEVEL=S + export PREVLEVEL RUNLEVEL + + exec /etc/init.d/rcS +end script --- upstart-0.3.9.orig/debian/event.d/upstart-compat-sysv/rc5 +++ upstart-0.3.9/debian/event.d/upstart-compat-sysv/rc5 @@ -0,0 +1,20 @@ +# rc5 - runlevel 5 compatibility +# +# This task runs the old sysv-rc runlevel 5 (user defined) scripts. It +# is usually started by the telinit compatibility wrapper. + +start on runlevel 5 + +stop on runlevel [!5] + +console output +script + set $(runlevel --set 5 || true) + if [ "$1" != "unknown" ]; then + PREVLEVEL=$1 + RUNLEVEL=$2 + export PREVLEVEL RUNLEVEL + fi + + exec /etc/init.d/rc 5 +end script --- upstart-0.3.9.orig/debian/event.d/upstart-compat-sysv/rc6 +++ upstart-0.3.9/debian/event.d/upstart-compat-sysv/rc6 @@ -0,0 +1,23 @@ +# rc6 - runlevel 6 compatibility +# +# This task runs the old sysv-rc runlevel 6 ("reboot") scripts. + +start on runlevel 6 + +stop on runlevel [!6] + +console output +script + set $(runlevel || true) + if [ "$2" != "0" ] && [ "$2" != "6" ]; then + set $(runlevel --set 6 || true) + fi + + if [ "$1" != "unknown" ]; then + PREVLEVEL=$1 + RUNLEVEL=$2 + export PREVLEVEL RUNLEVEL + fi + + exec /etc/init.d/rc 6 +end script --- upstart-0.3.9.orig/debian/event.d/upstart-compat-sysv/rc-default +++ upstart-0.3.9/debian/event.d/upstart-compat-sysv/rc-default @@ -0,0 +1,23 @@ +# rc - runlevel compatibility +# +# This task guesses what the "default runlevel" should be and starts the +# appropriate script. + +start on stopped rcS + +script + runlevel --reboot || true + + if grep -q -w -- "-s\|single\|S" /proc/cmdline; then + telinit S + elif [ -r /etc/inittab ]; then + RL="$(sed -n -e "/^id:[0-9]*:initdefault:/{s/^id://;s/:.*//;p}" /etc/inittab || true)" + if [ -n "$RL" ]; then + telinit $RL + else + telinit 2 + fi + else + telinit 2 + fi +end script --- upstart-0.3.9.orig/debian/event.d/upstart-compat-sysv/rcS-sulogin +++ upstart-0.3.9/debian/event.d/upstart-compat-sysv/rcS-sulogin @@ -0,0 +1,28 @@ +# rcS-sulogin - "single-user" runlevel compatibility +# +# This task runs the sulogin binary during "single-user" mode. + +start on runlevel S + +stop on runlevel + +console owner +script + runlevel --set S >/dev/null || true + if [ -x /usr/share/recovery-mode/recovery-menu ]; then + /usr/share/recovery-mode/recovery-menu + else + /sbin/sulogin + fi + + if [ -r /etc/inittab ]; then + RL="$(sed -n -e "/^id:[0-9]*:initdefault:/{s/^id://;s/:.*//;p}" /etc/inittab || true)" + if [ -n "$RL" ]; then + telinit $RL + else + telinit 2 + fi + else + telinit 2 + fi +end script --- upstart-0.3.9.orig/debian/event.d/upstart-compat-sysv/rc3 +++ upstart-0.3.9/debian/event.d/upstart-compat-sysv/rc3 @@ -0,0 +1,20 @@ +# rc3 - runlevel 3 compatibility +# +# This task runs the old sysv-rc runlevel 3 (user defined) scripts. It +# is usually started by the telinit compatibility wrapper. + +start on runlevel 3 + +stop on runlevel [!3] + +console output +script + set $(runlevel --set 3 || true) + if [ "$1" != "unknown" ]; then + PREVLEVEL=$1 + RUNLEVEL=$2 + export PREVLEVEL RUNLEVEL + fi + + exec /etc/init.d/rc 3 +end script --- upstart-0.3.9.orig/debian/event.d/upstart/control-alt-delete +++ upstart-0.3.9/debian/event.d/upstart/control-alt-delete @@ -0,0 +1,8 @@ +# control-alt-delete - emergency keypress handling +# +# This task is run whenever the Control-Alt-Delete key combination is +# pressed. Usually used to shut down the machine. + +start on control-alt-delete + +exec /sbin/shutdown -r now "Control-Alt-Delete pressed" --- upstart-0.3.9.orig/debian/event.d/upstart/sulogin +++ upstart-0.3.9/debian/event.d/upstart/sulogin @@ -0,0 +1,20 @@ +# sulogin - rescue mode +# +# This task ensures that should the system fail to have any active jobs +# that the system administrator can rescue it; by giving them a shell. + +# Disabled since this would get started when init is re-exec'd, and +# "console owner" kills X. +# start on stalled + +exec /sbin/sulogin +console owner + +pre-start script + echo + echo "The system has reached a state where there are no jobs running." + echo "A shell will be spawned so that you may start such jobs that are" + echo "necessary." + echo + echo "Type 'exit' when finished." +end script --- upstart-0.3.9.orig/debian/event.d/system-services/tty2 +++ upstart-0.3.9/debian/event.d/system-services/tty2 @@ -0,0 +1,16 @@ +# tty2 - getty +# +# This service maintains a getty on tty2 from the point the system is +# started until it is shut down again. + +start on runlevel 2 +start on runlevel 3 + +stop on runlevel 0 +stop on runlevel 1 +stop on runlevel 4 +stop on runlevel 5 +stop on runlevel 6 + +respawn +exec /sbin/getty 38400 tty2 --- upstart-0.3.9.orig/debian/event.d/system-services/tty5 +++ upstart-0.3.9/debian/event.d/system-services/tty5 @@ -0,0 +1,16 @@ +# tty5 - getty +# +# This service maintains a getty on tty5 from the point the system is +# started until it is shut down again. + +start on runlevel 2 +start on runlevel 3 + +stop on runlevel 0 +stop on runlevel 1 +stop on runlevel 4 +stop on runlevel 5 +stop on runlevel 6 + +respawn +exec /sbin/getty 38400 tty5 --- upstart-0.3.9.orig/debian/event.d/system-services/tty1 +++ upstart-0.3.9/debian/event.d/system-services/tty1 @@ -0,0 +1,16 @@ +# tty1 - getty +# +# This service maintains a getty on tty1 from the point the system is +# started until it is shut down again. + +start on stopped rc2 +start on stopped rc3 +start on stopped rc4 +start on stopped rc5 + +stop on runlevel 0 +stop on runlevel 1 +stop on runlevel 6 + +respawn +exec /sbin/getty 38400 tty1 --- upstart-0.3.9.orig/debian/event.d/system-services/tty4 +++ upstart-0.3.9/debian/event.d/system-services/tty4 @@ -0,0 +1,16 @@ +# tty4 - getty +# +# This service maintains a getty on tty4 from the point the system is +# started until it is shut down again. + +start on runlevel 2 +start on runlevel 3 + +stop on runlevel 0 +stop on runlevel 1 +stop on runlevel 4 +stop on runlevel 5 +stop on runlevel 6 + +respawn +exec /sbin/getty 38400 tty4 --- upstart-0.3.9.orig/debian/event.d/system-services/tty3 +++ upstart-0.3.9/debian/event.d/system-services/tty3 @@ -0,0 +1,16 @@ +# tty3 - getty +# +# This service maintains a getty on tty3 from the point the system is +# started until it is shut down again. + +start on runlevel 2 +start on runlevel 3 + +stop on runlevel 0 +stop on runlevel 1 +stop on runlevel 4 +stop on runlevel 5 +stop on runlevel 6 + +respawn +exec /sbin/getty 38400 tty3 --- upstart-0.3.9.orig/debian/event.d/system-services/tty6 +++ upstart-0.3.9/debian/event.d/system-services/tty6 @@ -0,0 +1,16 @@ +# tty6 - getty +# +# This service maintains a getty on tty6 from the point the system is +# started until it is shut down again. + +start on runlevel 2 +start on runlevel 3 + +stop on runlevel 0 +stop on runlevel 1 +stop on runlevel 4 +stop on runlevel 5 +stop on runlevel 6 + +respawn +exec /sbin/getty 38400 tty6 --- upstart-0.3.9.orig/debian/startup-tasks.dirs +++ upstart-0.3.9/debian/startup-tasks.dirs @@ -0,0 +1,2 @@ +etc/event.d +usr/share/doc --- upstart-0.3.9.orig/debian/rules +++ upstart-0.3.9/debian/rules @@ -0,0 +1,120 @@ +#!/usr/bin/make -f +# debian/rules for the upstart package. +# Author: Scott James Remnant + +# Uncomment this to turn on verbose mode. +#export DH_VERBOSE=1 + +export DH_OPTIONS + +CFLAGS = -Wall -g -fstack-protector -fPIE +LDFLAGS = -Wl,-z,relro -Wl,-z,now -pie + +# Disable optimisations if noopt found in $DEB_BUILD_OPTIONS +ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS))) + CFLAGS += -O0 + LDFLAGS += -Wl,-O0 +else + CFLAGS += -Os + LDFLAGS += -Wl,-O1 +endif + +# These are used for cross-compiling and for saving the configure script +# from having to guess our platform (since we know it already) +DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE) +DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE) + +ifeq ($(DEB_BUILD_GNU_TYPE), $(DEB_HOST_GNU_TYPE)) + confflags += --build=$(DEB_HOST_GNU_TYPE) +else + confflags += --build=$(DEB_BUILD_GNU_TYPE) --host=$(DEB_HOST_GNU_TYPE) +endif + + +# Run the package configure script +config.status: configure + ./configure $(confflags) CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" \ + --prefix=/usr \ + --exec-prefix=/ \ + --sysconfdir=/etc \ + --localstatedir=/var/lib \ + --mandir=\$${datadir}/man \ + --infodir=\$${datadir}/info \ + --enable-compat=sysv + + +# Build the package +build: build-stamp +build-stamp: config.status + dh_testdir + + $(MAKE) + $(MAKE) check || true + touch $@ + +# Install the package underneath debian/tmp +install: build + dh_testdir + dh_testroot + dh_clean -k + dh_installdirs + + $(MAKE) DESTDIR="$(CURDIR)/debian/tmp" install + + # Copy across the default jobs + @set -x; for pkg in upstart upstart-compat-sysv system-services; do \ + for job in debian/event.d/$$pkg/*; do \ + install -m 644 -o root -g root $$job \ + debian/$$pkg/etc/event.d || exit 1; \ + done; \ + done + + # Copy the migration script + install -m 755 -o root -g root debian/migrate-inittab.pl \ + debian/system-services/usr/lib/upstart + + +binary: binary-indep binary-arch + +# Build architecture-independent files here. +binary-indep: +# We have nothing to do by default. + +# Build architecture-dependent files here. +binary-arch: DH_OPTIONS=-a +binary-arch: build install + dh_testdir + dh_testroot + dh_installchangelogs ChangeLog + dh_installdocs + + install -m 644 -o root -g root ChangeLog.nih \ + debian/upstart/usr/share/doc/upstart/changelog.nih + + @set -x; for pkg in upstart-logd upstart-compat-sysv system-services startup-tasks; do \ + rm -rf debian/$$pkg/usr/share/doc/$$pkg; \ + ln -sf upstart debian/$$pkg/usr/share/doc/$$pkg; \ + done + + dh_install --sourcedir=debian/tmp + dh_link + dh_strip + dh_compress + dh_fixperms + dh_installdeb + dh_shlibdeps + dh_gencontrol + dh_md5sums + dh_builddeb + + +# Clean up the mess we made +clean: + dh_testdir + rm -f build-stamp + + -$(MAKE) clean distclean + dh_clean + + +.PHONY: build install binary-indep binary-arch binary clean --- upstart-0.3.9.orig/debian/startup-tasks.preinst +++ upstart-0.3.9/debian/startup-tasks.preinst @@ -0,0 +1,51 @@ +#!/bin/sh -e +# This script can be called in the following ways: +# +# Before the package is installed: +# install +# +# Before removed package is upgraded: +# install +# +# Before the package is upgraded: +# upgrade +# +# +# If postrm fails during upgrade or fails on failed upgrade: +# abort-upgrade + + +# Replace the documentation directory with a symlink to the common one. +replace_doc_dir() +{ + DOCDIR="/usr/share/doc/startup-tasks" + + if [ -d "$DOCDIR" ] && [ ! -L "$DOCDIR" ]; then + rm -rf "$DOCDIR" + ln -sf "upstart" "$DOCDIR" + fi +} + + +case "$1" in + install) + ;; + + upgrade) + # Upgrade from edgy + if dpkg --compare-versions "$2" lt "0.3.1-1"; then + replace_doc_dir + fi + ;; + + abort-upgrade) + ;; + + *) + echo "$0 called with unknown argument \`$1'" 1>&2 + exit 1 + ;; +esac + +#DEBHELPER# +exit 0 --- upstart-0.3.9.orig/debian/upstart-logd.install +++ upstart-0.3.9/debian/upstart-logd.install @@ -0,0 +1,3 @@ +sbin/logd +etc/event.d/logd +usr/share/man/man8/logd.8 --- upstart-0.3.9.orig/debian/upstart-logd.preinst +++ upstart-0.3.9/debian/upstart-logd.preinst @@ -0,0 +1,51 @@ +#!/bin/sh -e +# This script can be called in the following ways: +# +# Before the package is installed: +# install +# +# Before removed package is upgraded: +# install +# +# Before the package is upgraded: +# upgrade +# +# +# If postrm fails during upgrade or fails on failed upgrade: +# abort-upgrade + + +# Replace the documentation directory with a symlink to the common one. +replace_doc_dir() +{ + DOCDIR="/usr/share/doc/upstart-logd" + + if [ -d "$DOCDIR" ] && [ ! -L "$DOCDIR" ]; then + rm -rf "$DOCDIR" + ln -sf "upstart" "$DOCDIR" + fi +} + + +case "$1" in + install) + ;; + + upgrade) + # Upgrade from edgy + if dpkg --compare-versions "$2" lt "0.3.1-1"; then + replace_doc_dir + fi + ;; + + abort-upgrade) + ;; + + *) + echo "$0 called with unknown argument \`$1'" 1>&2 + exit 1 + ;; +esac + +#DEBHELPER# +exit 0 --- upstart-0.3.9.orig/debian/upstart-compat-sysv.preinst +++ upstart-0.3.9/debian/upstart-compat-sysv.preinst @@ -0,0 +1,77 @@ +#!/bin/sh -e +# This script can be called in the following ways: +# +# Before the package is installed: +# install +# +# Before removed package is upgraded: +# install +# +# Before the package is upgraded: +# upgrade +# +# +# If postrm fails during upgrade or fails on failed upgrade: +# abort-upgrade + + +# Prepare to remove a no-longer used conffile +prep_rm_conffile() +{ + CONFFILE="$1" + + if [ -e "$CONFFILE" ]; then + md5sum="`md5sum \"$CONFFILE\" | sed -e \"s/ .*//\"`" + old_md5sum="`sed -n -e \"/^Conffiles:/,/^[^ ]/{\\\\' $CONFFILE '{s/ obsolete$//;s/.* //;p}}\" /var/lib/dpkg/status`" + if [ "$md5sum" != "$old_md5sum" ]; then + echo "Obsolete conffile $CONFFILE has been modified by you, renaming to .dpkg-bak" + mv -f "$CONFFILE" "$CONFFILE".dpkg-bak + else + mv -f "$CONFFILE" "$CONFFILE".dpkg-obsolete + fi + fi +} + + +# Replace the documentation directory with a symlink to the common one. +replace_doc_dir() +{ + DOCDIR="/usr/share/doc/upstart-compat-sysv" + + if [ -d "$DOCDIR" ] && [ ! -L "$DOCDIR" ]; then + rm -rf "$DOCDIR" + ln -sf "upstart" "$DOCDIR" + fi +} + +# Prepare to remove obsolete jobs +prep_rm_obsolete_jobs() +{ + prep_rm_conffile /etc/event.d/rc0-halt + prep_rm_conffile /etc/event.d/rc0-poweroff +} + + +case "$1" in + install) + ;; + + upgrade) + # Upgrade from edgy + if dpkg --compare-versions "$2" lt "0.3.5-1"; then + replace_doc_dir + prep_rm_obsolete_jobs + fi + ;; + + abort-upgrade) + ;; + + *) + echo "$0 called with unknown argument \`$1'" 1>&2 + exit 1 + ;; +esac + +#DEBHELPER# +exit 0 --- upstart-0.3.9.orig/upstart/wire.c +++ upstart-0.3.9/upstart/wire.c @@ -26,6 +26,7 @@ #include +#include #include #include --- upstart-0.3.9.orig/upstart/Makefile.am +++ upstart-0.3.9/upstart/Makefile.am @@ -15,7 +15,7 @@ libupstart_la_LDFLAGS = \ - -version-info 0:0:0 + -static -version-info 0:0:0 if HAVE_VERSION_SCRIPT_ARG libupstart_la_LDFLAGS += @VERSION_SCRIPT_ARG@=$(srcdir)/libupstart.ver endif --- upstart-0.3.9.orig/upstart/Makefile.in +++ upstart-0.3.9/upstart/Makefile.in @@ -281,7 +281,7 @@ message.c \ wire.c -libupstart_la_LDFLAGS = -version-info 0:0:0 $(am__append_1) +libupstart_la_LDFLAGS = -static -version-info 0:0:0 $(am__append_1) libupstart_la_LIBADD = \ ../nih/libnih.la \ $(LTLIBINTL) --- upstart-0.3.9.orig/nih/Makefile.am +++ upstart-0.3.9/nih/Makefile.am @@ -29,7 +29,7 @@ libnih_la_LDFLAGS = \ - -version-info 0:0:0 + -static -version-info 0:0:0 if HAVE_VERSION_SCRIPT_ARG libnih_la_LDFLAGS += @VERSION_SCRIPT_ARG@=$(srcdir)/libnih.ver endif --- upstart-0.3.9.orig/nih/Makefile.in +++ upstart-0.3.9/nih/Makefile.in @@ -403,7 +403,7 @@ logging.c \ error.c -libnih_la_LDFLAGS = -version-info 0:0:0 $(am__append_1) +libnih_la_LDFLAGS = -static -version-info 0:0:0 $(am__append_1) EXTRA_DIST = libnih.ver libnih.supp include_HEADERS = \ libnih.h