upstart feedback is confusing when .conf file contains syntax errors
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://
# 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-
NonfreeKernelMo
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_
LANG=de_DE.UTF-8
SHELL=/bin/bash
ProcKernelCmdline: BOOT_IMAGE=
SourcePackage: upstart
UpgradeStatus: No upgrade log present (probably fresh install)
UpstartBugCategory: System
UpstartRunningS
modified.
modified.
modified.
modified.
modified.
modified.
mtime.conffile.
mtime.conffile.
mtime.conffile.