Hi,
I am trying to create an upstart script for AEM server start/stop. It spawns 11 java processes when I run it (sudo start aemservice). Any pointers to what I might be doing wrong.
Here is the script
start on runlevel[2345]
stop on runlevel[016]
respawn
env SERVER_HOME=/app/server/aem61
env JAVA_HOME=/home/abhishek/jdk1.8.0_65
env CQ_PORT=4504
script
exec>/app/log/aem_author/start.out 2>/app/log/aem_author/start.err &
PATH=$JAVA_HOME/bin:$PATH
/bin/sh $SERVER_HOME/crx-quickstart/bin/start
end script
My env: AEM 6.1, JDK 1.8
Red Hat Enterprise Linux Server release 6.4 (Santiago)
Solved! Go to Solution.
Views
Replies
Total Likes
yeah i ran it once. I think now i know why it's doing that. AEM start scripts forks another process. upstart script needs to handle that with "expect fork" line.
Without that expect fork line, upstart thinks that the parent process crashed so tries for another (default) 10 times due to the respawn stanza, hence the 11 processes.
However, I am running into another issue where if the AEM's forked process dies, upstart might not know and would consider the job still running. I guess this is for linux forums. thanks for your reply.
Views
Replies
Total Likes
abhishekb wrote...
Hi,
I am trying to create an upstart script for AEM server start/stop. It spawns 11
java processes when I run it (sudo startaemservice ). Any pointers to what I might be doing wrong.
Here is the script
start onrunlevel [ 2345]stop onrunlevel [ 016]
respawn
env SERVER_HOME=/app/server/aem61env JAVA_HOME=/home/abhishek /jdk1. 8.0_65env CQ_PORT=4504
script
exec >/app/log/aem_author/start. out 2>/app/log/aem_author/start. err &
PATH=$JAVA_HOME/bin
: $PATH
/bin /sh $SERVER_HOME/crx-quickstart /bin/startend script
My
env : AEM 6.1, JDK 1.8
Red Hat Enterprise Linux Server release 6.4 (Santiago)
Did you run "
--
Jitendra
Views
Replies
Total Likes
yeah i ran it once. I think now i know why it's doing that. AEM start scripts forks another process. upstart script needs to handle that with "expect fork" line.
Without that expect fork line, upstart thinks that the parent process crashed so tries for another (default) 10 times due to the respawn stanza, hence the 11 processes.
However, I am running into another issue where if the AEM's forked process dies, upstart might not know and would consider the job still running. I guess this is for linux forums. thanks for your reply.
Views
Replies
Total Likes
abhishekb wrote...
yeah i ran it once. I think nowi know why it's doing that. AEM start scripts forks another process.upstart script needs to handle that with "expectfork " line.
Without that expect
fork line, upstart thinks that the parent process crashed so tries for another (default) 10 times due to therespawn stanza, hence the 11 processes.
However, I am running into another issue where if the AEM's forked process dies, upstart might not know and would consider the job still running. I guess this is for
linux forums.thanks for your reply.
No problem. :)
Views
Replies
Total Likes
There is a "-nofork option that you may want to explore, (in the original start up scripts in the .../author/crx-quickstart/bin directory). If you use it, you'll probably need to use the -Xmx2048m option as well and be sure to give it enough memory/RAM. I believe one of the primary reasons the process forks is because it doesn't have enough memory.
Views
Replies
Total Likes
hmm. let me try to use that option
Views
Replies
Total Likes
Views
Likes
Replies
Views
Like
Replies