Option to quiet /lib/init/upstart-jobs [RFE,PATCH]

Bug #613231 reported by Jouko Orava
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
upstart (Ubuntu)
Fix Released
Wishlist
James Hunt

Bug Description

Binary package hint: upstart

/lib/init/upstart-job clutters my messages with duplicate, unnecessary messages. I want an option to silence it.

The same notification, "Rather than invoking init scripts through /etc/init.d, ...", is output every single time any init script linked to upstart-job is executed. If I modify /lib/init/upstart-job directly, updating upstart becomes difficult.
This script is a Debian/Ubuntu addition, fully defined in the upstart-*.diff.

I've attached the both a patch, and the replacement upstart-job script itself; these are compatible with both upstart-0.6.5 and 0.6.6.

Default behaviour stays exactly the same.

Short description of the changes:

The ECHO variable is split into two, ECHO_NOTE and ECHO_ERROR, which receive the same values ECHO had.
However, if file /etc/upstart-jobs.conf exists, it is sourced, so that the two variables can be overridden easily.

Tags: patch

Related branches

Revision history for this message
Jouko Orava (joorava) wrote :
Revision history for this message
Jouko Orava (joorava) wrote :
Revision history for this message
Jouko Orava (joorava) wrote :
Revision history for this message
Clint Byrum (clint-fewbar) wrote :

Hi Jouko. Being able to suppress the error makes sense, especially in cases where legacy systems don't have awareness of the 'service' command which will avoid this problem.

Marking as Confirmed, setting Importance to Wishlist.

Changed in upstart (Ubuntu):
status: New → Confirmed
importance: Undecided → Wishlist
tags: added: patch
Revision history for this message
James Hunt (jamesodhunt) wrote :

Hi Jouko. I agree with Clint. There are just a couple of points here:

- The patch no longer applies cleanly to the Ubuntu upstart package as upstart-job has changed a little.
- I'd personally prefer the variables to be called ECHO (rather than ECHO_NOTE) and ECHO_ERROR since its then a smaller change and less likely for errors to be introduced should someone change the file and inadvertently specify ECHO (as they used to).

Revision history for this message
Jouko Orava (joorava) wrote :

Here is the updated patch against upstart-1.5, with three changes compared to earlier versions:

First, the optional config file is moved to /etc/default/upstart-job.

Second, there is only one variable, ECHO.

Third, ECHO defaults to "echo" unless /etc/default/upstart-job exists and redefines it. (Normally, /etc/default/upstart-job does not exist, and that is fine.) If DPKG_MAINTSCRIPT_PACKAGE is not empty, then ECHO is set to : silencing all messages, regardless of what /etc/default/upstart-job set it to.

Revision history for this message
Jouko Orava (joorava) wrote :

This is the same patch as in #6, except with ECHO split to ECHO (notifications) and ECHO_ERROR (used for the command not supported message).

Revision history for this message
James Hunt (jamesodhunt) wrote :

@Jouko - thank you once again for making these changes. I have now applied them to the Ubuntu Upstart branch so they will be included in the next upload.

Changed in upstart (Ubuntu):
assignee: nobody → James Hunt (jamesodhunt)
status: Confirmed → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package upstart - 1.6.1-1ubuntu1

---------------
upstart (1.6.1-1ubuntu1) raring; urgency=low

  [ Steve Langasek ]
  * New upstream release.
  * Merge with Debian.
    - drop debian/conf/dbus-reconnect.conf again, only needed in Debian.
    - don't build against libselinux; this is probably fine to have in
      Ubuntu, but this isn't the time to add it.
    - back down the Debian-specific versioned depends on sysvinit, ifupdown,
      udev
  * Export $TERM in init/Makefile.am; the Debian buildds don't set this,
    which results in test failures because of assumptions that it will be
    available.
  * Hard-code a dependency on libjson0 (>= 0.10-1.1ubuntu1), the first
    version of the package that installs to /lib instead of /usr/lib.

  [ James Hunt ]
  * debian/upstart-job: Allow script to operate quietly by reading optional
    /etc/default/upstart-job configuration. Thanks to Jouko Orava
    (LP: #613231)
  * debian/control: Added debianutils for ischroot(1).
  * debian/upstart.postinst: Enabled stateful re-exec handling in selected
    upgrade scenarios. Details:
    - Only query running version if initctl is known to work.
    - Discard initctl stderr just in case.
    - Do not re-exec if running in a chroot (uses ischroot(1)).
    - Removed redundent check on previously installed version.
    - Updated lengthy commentary.

  [ Stéphane Graber ]
  * debian/apparmor-profile-load: Ignore output from running-in-container.
    This prevents the output of running-in-container from being appended to
    rsyslog's upstart log (and any other job calling apparmor-profile-load).

  [ Dmitrijs Ledkovs, James Hunt ]
  * Add DEP-8 autopkgtests.
 -- Steve Langasek <email address hidden> Thu, 15 Nov 2012 09:26:10 -0800

Changed in upstart (Ubuntu):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.