~ubuntu-branches/ubuntu/saucy/sysvinit/saucy-proposed

« back to all changes in this revision

Viewing changes to debian/src/sysv-rc/sbin/invoke-rc.d

  • Committer: Package Import Robot
  • Author(s): Steve Langasek
  • Date: 2013-05-28 12:23:43 UTC
  • mfrom: (189.1.2 ubuntu)
  • Revision ID: package-import@ubuntu.com-20130528122343-5rbqdwv9uuznob9m
Tags: 2.88dsf-41ubuntu2
debian/src/sysv-rc/sbin/invoke-rc.d: tweak behavior of invoke-rc.d when
a package has an upstart job without a corresponding init script, and
we're running on a non-upstart system, *butpolicy-rc.d says to not
take the action.  In this case, we want to exit zero instead of
non-zero, as this is an important use case when setting up Ubuntu in a
chroot.

Show diffs side-by-side

added added

removed removed

Lines of Context:
277
277
    ## Verifies if the given initscript ID is known
278
278
    ## For sysvinit, this error is critical
279
279
    printerror unknown initscript, ${INITDPREFIX}${INITSCRIPTID} not found.
280
 
    exit 100
 
280
    if [ ! -e "$UPSTARTDIR/${INITSCRIPTID}.conf" ]; then
 
281
        # If the init script doesn't exist, but the upstart job does, we
 
282
        # defer the error exit; we might be running in a chroot and
 
283
        # policy-rc.d might say not to start the job anyway, in which case
 
284
        # we don't want to exit non-zero.
 
285
        exit 100
 
286
    fi
281
287
fi
282
288
 
283
289
## Queries sysvinit for the current runlevel
403
409
           fi
404
410
           ;;
405
411
    esac
 
412
elif [ -z "$is_upstart" ] && test ! -f "${INITDPREFIX}${INITSCRIPTID}" ; then
 
413
    # call policy layer.  If the policy denies the execution, pass it on.
 
414
    # otherwise, if the policy *allows* the execution, there's a
 
415
    # misconfiguration somewhere and we throw an error.
 
416
    querypolicy
 
417
    case $RC in
 
418
        101)
 
419
          ;;
 
420
        *)
 
421
          exit 100
 
422
          ;;
 
423
    esac
406
424
else
407
425
    ###
408
426
    ### LOCAL INITSCRIPT POLICY: non-executable initscript; deny exec.