#90 Improve stop and start methods
Opened by spichugi. Modified

Stop and start methods have their issues.
Start - https://pagure.io/lib389/blob/master/f/lib389/init.py#_1154
Stop - https://pagure.io/lib389/blob/master/f/lib389/init.py#_1213

It uses subprocess.check_call of "/usr/bin/systemctl". And it doesn't involve 'timeout' parameter at all.

The default service file /usr/lib/systemd/system/dirsrv@.service has next values:
TimeoutStartSec=0
TimeoutStopSec=600

So if it will hang on shutdown, we have a very long 'hang'.

THe possible solutions may be to use stop-dirst, start-dirsrv wrappers. Also, we can modify the service file with a timeout value we want.

Let's discuss it and choose the most adequate solution.


I don't want to keep using the start/stop wrappers because they just call systemctl themselves. I think that the problem here is you have our desire to test quickly, vs customers who need the server to shutdown cleanly.

If we have a test case where the shutdown takes that long and hits the timeout, we have a bigger issue IMO, so we need to leave the systemctl settings as are for customer releases.

A workaround could be during tests to put in a partial unit file into /etc to lower this.

Metadata Update from @firstyear:
- Custom field Origin adjusted to None
- Custom field Review Status adjusted to None

We have /etc/sysconfig/dirsrv.systemd specifically to override default values in systemd unit file for dirsrv, I think we can use it instead.

I don't want to keep using the start/stop wrappers because they just call systemctl themselves. I think that the problem here is you have our desire to test quickly, vs customers who need the server to shutdown cleanly.
If we have a test case where the shutdown takes that long and hits the timeout, we have a bigger issue IMO, so we need to leave the systemctl settings as are for customer releases.
A workaround could be during tests to put in a partial unit file into /etc to lower this.
We have /etc/sysconfig/dirsrv.systemd specifically to override default values in systemd unit file for dirsrv, I think we can use it instead.

Ok. So in the patch, I think, we can just add 'timeout' feature by editing /etc/sysconfig/dirsrv.systemd file.

P.S., of course, I don't propose changing it constantly. It wasn't my intentions when I was creating the issue.

Yep, I think that sounds okay to me. We should check the other content of that file, I think some tuning parameters live there too ....

Metadata