<p dir="ltr">I debugged this further .<br>
And this turned out to be issue with our script in ExecStop.<br>
Thanks for comments </p>
<div class="gmail_quote">On May 20, 2016 8:16 PM, "Lennart Poettering" <<a href="mailto:lennart@poettering.net">lennart@poettering.net</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On Wed, 18.05.16 20:38, Pradeepa Kumar (<a href="mailto:cdpradeepa@gmail.com">cdpradeepa@gmail.com</a>) wrote:<br>
<br>
> sorry for not being clear earlier.<br>
>  may be i am not explaining properly.<br>
><br>
> In XYZ.service:<br>
> ExecStop: myscript1<br>
><br>
> $cat myscript1<br>
> echo "inside myscript1"<br>
><br>
><br>
> and<br>
><br>
> The sequence in jounrnalctl logs are:<br>
><br>
>  May 18 01:18:06 machine1 systemd[1]: Stopping "XYZ service"...<br>
> ...<br>
>  May 18 01:18:46 machine1  myscript1[3941]: inside myscript1<br>
><br>
> As you can see, the beginning of execution of myscript1 took 40 sec.<br>
<br>
So you are saying that systemd reports that it is starting your script<br>
40 seconds before your script is actually started?<br>
<br>
If so, this would suggest that something hangs in the time systemd forks<br>
off your stop script, but before exec() is actually called for<br>
it. This could be an NSS look-up done due to User= or Group=, or a PAM<br>
intraction done via PAM= or so.<br>
<br>
How precisely does your full service file look like?<br>
<br>
Lennart<br>
<br>
--<br>
Lennart Poettering, Red Hat<br>
</blockquote></div>