I've installed a new RPM for an in-house app we've created.
It has an upstart conf script in
[quote]/etc/init/myapp.conf[/quote]
I reloaded the initctl configuration.
[quote]sudo initctl reload-configuration[/quote]
but my job still does not show in the list. If I try to do start it....
[quote]
sudo initctl start myapp
initctl: Unknown job: myapp
[/quote]
what could I be possibly doing wrong here? Been banging my head against this for an hour.
I am running CentOS 6.4 in a VirtualBox VM created via Vagrant / Chef.
Thanks in advance...
P.S. In case it is important, here's the actual upstart file
[quote]
description "My App"
start on startup
stop on shutdown
env JAVA_HOME="/usr/lib/jvm/jre-1.7.0"
env ROOT_DIR="/opt/myapp"
env JVM_OPTIONS="-Xms64m -Xmx1024m"
# change this user if required
setuid jacek99
respawn
script
chdir $ROOT_DIR
exec $JAVA_HOME/bin/java $JVM_OPTIONS -jar -server myapp-standalone.jar server etc/myapp.yml
emit myapp_running
end script
[/quote]
Cannot see my upstart job via initctl list
-
- Posts: 10642
- Joined: 2005/08/05 15:19:54
- Location: Northern Illinois, USA
Cannot see my upstart job via initctl list
'env' ?
Perhaps you mean 'export'.
Perhaps you mean 'export'.
Re: Cannot see my upstart job via initctl list
I had not even noticed the '/etc/init' and 'initctl' before, so I peeked into /etc/init/* and they do use [b]env[/b].
All the custom services that I have, are in '/etc/init.d' and managed with 'chkconfig'.
I presume that the difference is that the /etc/init are automatically restarted should they stop?
All the custom services that I have, are in '/etc/init.d' and managed with 'chkconfig'.
I presume that the difference is that the /etc/init are automatically restarted should they stop?
Re: Cannot see my upstart job via initctl list
The version of upstart that comes with current version CentOS is pretty old (v0.6.5), and doesn't support a lot of commands including setuid. If something in your script isn't recognized, you won't receive a syntax error. Your job just won't be listed when you run "initctl list". When you try to start your job, you'll get an "Unknown job" error. There is a tool to check your upstart script for errors (init-checkconf), but it doesn't work with this version.
To run a command as a user other than root, use su or sudo rather than setuid.
To run a command as a user other than root, use su or sudo rather than setuid.
Code: Select all
description "My App"
start on startup
stop on shutdown
env JAVA_HOME="/usr/lib/jvm/jre-1.7.0"
env ROOT_DIR="/opt/myapp"
env JVM_OPTIONS="-Xms64m -Xmx1024m"
# change this user if required
env USER=jacek99
respawn
script
chdir $ROOT_DIR
exec su -c "$JAVA_HOME/bin/java $JVM_OPTIONS -jar -server myapp-standalone.jar server etc/myapp.yml" $USER
emit myapp_running
end script
Re: Cannot see my upstart job via initctl list
Is there supposed to be a leading "/" on that or is it relative to $ROOT_DIR?etc/myapp.yml