OpenVoiceOS / ovos-PHAL

Apache License 2.0
0 stars 4 forks source link

Zombie ps process #30

Open goldyfruit opened 7 months ago

goldyfruit commented 7 months ago

For some reason, ovos_PHAL always has a zombie process.

goldyfr+     775  3.2  0.7 393700 63980 ?        Ssl  10:14   0:06  \_ /home/goldyfruit/.venvs/ovos/bin/python3.11 /home/goldyfruit/.venvs/ovos/bin/ovos_PHAL
goldyfr+     883  0.0  0.0      0     0 ?        Z    10:14   0:00  |   \_ [ps] <defunct>
mikejgray commented 5 months ago

Not 100% sure the differences in the implementations, but I did a little tweak on mine for ovos-mac that seemed to help:

#!/usr/bin/env python
# -*- coding: utf-8 -*-
import re
import sys
from ovos_PHAL.__main__ import main
if __name__ == '__main__':
    sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
    try:
        sys.exit(main())
    except KeyboardInterrupt:
        print("Process interrupted by user")
        sys.exit(1)

I don't think it would here necessarily, though, because systemd won't do a KeyboardInterrupt...