HRomie / obfs4proxy-openvpn-linux

Obfuscating OpenVPN traffic using obfs4proxy - Linux platform
MIT License
92 stars 19 forks source link

systemd service and child processes #6

Open exeral opened 1 year ago

exeral commented 1 year ago

Hello,

I am using the provided examples/obfs4proxy-openvpn.service.sample It works well for starting the service.

however I have issues when stopping:

ps wauxf before stopping the service

root      84359  0.0  0.0 115908  2312 ?        Ss   15:28   0:00 bash /usr/local/sbin/obfs4proxy-openvpn
root      84380  0.0  0.0 116172  1432 ?        S    15:28   0:00  \_ bash /usr/local/sbin/obfs4proxy-openvpn
root      84383  0.0  0.0 243384  4640 ?        S    15:28   0:00  |   \_ sudo -u obfs4-ovpn -g obfs4-ovpn /usr/bin/env TOR_PT_MANAGED_TRANSPORT_VER=1 TOR_PT_STATE_LOCATION=/var/lib/obfs4proxy-openvpn/obfs4/ TOR_PT_CLIENT_TRANSPORTS=obfs
obfs4-o+  84386  4.7  0.2 988252 18184 ?        Sl   15:28   6:01  |       \_ /usr/local/bin/obfs4proxy -enableLogging -logLevel ERROR
nobody    84433  3.7  0.0  77172  3744 ?        S    15:28   4:45  \_ openvpn --config /etc/openvpn/openvpn_client.conf.obfs4 --proto tcp-client --socks-proxy 127.0.0.1 38442 /var/lib/obfs4proxy-openvpn/socks5_auth

systemctl status before stopping the service

 Main PID: 84359 (bash)
   CGroup: /system.slice/obfs4proxy-openvpn.service
           ├─84359 bash /usr/local/sbin/obfs4proxy-openvpn
           ├─84380 bash /usr/local/sbin/obfs4proxy-openvpn
           └─84433 openvpn --config /etc/openvpn/openvpn_client.conf.obfs4 --proto tcp-client --socks-proxy 127.0.0.1 38442 /var/lib/obfs4proxy-openvpn/socks5_auth

remaining processes after stopping the service

root      84383  0.0  0.0 243384  4640 ?        S    15:28   0:00 sudo -u obfs4-ovpn -g obfs4-ovpn /usr/bin/env TOR_PT_MANAGED_TRANSPORT_VER=1 TOR_PT_STATE_LOCATION=/var/lib/obfs4proxy-openvpn/obfs4/ TOR_PT_CLIENT_TRANSPORTS=obfs4 /usr/l
obfs4-o+  84386  4.7  0.2 988252 18184 ?        Sl   15:28   6:09  \_ /usr/local/bin/obfs4proxy -enableLogging -logLevel ERROR

I have to manually kill them.

systemd is not able to recognize 84383 and 84386 as childs of the service

CentOS Linux release 7.8.2003 (Core) systemd version 219