upstart feedback is confusing when .conf file contains syntax errors

Bug #1446577 reported by Karl-Philipp Richter
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
upstart (Ubuntu)
New
Undecided
Unassigned

Bug Description

When an `upstart` script in `/etc/init/` contains a line like `NAME=value` the feedback of `sudo start myservice` fails with a feedback that indicates that the service doesn't exist, rather than telling that it contains a syntax error. Example output:

    $ start myservice
    start: Unknown job: myservice
    $ service myservice start
    myservice: unrecognized service

An example of a failing script is

    # myservice - myservice job file

    description "my service description"
    author "Me <myself@i.com>"

    # Stanzas
    #
    # Stanzas control when and how a process is started and stopped
    # See a list of stanzas here: http://upstart.ubuntu.com/wiki/Stanzas#respawn

    # When to start the service
    start on runlevel [2345]

    # When to stop the service
    stop on runlevel [016]

    # Automatically restart process if crashed
    respawn

    # Essentially lets upstart know the process will detach itself to the background
    expect fork

    # Run before process
    pre-start script
        [ -d /var/run/myservice ] || mkdir -p /var/run/myservice
        echo "Put bash code here"
    end script

    # Start the process
    exec echo "Hello world!"

After fixing the syntax error the `start` and `service` command refuse to start the service.

ProblemType: Bug
DistroRelease: Ubuntu 14.10
Package: upstart 1.13.2-0ubuntu2
Uname: Linux 4.0.0-040000-generic x86_64
NonfreeKernelModules: zfs zunicode zcommon znvpair zavl
ApportVersion: 2.14.7-0ubuntu8.4
Architecture: amd64
Date: Tue Apr 21 13:01:42 2015
EcryptfsInUse: Yes
InstallationDate: Installed on 2015-04-20 (0 days ago)
InstallationMedia: Ubuntu-Server 14.10 "Utopic Unicorn" - Release amd64 (20141022.2)
ProcEnviron:
 TERM=xterm
 PATH=(custom, no user)
 XDG_RUNTIME_DIR=<set>
 LANG=de_DE.UTF-8
 SHELL=/bin/bash
ProcKernelCmdline: BOOT_IMAGE=/vmlinuz-4.0.0-040000-generic root=/dev/mapper/root-root ro rootflags=subvol=@ nomdmonddf nomdmonisw
SourcePackage: upstart
UpgradeStatus: No upgrade log present (probably fresh install)
UpstartBugCategory: System
UpstartRunningSystemVersion: init (upstart 1.13.2)
modified.conffile..etc.at.deny: [inaccessible: [Errno 13] Permission denied: '/etc/at.deny']
modified.conffile..etc.init.d.squid3: [modified]
modified.conffile..etc.init.squid3.conf: [modified]
modified.conffile..etc.libvirt.qemu.conf: [inaccessible: [Errno 13] Permission denied: '/etc/libvirt/qemu.conf']
modified.conffile..etc.squid3.squid.conf: [modified]
modified.conffile..etc.sudoers.d.zfs: [inaccessible: [Errno 13] Permission denied: '/etc/sudoers.d/zfs']
mtime.conffile..etc.init.d.squid3: 2015-04-20T19:38:26.086956
mtime.conffile..etc.init.squid3.conf: 2015-04-20T19:41:30.667871
mtime.conffile..etc.squid3.squid.conf: 2015-04-20T19:27:33.523720

Revision history for this message
Karl-Philipp Richter (krichter722) wrote :
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.