FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Debian > Debian Development

 
 
LinkBack Thread Tools
 
Old 02-14-2011, 05:06 PM
Steve Langasek
 
Default Bug#591791: Upstart and sysvinit in packages - Policy needed

On Mon, Feb 14, 2011 at 11:17:20AM +0100, Marco Amadori wrote:
> In data Saturday 12 February 2011 05:55:16, Joachim Breitner ha scritto:

> >> I included some patches to have nodm gracefully uses the upstart job.

> >> Since those patches permits to have both init scripts in the system, no
> >> matter if upstart or sysvinit is used, a little more effort is required
> >> to proper build this package.

> > thanks for your patches. I applied them to the repo besides the patch
> > 0005-Exit-from-the-sysvinit-script-to-use-the-upstart-job.patch. Is that
> > code taken from some existing package?

> I took the idea from discussion on bug #591791 and updated to work also with
> current sysvinit, that does currently not likes the syntax "--version".

> I include again this patch to permits other people to follow the discussion
> there, but is just a matter of :

> if [ -e "/etc/init/${NAME}.conf" ] && /sbin/telinit --version >/dev/null 2>&1
> | grep -qs upstart
> then
> exit 0
> fi

> inside the sysvinit init script.

This does not appear to be consistent with
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=591791#42, in particular:

If nothing else, an init script that returns success on 'start' without
starting the service would be inconsistent with how we've expected all
init scripts to work to date. (It's not *quite* a policy violation, but
near enough to.) And if you argue that nothing should ever call these init
scripts because everything should use invoke-rc.d, then things using this
upstart-aware interface will never see the return code anyway, right?

Oh, and if you redirect telinit stdout and stderr both to /dev/null, that
grep is always going to return false.


Also, I strongly counsel *against* shipping this, or any, upstart job in a
Debian package until this policy bug is *fixed*. The conversation is
ongoing, and deploying such upstart jobs now realistically just runs the
(very high) risk that you'll have more work to do on your package later once
the policy interfaces are refined and implemented.


BTW, my goal is to provide this functionality in an lsb-style function; that
will preclude both the call to 'exit' here (with any return value) or
checking for ${NAME} in the code; anyway, a package should darn well know
whether it's set up to ship both an upstart job and an init script and not
need to query the filesystem to figure that out.


> Debhelper seems to not permit to have both, e.g., an upstart and a sysvinit
> script available in the package, although with a trick like the above
> mentioned one, the could happily live together in perfect armony, side by side
> on my wheezy.

Debhelper doesn't permit both because policy does not specify how this is
supposed to work. I have already submitted a patch to debhelper (bug
#577040), which I have asked Joey to sit on until policy is finalized and
various other key packages have implemented the necessary support (namely,
sysvinit and lsb-base).

Thanks,
--
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/
slangasek@ubuntu.com vorlon@debian.org


--
To UNSUBSCRIBE, email to debian-devel-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 20110214180645.GD17059@virgil.dodds.net">http://lists.debian.org/20110214180645.GD17059@virgil.dodds.net
 
Old 02-14-2011, 07:14 PM
Marco Amadori
 
Default Bug#591791: Upstart and sysvinit in packages - Policy needed

On Monday 14 February 2011 21:07:57 Steve Langasek wrote:

> > if [ -e "/etc/init/${NAME}.conf" ] && /sbin/telinit --version >/dev/null
> > 2>&1
> > | grep -qs upstart
> > then
> > exit 0
> > fi
> >
> > inside the sysvinit init script.
>
> This does not appear to be consistent with
> http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=591791#42, in particular:
>
> If nothing else, an init script that returns success on 'start' without
> starting the service would be inconsistent with how we've expected all
> init scripts to work to date. (It's not *quite* a policy violation, but
> near enough to.) And if you argue that nothing should ever call these
> init scripts because everything should use invoke-rc.d, then things using
> this upstart-aware interface will never see the return code anyway, right?

I'm so sorry, in the hurry I put an exit 0 for the wrong psycological reasons,
you are right.

> Oh, and if you redirect telinit stdout and stderr both to /dev/null, that
> grep is always going to return false.

This is a bad mistake for sure! I apologize to all for being so nave and
publishing a bad tested code (I tested an uncommitted previous release, then I
"improved" and submitted without tests!!)

Again, I apologize.

> Also, I strongly counsel *against* shipping this, or any, upstart job in a
> Debian package until this policy bug is *fixed*.

This seems a good point, having that debhelper prefer upstart jobs over
sysvinit when both are available.

> > Debhelper seems to not permit to have both, e.g., an upstart and a
> > sysvinit script available in the package, although with a trick like the
> > above mentioned one, the could happily live together in perfect armony,
> > side by side on my wheezy.

> Debhelper doesn't permit both because policy does not specify how this is
> supposed to work. I have already submitted a patch to debhelper (bug
> #577040), which I have asked Joey to sit on until policy is finalized and
> various other key packages have implemented the necessary support (namely,
> sysvinit and lsb-base).

I hope that this discussion could help in clarifing this matter, probably the
times are mature enough.

--
ESC:wq


--
To UNSUBSCRIBE, email to debian-devel-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 201102142114.45270.marco.amadori@gmail.com">http://lists.debian.org/201102142114.45270.marco.amadori@gmail.com
 

Thread Tools




All times are GMT. The time now is 03:56 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org