6

I wrote an upstart service following the Ubuntu wiki article and created a .conf file in /etc/init/. There're no instructions on how to proceed to make the script available in initctl list and for upstart management commands, like start and service. The official upstart cookbook doesn't explain this matter.

The start fails with

$ start archiva
start: Unknown job: archiva
$ service archiva start
archiva: unrecognized service
1
  • What does initctl check-config say? And did you do sudo start archiva? A simple start will check for session jobs, not system jobs.
    – muru
    Apr 21, 2015 at 11:55

3 Answers 3

5

Probably there are some errors in you conf file. To verify it use:

 init-checkconf archiva.conf

or

initctl check-config archiva

as described in upstart cookbook: 10.1.6.2 initctl check-config and 10.1.7 init-checkconf.

Upstart use init daemon that, according to man page:

On startup, the Upstart init(8) daemon reads its job configuration from files in the /etc/init/ directory, and watches for future changes to these files using inotify(7).

So, once you place your configuration file in /etc/init, your service is enabled and on the next reboot the init daemon will start it.

1

Upstart uses inotify. If you drop a configuration file into /etc/init/, Upstart should detect and make the job available automatically. If you don't see it appear, there may be a problem in your new configuration. Try checking the logs for errors.

0

Defining a variable in the /etc/init/scriptname.conf file in the form of NAME=value like you'd do in an initd script causes upstart to give this rather nonsense feedback (telling that there's a syntax error is much more suitable than saying that the script doesn't exist). Removing the line causes the script to be recognized and startable randomly (see my suggested improvement as bug 1446577 on launchpad.net for details).

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .