lintian should not complain about upstart jobs not looking like init scripts

Bug #496798 reported by Dustin Kirkland 
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
lintian (Debian)
Fix Released
Unknown
lintian (Ubuntu)
Fix Released
Medium
Dustin Kirkland 
Natty
Fix Released
Medium
Dustin Kirkland 

Bug Description

Binary package hint: lintian

We have converted the eucalyptus init scripts to upstart scripts, and linked their init script locations to /lib/init/upstart-job.

Lintian should not try an enforce
 * init.d-script-missing-lsb-section
 * script-in-etc-init.d-not-registered-via-update-rc.d
on such init scripts which are really upstart jobs.

Changed in lintian (Ubuntu):
status: New → Confirmed
importance: Undecided → Medium
Changed in lintian (Ubuntu):
assignee: nobody → Jos Boumans (jib)
Revision history for this message
Dustin Kirkland  (kirkland) wrote :

Assigning the bug to Jos, and leaving a few pointers behind...

 1) Grab the source to Lintian in Lucid (apt-get source lintian, or dget the source .dsc file)
 2) Look at checks/init.d*; Basically, these are getting applied to all scripts installed in /etc/init.d. We're dropping a symlink to /lib/init/upstart-job in /etc/init.d When examining a file, if it's really a symlink to /lib/init/upstart-job, skip over it.

The two tags you're trying to silence are:
 * init.d-script-missing-lsb-section
 * script-in-etc-init.d-not-registered-via-update-rc.d
when the file under scrutiny is a symlink to /lib/init/upstart-job.

Looks like check/init.d, lines 184 and 254.

Something like this might help:

    # Skip init scripts which are symlinks to /lib/init/upstart-job
    if ($filename =~ m,etc/init\.d/, && -l $filename) {
        my $link = readlink($filename);
        next if ($link =~ m,lib/init/upstart-job$,);
    }

Test linitan against a deb file exhibiting the problem.
 wget https://edge.launchpad.net/ubuntu/+archive/primary/+files/eucalyptus-cc_1.6.1~bzr1085-0ubuntu4_amd64.deb
 lintian eucalyptus-cc*.deb

Make your code changes, increment the change log mentioning this bug number (using dch -i), grab the build dependencies (sudo apt-get build-dep lintian), and test your build (debuild). Install (dpkg -i ../*deb). And rerun your lintian test.

When you've got something working, build a source package (debuild -S), and generate a patch (debdiff), and attach to this bug for review.

Thanks!
:-Dustin

Changed in lintian (Ubuntu):
status: Confirmed → Triaged
Revision history for this message
Russ Allbery (rra-debian) wrote : Re: [Bug 496798] Re: lintian should not complain about upstart jobs not looking like init scripts

Dustin Kirkland <email address hidden> writes:

> Assigning the bug to Jos, and leaving a few pointers behind...

> 1) Grab the source to Lintian in Lucid (apt-get source lintian, or dget
> the source .dsc file)
> 2) Look at checks/init.d*; Basically, these are getting applied to all
> scripts installed in /etc/init.d. We're dropping a symlink to
> /lib/init/upstart-job in /etc/init.d When examining a file, if it's
> really a symlink to /lib/init/upstart-job, skip over it.

> The two tags you're trying to silence are:
> * init.d-script-missing-lsb-section
> * script-in-etc-init.d-not-registered-via-update-rc.d
> when the file under scrutiny is a symlink to /lib/init/upstart-job.

> Looks like check/init.d, lines 184 and 254.

> Something like this might help:

> # Skip init scripts which are symlinks to /lib/init/upstart-job
> if ($filename =~ m,etc/init\.d/, && -l $filename) {
> my $link = readlink($filename);
> next if ($link =~ m,lib/init/upstart-job$,);
> }

Please do submit this as a Debian bug as well, since we'll be happy to
take this upstream in Debian. (Hopefully Debian will also eventually
switch to upstart.)

--
Russ Allbery (<email address hidden>) <http://www.eyrie.org/~eagle/>

Revision history for this message
Dustin Kirkland  (kirkland) wrote : Re: [Bug 496798] Re: lintian should not complain about upstart jobs not looking like init scripts

Thus Russ, will do, as soon as Jos gets it fixed ;-) This bug will be
good education, end-to-end ;-)

Revision history for this message
Jos Boumans (jib) wrote :

Attached is a patch for the issue described. Tests confirm both warnings
are now no longer present.

Output for sample .deb is now:

W: eucalyptus-cc: executable-not-elf-or-script ./usr/lib/axis2/services/EucalyptusCC/services.xml
W: eucalyptus-cc: executable-not-elf-or-script ./var/lib/eucalyptus/keys/nc-client-policy.xml
W: eucalyptus-cc: executable-not-elf-or-script ./usr/lib/axis2/services/EucalyptusCC/eucalyptus_cc.wsdl
W: eucalyptus-cc: maintainer-script-ignores-errors postinst
W: eucalyptus-cc: using-imperative-form-in-templates eucalyptus/mode

Cheers,

Changed in lintian (Ubuntu):
status: Triaged → In Progress
Revision history for this message
Raphael Geissert (atomo64) wrote :

Jos, would be great if you could provide a test too (take a look at t/tests/).

But taking a look at the implementation:
Once upstart-job is included in Debian and made the default it will
return the LSB headers when called with a special argument (I don't
remeber the details right now). As such, not all the tests should be
skipped.
I'm not sure if the update-rc.d call needs to be dropped either.

I'm CC'ing Petter Reinholdtsen as he might remeber the details better.

Revision history for this message
Steve Langasek (vorlon) wrote : Re: [Bug 496798] Re: lintian should not complain about upstart jobs not looking like init scripts

On Tue, Dec 29, 2009 at 04:47:08AM -0000, Raphael Geissert wrote:
> I'm not sure if the update-rc.d call needs to be dropped either.

In Ubuntu, where upstart is the only supported init implementation,
update-rc.d is not called because the extra symlinks have been shown to
cause boot-time overhead.

In Debian, this would not be the right thing to do; so disabling the check
for update-rc.d on upstart jobs would be an Ubuntu-specific lintian change.

--
Steve Langasek Give me a lever long enough and a Free OS
Debian Developer to set it on, and I can move the world.
Ubuntu Developer http://www.debian.org/
<email address hidden> <email address hidden>

Revision history for this message
Petter Reinholdtsen (pere-hungry) wrote :

[Raphael Geissert]
> Jos, would be great if you could provide a test too (take a look at t/tests/).
>
> But taking a look at the implementation:
> Once upstart-job is included in Debian and made the default it will
> return the LSB headers when called with a special argument (I don't
> remeber the details right now). As such, not all the tests should be
> skipped.
> I'm not sure if the update-rc.d call needs to be dropped either.
>
> I'm CC'ing Petter Reinholdtsen as he might remeber the details better.

The insserv bug for this support was #547235. The argument is
lsb-header, and update-rc.d still need to be called for the
upstart-job symlink.

We are still waiting for the upstart part of the implementation. CC
to Michael who was going to implement it.

Happy hacking,
--
Petter Reinholdtsen

Revision history for this message
Dustin Kirkland  (kirkland) wrote :

Cool, thanks, Jos.

I have a similar patch that I've been using on my local system (attached).

So I'm looking for affirmation from the Lintian developers here... We'd like to patch Lucid's lintian package, but would like to do so in a manner that will be also be carried upstream in Debian. Can you help us converge on a patch? Thanks.

Revision history for this message
Raphael Geissert (atomo64) wrote : Re: [Bug 496798] Re: lintian should not complain about upstart jobs not looking like init scripts

Hi Steve,

Thanks for the explanation. Since the 'lsb-header' argument support
also needs to be implemented on Ubuntu's upstart-job, do you think it
would be possible to help Michael implement it? I assume some of the
implementation details were already discussed with Scott.
It would help both distributions a lot to get these things move forward.

2009/12/29 Petter Reinholdtsen <email address hidden>:
[...]
> The insserv bug for this support was #547235.  The argument is
> lsb-header, and update-rc.d still need to be called for the
> upstart-job symlink.
>

Ok, thanks.

On the lintian side of this issue we should probably come up with a
better way to deal with these Ubuntu-specific exceptions. Probably
something at the Lintian::Tag layer.

Cheers,
--
Raphael Geissert - Debian Developer
www.debian.org - get.debian.net

Revision history for this message
Dustin Kirkland  (kirkland) wrote :
Download full text (5.3 KiB)

As for a test, grab the source to the Ubuntu eucalyptus package (and its build-deps), and build it.

Without the patched lintian, you will see this output:

Now running lintian...
W: eucalyptus source: patch-system-but-direct-changes-in-diff aclocal.m4 and 29 more
W: eucalyptus source: newer-debconf-templates
W: eucalyptus source: out-of-date-standards-version 3.8.3 (current is 3.8.4)
W: eucalyptus-cc: script-in-etc-init.d-not-registered-via-update-rc.d /etc/init.d/eucalyptus-cc
W: eucalyptus-cc: init.d-script-missing-lsb-section /etc/init.d/eucalyptus-cc
W: eucalyptus-cc: script-in-etc-init.d-not-registered-via-update-rc.d /etc/init.d/eucalyptus-cc-publication
W: eucalyptus-cc: init.d-script-missing-lsb-section /etc/init.d/eucalyptus-cc-publication
W: eucalyptus-cc: executable-not-elf-or-script ./usr/lib/axis2/services/EucalyptusCC/services.xml
W: eucalyptus-cc: executable-not-elf-or-script ./var/lib/eucalyptus/keys/nc-client-policy.xml
W: eucalyptus-cc: executable-not-elf-or-script ./usr/lib/axis2/services/EucalyptusCC/eucalyptus_cc.wsdl
W: eucalyptus-common: script-in-etc-init.d-not-registered-via-update-rc.d /etc/init.d/eucalyptus-network
W: eucalyptus-common: init.d-script-missing-lsb-section /etc/init.d/eucalyptus-network
W: eucalyptus-common: script-in-etc-init.d-not-registered-via-update-rc.d /etc/init.d/eucalyptus
W: eucalyptus-common: init.d-script-missing-lsb-section /etc/init.d/eucalyptus
W: eucalyptus-common: binary-without-manpage usr/sbin/euca_killall
W: eucalyptus-common: binary-without-manpage usr/sbin/euca_sync_key
W: eucalyptus-common: executable-not-elf-or-script ./etc/bash_completion.d/euca_conf
W: uec-component-listener: script-in-etc-init.d-not-registered-via-update-rc.d /etc/init.d/uec-component-listener
W: uec-component-listener: init.d-script-missing-lsb-section /etc/init.d/uec-component-listener
W: uec-component-listener: binary-without-manpage usr/bin/uec-registration
W: uec-component-listener: binary-without-manpage usr/sbin/uec_component_listener
W: eucalyptus-java-common: binary-without-manpage usr/sbin/eucalyptus-cloud
W: eucalyptus-gl: executable-not-elf-or-script ./usr/lib/axis2/services/EucalyptusGL/services.xml
W: eucalyptus-gl: executable-not-elf-or-script ./usr/lib/axis2/services/EucalyptusGL/eucalyptus_gl.wsdl
W: eucalyptus-cloud: script-in-etc-init.d-not-registered-via-update-rc.d /etc/init.d/eucalyptus-cloud
W: eucalyptus-cloud: init.d-script-missing-lsb-section /etc/init.d/eucalyptus-cloud
W: eucalyptus-cloud: script-in-etc-init.d-not-registered-via-update-rc.d /etc/init.d/eucalyptus-cloud-publication
W: eucalyptus-cloud: init.d-script-missing-lsb-section /etc/init.d/eucalyptus-cloud-publication
W: eucalyptus-nc: script-in-etc-init.d-not-registered-via-update-rc.d /etc/init.d/eucalyptus-nc
W: eucalyptus-nc: init.d-script-missing-lsb-section /etc/init.d/eucalyptus-nc
W: eucalyptus-nc: script-in-etc-init.d-not-registered-via-update-rc.d /etc/init.d/eucalyptus-nc-publication
W: eucalyptus-nc: init.d-script-missing-lsb-section /etc/init.d/eucalyptus-nc-publication
W: eucalyptus-nc: binary-without-manpage usr/sbin/euca_test_nc
W: eucalyptus-nc: executable-not-elf-or-script ./usr/lib/axis2/services/Eucalypt...

Read more...

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package lintian - 2.3.3ubuntu2

---------------
lintian (2.3.3ubuntu2) lucid; urgency=low

  [ Jos Boumans ]
  * Avoid checking upstart jobs linked from /etc/init.d (LP: #496798),
    patch submitted to Debian bug #569492
 -- Dustin Kirkland <email address hidden> Thu, 11 Feb 2010 17:52:14 -0600

Changed in lintian (Ubuntu):
status: In Progress → Fix Released
Changed in lintian (Debian):
status: Unknown → Fix Released
Revision history for this message
Dustin Kirkland  (kirkland) wrote :

Reopening this bug for Natty. This bug was re-introduced by the last merge which dropped part of the fix.

Changed in lintian (Ubuntu Natty):
status: Fix Released → In Progress
assignee: Jos Boumans (jib) → Dustin Kirkland (kirkland)
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package lintian - 2.4.3ubuntu3

---------------
lintian (2.4.3ubuntu3) natty; urgency=low

  * checks/init.d: fix LP: #496798 again; upstream only took part of our
    patch and the rest of the fix was dropped in the last merge; per
    maintainer's comments in Debian bug #569492, Ubuntu will need to
    carry this fix for the time being
 -- Dustin Kirkland <email address hidden> Wed, 26 Jan 2011 15:49:23 -0600

Changed in lintian (Ubuntu Natty):
status: In Progress → 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.