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
pino42
  • 915
  • 5
  • 11
xdenser
  • 123
  • 1
  • 1
  • 4

2 Answers2

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
jamesodhunt
  • 849
  • 5
  • 4
  • 8
    `ERROR: failed to ask Upstart to check conf file` – xdenser Nov 15 '12 at 20:54
  • 1
    it is ubuntu server w/o GUI. [here](http://pastebin.com/7aJ3uDA6) is output of `init-checkconf -d /etc/init/rsyslog.conf` Upstart does not reply over D-Bus – xdenser Nov 15 '12 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 '12 at 22:54
  • 4
    @xdenser The problem with init-checkconf is most likely this issue: https://bugs.launchpad.net/upstart/+bug/881885 – FvD Jul 13 '13 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 05 '14 at 22:09
  • 1
    A-ha! `tail`ing `/var/log/messages` showed `Feb 5 17:06:24 da-host init: /etc/init/blah.conf:13: Unknown stanza`. Progress! Now I can debug. – hourback Feb 05 '14 at 22:44
  • In a headless environment: Use `export DISPLAY=:0`, then use the verbose/debug `-d` flag: `init-checkconf -d /etc/init/your-service.conf`. – kaiser Jan 19 '16 at 15:53
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.

dcarrith
  • 141
  • 3