“service foo reload” complains about using the init script and recommends using service

Bug #433544 reported by Anders Kaseorg
16
This bug affects 3 people
Affects Status Importance Assigned to Milestone
sysvinit (Ubuntu)
Fix Released
Medium
Dustin Kirkland 
upstart (Ubuntu)
Fix Released
Medium
Scott James Remnant (Canonical)

Bug Description

Binary package hint: sysvinit

In the spirit of bug #427277 (service foo start), but still present after it was fixed:

$ sudo service dbus reload
Rather than invoking init scripts through /etc/init.d, use the service(8)
utility, e.g. service dbus reload

Changed in sysvinit (Ubuntu):
importance: Undecided → Medium
tags: removed: ubuntu-boot
Changed in sysvinit (Ubuntu):
status: New → Confirmed
Revision history for this message
Robbie Williamson (robbiew) wrote :

This appears to be specific to /etc/init.d/scripts linked to upstart scripts.

affects: sysvinit (Ubuntu) → upstart (Ubuntu)
Changed in upstart (Ubuntu):
assignee: nobody → Scott James Remnant (scott)
Changed in upstart (Ubuntu):
assignee: Scott James Remnant (scott) → Dustin Kirkland (kirkland)
Revision history for this message
Dustin Kirkland  (kirkland) wrote :

Hrm, well, my piece (/sbin/service) is relatively simple...

--- service 2009-09-21 22:43:59.182778022 -0700
+++ service.orig 2009-09-21 22:43:41.379105547 -0700
@@ -118,7 +118,7 @@ done
 if [ -r "/etc/init/${SERVICE}.conf" ]; then
    # Upstart configuration exists for this job
    case "${ACTION}" in
- start|stop|restart|status|reload|force-reload)
+ start|stop|restart|status)
          # Action is a valid upstart action
          exec ${ACTION} ${SERVICE} ${OPTIONS}
       ;;

However, this would require Upstart to natively support the reload and force-reload actions in the same manner as start, stop, restart, and status... as scripts (or symlinks) in /sbin/reload and /sbin/force-reload.

So I'll add a sysvinit-utils task, assign that to myself.

But I'm going to reassign the upstart bit to Scott. Hopefully you can add reload and force-reload to /sbin/initctl, and install the proper symlinks.

:-Dustin

Changed in sysvinit (Ubuntu):
status: New → Triaged
importance: Undecided → Medium
Changed in upstart (Ubuntu):
assignee: Dustin Kirkland (kirkland) → Scott James Remnant (scott)
Changed in sysvinit (Ubuntu):
assignee: nobody → Dustin Kirkland (kirkland)
Revision history for this message
Scott James Remnant (Canonical) (canonical-scott) wrote :

upstart (>= 0.6.3-4) will have an /sbin/reload command that you can use, you'll want to make sure you Depend on this version

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

This bug was fixed in the package upstart - 0.6.3-4

---------------
upstart (0.6.3-4) karmic; urgency=low

  [ Scott James Remnant ]
  * Reduce the priority of the stopped by/continued by messages so that
    they are only shown when --verbose on the kernel command-line.
    LP: #401333.
  * Add a hack to look for /dev/.initramfs/*.pid files on startup and
    "fake" start jobs of those names. Basically this means that "status"
    and "stop" work for things like bootchart and usplash.
  * Implement a "reload" command in initctl that retrieves the current pid
    of the job and sends it the HUP signal. LP: #433544.

  [ Steve Langasek ]
  * debian/upstart-job:
    - give proper policy-compliant behavior of the start command: detect if
      the job is already running using upstart status, and if so return success.
    - same for the stop command: return success if the job is already stopped.
    - when $DPKG_MAINTSCRIPT_PACKAGE is set, don't spit warnings out because
      it's not the user's fault - we're being invoked by a maintainer script.

 -- Scott James Remnant <email address hidden> Tue, 22 Sep 2009 13:56:48 -0700

Changed in upstart (Ubuntu):
status: Fix Committed → Fix Released
Revision history for this message
Scott James Remnant (Canonical) (canonical-scott) wrote : Re: [Bug 433544] Re:“servicefooreload”complains about using the init script and recommends using service

On Tue, 2009-09-22 at 05:47 +0000, Dustin Kirkland wrote:

> Hrm, well, my piece (/sbin/service) is relatively simple...
>
A little less simple, as discussed earlier:

There won't be an /sbin/force-reload, so you'll need to
call /sbin/reload for that case.

Scott
--
Scott James Remnant
<email address hidden>

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

This bug was fixed in the package sysvinit - 2.87dsf-4ubuntu7

---------------
sysvinit (2.87dsf-4ubuntu7) karmic; urgency=low

  * debian/rules: add a versioned dependency on the upstart that provides
    the reload action
  * debian/service/service: handle reload and force-reload actions as
    upstart commands, LP: #433544

 -- Dustin Kirkland <email address hidden> Tue, 22 Sep 2009 14:25:37 -0700

Changed in sysvinit (Ubuntu):
status: Triaged → Fix Released
Revision history for this message
somekool (somekool) wrote :

I still have that bug... 3 years later running 12.04

mathieu@Miyauchi-QC-PC:~$ service autofs disable
Rather than invoking init scripts through /etc/init.d, use the service(8)
utility, e.g. service autofs disable

The script you are attempting to invoke has been converted to an Upstart
job, but disable is not supported for Upstart jobs.
mathieu@Miyauchi-QC-PC:~$ type service
service is hashed (/usr/sbin/service)
mathieu@Miyauchi-QC-PC:~$

mathieu@Miyauchi-QC-PC:/etc$ do-release-upgrade
Checking for a new Ubuntu release
No new release found
mathieu@Miyauchi-QC-PC:/etc$

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.