12

in Ubuntu 12.10

user@xyz:~$ sudo initctl --version
initctl (upstart 1.5)
Copyright (C) 2012 Scott James Remnant, Canonical Ltd.

This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
user@xyz:~$ ls -l /etc/init/rs-comm.conf
-rw-r--r-- 1 root root 349 нояб. 15 03:22 /etc/init/rs-comm.conf
user@xyz:~$ sudo initctl reload-configuration
user@xyz:~$ sudo initctl start rs-comm
initctl: Unknown job: rs-comm

2 Answers 2

15

Your job probably contains invalid syntax, which means Upstart will not consider it. Try running the following as a normal user (not as root):

init-checkconf /etc/init/rs-comm.conf
7
  • 8
    ERROR: failed to ask Upstart to check conf file
    – xdenser
    Nov 15, 2012 at 20:54
  • 1
    it is ubuntu server w/o GUI. here is output of init-checkconf -d /etc/init/rsyslog.conf Upstart does not reply over D-Bus
    – xdenser
    Nov 15, 2012 at 21:30
  • 7
    Solved. I have noticed in debug output of init-checkconf that it asks Upstart to write answer into file in /tmp. I looked there - here they are - several files pointing on error in my job file. I have fixed that typo and now my job is seen by Upstart. There is still question why init-checkconf does not see Upstart answers.
    – xdenser
    Nov 15, 2012 at 22:54
  • 4
    @xdenser The problem with init-checkconf is most likely this issue: bugs.launchpad.net/upstart/+bug/881885
    – FvD
    Jul 13, 2013 at 21:45
  • 1
    I'm trying this in RHEL 6 and can't find any init-checkconf command to test the syntax. I've run the same upstart job in Ubuntu without an error. yum info upstart returns: Installed Packages Name : upstart Arch : x86_64 Version : 0.6.5 Release : 12.el6_4.1 Size : 550 k Repo : installed From repo : rhel-x86_64-server-6 The job ends with .conf and the file permissions look okay. Doing sudo initctl list shows all of the files in /etc/init/ except the job in question.
    – hourback
    Feb 5, 2014 at 22:09
0

On RedHat v6.8 (and probably other versions and distros) upstart will not see the new job if the filename doesn't have a .conf extension. For example, I just encountered this issue when I created an NGiNX upstart as /etc/init/nginx. initctl list | grep nginx returned nothing. initctl status nginx returned initctl: Unkown job: nginx. So, I renamed the upstart job filename to /etc/init/nginx.conf and it immediately recognized it as a new upstart job. I suspect this could affect a lot of people, so I thought I'd post it as a relevant answer.

You must log in to answer this question.

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