user upstart job in ~/.init/ is not found
A few points:
-
User jobs are not enabled by default in Ubuntu. See:
- http://upstart.ubuntu.com/cookbook/#user-job
- http://upstart.ubuntu.com/cookbook/#enabling
You never need to reboot after creating any type of Upstart job—they are automatically detected by Upstart (using inotify).
The
service
command is not part of Upstart—it is the SystemV tool to manipulate SysV jobs. However, Upstart provides SystemV compatibility such that Upstart system jobs can also be manipulated viaservice
(for convenience). The Upstart equivalent commands arestart
,stop
and,restart
.For user jobs, you must use
start
,stop
and,restart
(or theinitctl
equivalents).
Finally, note that user jobs are very basic currently. We plan to enhance them significantly for 12.10 but for now be aware that:
- Upstart will run all user jobs using
/bin/sh -e
regardless of which shell you use by default. That-e
is also very important (man sh
for details). -
Upstart will only set a minimal set of variables in the user job environment. Hence, you should probably set variables like
HOME
like this:env HOME=/home/james
See:
- http://upstart.ubuntu.com/cookbook/#env
- http://upstart.ubuntu.com/cookbook/#export
- http://upstart.ubuntu.com/cookbook/#debugging-a-script-which-appears-to-be-behaving-oddly