Hello,

I'm using Ansible in our environment to restart glassfish applications, 
services etc.,

Currently I'm facing curious issue on restarting tomcat service in our 
servers.

Whenever I execute the stop script, the tomcat service is stopped 
successfully but while trying to start the output shows success, the 
service is still down in the server.



Commands:

[automatrix@t1cogpcop01 ~]$ ansible m10 -m shell -a 'sudo su - mstrsvc 
/app/tomcat/bin/shutdown.sh' -vvv

*m10 is the group name of the server. automatrix account has sudo access to 
> "mstrsvc" account in remote server and tomcat service should be 
> stopped/started from mstrsvc only.*


<ASHADOLMCR-S02> ESTABLISH CONNECTION FOR USER: automatrix

<ASHADOLMCR-S02> REMOTE_MODULE command sudo su - mstrsvc 
/app/tomcat/bin/shutdown.sh #USE_SHELL

<ASHADOLMCR-S02> EXEC ssh -C -tt -v -o ControlMaster=auto -o 
ControlPersist=60s -o 
ControlPath="/home/automatrix/.ansible/cp/ansible-ssh-%h-%p-%r" -o 
StrictHostKeyChecking=no -o IdentityFile="/home/automatrix/.ssh/id_rsa" -o 
KbdInteractiveAuthentication=no -o 
PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey 
-o PasswordAuthentication=no -o ConnectTimeout=1 ASHADOLMCR-S02 /bin/sh -c 
'mkdir -p $HOME/.ansible/tmp/ansible-tmp-1466073513.08-167794820776673 && 
chmod a+rx $HOME/.ansible/tmp/ansible-tmp-1466073513.08-167794820776673 && 
echo $HOME/.ansible/tmp/ansible-tmp-1466073513.08-167794820776673'

<ASHADOLMCR-S02> PUT /tmp/tmpKgCn4g TO 
/home/automatrix/.ansible/tmp/ansible-tmp-1466073513.08-167794820776673/command

<ASHADOLMCR-S02> EXEC ssh -C -tt -v -o ControlMaster=auto -o 
ControlPersist=60s -o 
ControlPath="/home/automatrix/.ansible/cp/ansible-ssh-%h-%p-%r" -o 
StrictHostKeyChecking=no -o IdentityFile="/home/automatrix/.ssh/id_rsa" -o 
KbdInteractiveAuthentication=no -o 
PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey 
-o PasswordAuthentication=no -o ConnectTimeout=1 ASHADOLMCR-S02 /bin/sh -c 
'LANG=C LC_CTYPE=C /usr/bin/python 
/home/automatrix/.ansible/tmp/ansible-tmp-1466073513.08-167794820776673/command;
 
rm -rf 
/home/automatrix/.ansible/tmp/ansible-tmp-1466073513.08-167794820776673/ 
>/dev/null 2>&1'


ASHADOLMCR-S02 | success | rc=0 >>
Using CATALINA_BASE:   /app/tomcat
Using CATALINA_HOME:   /app/tomcat
Using CATALINA_TMPDIR: /app/tomcat/temp
Using JRE_HOME:        /usr/jdk/jdk1.7.0_07
Using CLASSPATH:       /app/tomcat/bin/bootstrap.jar
Using CATALINA_PID:    /app/tomcat/catalina.pid



Startup:

[automatrix@t1cogpjra01 ~]$ ansible m10 -m shell -a "sudo su - mstrsvc 
/app/tomcat/bin/startup.sh" -vvv

 [WARNING]: The version of gmp you have installed has a known issue 
regarding
timing vulnerabilities when used with pycrypto. If possible, you should 
update
it (i.e. yum update gmp).

<ASHADOLMCR-S02> ESTABLISH CONNECTION FOR USER: automatrix

<ASHADOLMCR-S02> REMOTE_MODULE command sudo su - mstrsvc 
/app/tomcat/bin/startup.sh #USE_SHELL

<ASHADOLMCR-S02> EXEC ssh -C -tt -v -o ControlMaster=auto -o 
ControlPersist=60s -o 
ControlPath="/home/automatrix/.ansible/cp/ansible-ssh-%h-%p-%r" -o 
StrictHostKeyChecking=no -o IdentityFile="/home/automatrix/.ssh/id_rsa" -o 
KbdInteractiveAuthentication=no -o 
PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey 
-o PasswordAuthentication=no -o ConnectTimeout=1 ASHADOLMCR-S02 /bin/sh -c 
'mkdir -p $HOME/.ansible/tmp/ansible-tmp-1466073302.56-93703916239176 && 
chmod a+rx $HOME/.ansible/tmp/ansible-tmp-1466073302.56-93703916239176 && 
echo $HOME/.ansible/tmp/ansible-tmp-1466073302.56-93703916239176'

<ASHADOLMCR-S02> PUT /tmp/tmprJ4Yvq TO 
/home/automatrix/.ansible/tmp/ansible-tmp-1466073302.56-93703916239176/command

<ASHADOLMCR-S02> EXEC ssh -C -tt -v -o ControlMaster=auto -o 
ControlPersist=60s -o 
ControlPath="/home/automatrix/.ansible/cp/ansible-ssh-%h-%p-%r" -o 
StrictHostKeyChecking=no -o IdentityFile="/home/automatrix/.ssh/id_rsa" -o 
KbdInteractiveAuthentication=no -o 
PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey 
-o PasswordAuthentication=no -o ConnectTimeout=1 ASHADOLMCR-S02 /bin/sh -c 
'LANG=C LC_CTYPE=C /usr/bin/python 
/home/automatrix/.ansible/tmp/ansible-tmp-1466073302.56-93703916239176/command; 
rm -rf 
/home/automatrix/.ansible/tmp/ansible-tmp-1466073302.56-93703916239176/ 
>/dev/null 2>&1'

ASHADOLMCR-S02 | success | rc=0 >>
Using CATALINA_BASE:   /app/tomcat
Using CATALINA_HOME:   /app/tomcat
Using CATALINA_TMPDIR: /app/tomcat/temp
Using JRE_HOME:        /usr/jdk/jdk1.7.0_07
Using CLASSPATH:       /app/tomcat/bin/bootstrap.jar
Using CATALINA_PID:    /app/tomcat/catalina.pid
Existing PID file found during start.
Removing/clearing stale PID file.


Though it shows success, the service isn't started in the server and the 
mystery no logs found in tomcat logs when we attempt to start the service, 
whereas stop attempt are clearly captured.

If I execute the same shell arguments directly in the server, it works 
fine. What could be the issue while executing the startup script?

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/0b6261b9-20b0-4845-863b-efba10014234%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to