RHEL6 SELinux Upstart - How to reload configuration /etc/init/<conf> without a restart?

Latest response

 A new Upstart (0.6.5) job is created in the /etc/init/<conf-file>.  The process starts when manually called. However, when any attempts are made to call the job from initctl it results in the following:

 

initctl start <name>

 

initctl: Unknown job:

 

 

intictl list  ---does not display my job

 

initctl reload-configuration ---does not appear to help.

 

init q --does not work

 

telinit q/Q -- does not work

 

Reading the man page it seem like Upstart is supposed to watch for changes in the initctl but the reload-configuration should force it anyway.  I am stuck and no I cannot just restart the host which would likely fix the issue.

 

       reload-configuration

              Requests that the init(8) daemon reloads its configuration.

              This command is generally not necessary since init(8) watches its configuration directories with inotify(7)  and  automatically  reloads  in
              cases of changes.

              No jobs will be started by this command.

 

 

Thanks in advance,

 

Michael Barbere

Responses

I'm also running into this.  Did you find a solution?

Me too, what I had to do was initctl list, find the job, do initctl stop , then removed the conf file from /etc/init, because initctl reload-configuration did not seem to do the job properly (neither did telinit q). The service was still listed even though I removed the conf file. Now initctl list does not show the service, as it shouldn't.

Which isn't exactly the same problem, but it was the only way I could get upstart to recognize my configuration change, which was to remove a service.

Try using "strace" with each method and note the differences.

strace initctl start <name>

And whatever manual way you run this, put "strace" in front of it.

Perhaps run 'script -a' to record all output for both methods, then compare.

# script -a /root/method1.txt
# echo run the first method
# echo use ctrl-d to break this and try the other method

Then do the same as above, only use /root/method2.txt for the next

# script -a /root/method2.txt
# echo run the second method
# echo use ctrl-d to break this and try the other method

Last, compare both output files.

Hopefully this will give you some useful info when you compare the way that works against the way that does not work.

Fascinating. Today, I encountered the same problem on a RHEL 6.5 system using this version of upstart (upstart-0.6.5-12.el6_4.1.x86_64). Likewise, a new file is placed into /etc/init but nothing seems to get upstart to recognize the new file.

@R. Hinton: your answer seems to be to a completely different question. The problem is that upstart/initctl simply doesn't see the file at all. Further, the strace is completely useless here, since really, that problem is a communication shell for the daemon.

Hi Otheus,

Sorry the strace did not assist you, however when I ran strace against a restart of a valid initctl known job (for example, today), it did for me provide a lot of verbose output. The next question, is that output useful at all.

I've not used initctl much, but just a thought (and you may have already done this) try "-v" or "--verbose" according to "initctl --help". (see next post, sorry if there's not much help here)

strace helps me a lot in other circumstances. Just not this one. To the OP, you could use strace to attach to the init process; something like "strace -e open -p1". In another terminal, you do "initctl reload-configuration". Then you will see all the files that upstart-init opens, namely, /etc/init.conf and all the files in /etc/init.

I solved my own problem. It probably is applicable to almost no one else. Hint: upstart's init will not work in a chroot'd environment.

Mike Barbere (original poster, and anyone else),

I noticed in the man page that "reload-configuration" states "this command is generally not necessary since init(8) watches its configuration directories with inotify(7) and automatically reloads in case of changes."

Added - apologies if this is not useful, I've not really used or had an occasion to pursue initctl on Red Hat Linux for RHEL 6

Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.