'Ansible linux process down after start command

I've got an issue in my ansible playbook. My playbook have to reboot VM safely with stop/start process in chronological order. However, I have no issue on stop my 3 services by pointing on ksh script. But I've got a problem to stop a service with my ksh script on VM with ansible. When I run my playbook, this process down few seconds after command has been launched (this service is an JAVA service), whereas I run on VM :

su user
path/to/my/script.ksh

(same as Ansible did)

The process ran normally :/ with no interruption.

With ansible, I do:

become: true
become_user: user
command: path/to/my/script

I find another hint, my two process JAVA (Ansible/VM) are not launched with same arguments. With ansible missing some arguments and addition classpath has been called with -cp whereas on VM called with classpath.

I don't understand theses two performances :/

How can I fix my issue?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source