Ubuntu

Needs Ubuntu-style init script

Reported by Gary Coady on 2006-05-08
6
Affects Status Importance Assigned to Milestone
Ubuntu Server papercuts
Wishlist
Scott Moser
xinetd (Ubuntu)
Wishlist
Scott Moser

Bug Description

Binary package hint: xinetd

xinetd init.d script doesn't fit in with the rest of the packages in main:

$ sudo /etc/init.d/xinetd start
Starting internet superserver: xinetd.

$ sudo /etc/init.d/xinetd stop
Stopping internet superserver: xinetd.

With this change, the init script output looks like

$ sudo /etc/init.d/xinetd start
 * Starting internet superserver xinetd [ ok ]

$ sudo /etc/init.d/xinetd stop
 * Stopping internet superserver xinetd [ ok ]

Colin Watson (cjwatson) wrote :

/usr/share/doc/lsb-base/README.Debian.gz says:

  This package also includes the LSB-specified logging functions:

  log_success_msg message
  log_failure_msg message
  log_warning_msg message

  These functions *do not* comply with Debian policy and should only be used
by LSB packages.

I'm not entirely certain what should be used instead in this case.

Also note that that README file specifies a newer dependency than in this patch.

Daniel T Chen (crimsun) on 2008-09-12
Changed in xinetd:
importance: Medium → Wishlist
status: New → Confirmed

Strictly speaking, converting it to an Upstart job would be better

Changed in xinetd (Ubuntu):
status: Confirmed → Triaged
Thierry Carrez (ttx) on 2010-06-29
Changed in server-papercuts:
importance: Undecided → Wishlist
milestone: none → maverick-alpha-3
status: New → Triaged
Scott Moser (smoser) on 2010-06-29
Changed in server-papercuts:
assignee: nobody → Scott Moser (smoser)
Changed in xinetd (Ubuntu):
assignee: nobody → Scott Moser (smoser)
Scott Moser (smoser) on 2010-07-13
Changed in xinetd (Ubuntu):
assignee: Scott Moser (smoser) → nobody
Scott Moser (smoser) wrote :

Some comments on the upstart job.

In order to maintain the old behavior, we send a SIGQUIT in the pre-stop portion of the upstart job. Per man page:
- SIGQUIT causes program termination.
- SIGTERM terminates all running servers before terminating xinetd.

Doing this is incompatible with using 'respawn', and I've opened upstart bug 605007 to address that.
'respawn' would be nice, as xinetd is a daemon that could die, and it would be nice to have upstart watching it, but the old sysv scripts had no such function.

In short, the upstart job should function almost identically to the sysvinit script.

Thierry Carrez (ttx) on 2010-08-03
Changed in server-papercuts:
status: Triaged → Fix Committed
Dan DeMaggio (dmag) wrote :

A work-around: add "stop" to the pre-stop script. This will prevent respawning. This seems to work:

{{{
       P=`cat /pidfile`
       kill -QUIT $P
       wait $P
       stop # Prevent respawn bug in upstart
}}}

Sebastien Bacher (seb128) wrote :

Why is the task fix commited? Does anybody plan to upload that to natty?

Jamie Strandboge (jdstrand) wrote :

@ttx and @smoser,

This was marked 'Fix Committed' for maverick-alpha-3. I don't see the changes in xinetd in natty. Is this something that is planned? If yes, please mark the status as 'Triaged' or something more appropriate. If not, please mark as "Won't Fix" with reasons why. There is no reason leaving a Wishlist bug open for 4.5 years if no one is planning on fixing it. Thanks!

Changed in xinetd (Ubuntu):
status: Triaged → Incomplete
Scott Moser (smoser) wrote :

Dan,
  In my tests here, I added 'respawn', and made the pre-stop script look like:

pre-stop script
  xinetd_pid=$(status | awk '/stop\/pre-stop/ { print $NF }')
  [ -n "${xinetd_pid}" ] || exit 0
  kill -QUIT "${xinetd_pid}"
  wait ${xinetd_pid}
  stop # Prevent respawn bug in upstart (LP: #605007)
end script

With 'respawn' commented out, the script works like:
$ sudo status xinetd
xinetd start/running, process 490
$ sudo stop xinetd
xinetd stop/waiting
$ sudo start xinetd
xinetd start/running, process 1364

With respawn added back in, it looks like:
$ sudo status xinetd
xinetd stop/waiting
$ sudo start xinetd
xinetd start/running, process 3094
$ sudo stop xinetd
xinetd start/running, process 3275
$ sudo stop xinetd
xinetd start/running, process 3394

So I don't think the workaround works.
Initial debugging shows that nothing in that pre-stop script after 'wait' will run. I'm guessing that upstart just kills the pre-stop job after it sees that the process is gone.

So, I think the right thing to do here is to move to the upstart job that I have, and, if you see fit, open a new bug saying "respawn does not work with xinetd upstart job".

Changed in xinetd (Ubuntu):
status: Incomplete → In Progress
Scott Moser (smoser) wrote :

I've linked a new branch (lp:~smoser/ubuntu/natty/xinetd/bug43574) which is identical to the one I unlinked except for 'natty' as the release in debian/changelog.

Please sponsor and upload.

Kees Cook (kees) wrote :

Thanks, this looks good. I'll upload shortly.

Changed in xinetd (Ubuntu):
status: In Progress → Fix Committed
assignee: nobody → Scott Moser (smoser)
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package xinetd - 1:2.3.14-7ubuntu4

---------------
xinetd (1:2.3.14-7ubuntu4) natty; urgency=low

  * add xinetd upstart job (LP: #43574)
 -- Scott Moser <email address hidden> Tue, 13 Jul 2010 09:24:49 -0400

Changed in xinetd (Ubuntu):
status: Fix Committed → Fix Released
Scott Moser (smoser) on 2013-02-14
Changed in server-papercuts:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers