binhex / arch-privoxyvpn

Docker build script for Arch Linux base with Privoxy and OpenVPN
GNU General Public License v3.0
113 stars 25 forks source link

Bug Report: File Occupation Issue with /root/start.sh While Handling /config/openvpn/openvpn.ovpn #40

Closed brucegraland closed 1 month ago

brucegraland commented 1 month ago

hey buddy

when I start the Docker container using the following command:

docker run  \
--cap-add=NET_ADMIN \
-p 9118:9118 --restart=always \
--name=test \
-v /root/openvpn/openvpn.ovpn:/config/openvpn/openvpn.ovpn \
-v /etc/localtime:/etc/localtime:ro \
-e VPN_ENABLED=yes \
-e VPN_PROV=custom \
-e VPN_CLIENT=openvpn \
-e VPN_USER=xxx \
-e VPN_PASS=xxx \
-e LAN_NETWORK=192.168.1.0/24 \
-e NAME_SERVERS=1.1.1.1,8.8.8.8 \
-e SOCKS_USER='' \
-e SOCKS_PASS='' \
-e ENABLE_SOCKS=yes \
-e ENABLE_PRIVOXY=no \
-e DEBUG=true \
-e UMASK=000 \
-e PUID=0 \
-e PGID=0 \
binhex/arch-privoxyvpn

I found that Docker cannot correctly start the SOCKS5 proxy. Upon checking the log files, I encountered the following error:

2024-10-22 13:50:55,328 DEBG 'start-script' stdout output:
Options error: --up script fails with '/etc/openvpn/update-resolv-conf': No such file or directory (errno=2)
Options error: Please correct this error.
Use --help for more information.

This error is due to the presence of the line up /etc/openvpn/update-resolv-conf in my OpenVPN configuration file. After further investigation, I discovered that the functionality to remove this configuration item is implemented in /root/start.sh. When I closely examined the logs, I found the following error:

2024-10-22 13:50:54,877 DEBG 'start-script' stdout output:
[info] VPN is enabled, beginning configuration of VPN

2024-10-22 13:50:54,877 INFO success: start-script entered RUNNING state, process has stayed up for > than 0 seconds (startsecs)
2024-10-22 13:50:54,877 INFO success: watchdog-script entered RUNNING state, process has stayed up for > than 0 seconds (startsecs)
2024-10-22 13:50:54,884 DEBG 'start-script' stderr output:
sed: cannot rename /config/openvpn/sedVyP7C7: Device or resource busy

2024-10-22 13:50:54,895 DEBG 'start-script' stderr output:
sed: cannot rename /config/openvpn/sedkVFCAt: Device or resource busy

2024-10-22 13:50:54,899 DEBG 'start-script' stderr output:
sed: cannot rename /config/openvpn/sedLbANhI: Device or resource busy

2024-10-22 13:50:54,903 DEBG 'start-script' stderr output:
sed: cannot rename /config/openvpn/sed7JenB9: Device or resource busy

2024-10-22 13:50:54,907 DEBG 'start-script' stderr output:
sed:
2024-10-22 13:50:54,907 DEBG 'start-script' stderr output:
cannot rename /config/openvpn/sedxyUMoF: Device or resource busy
2024-10-22 13:50:54,907 DEBG 'start-script' stderr output:

2024-10-22 13:50:54,911 DEBG 'start-script' stderr output:
sed: cannot rename /config/openvpn/sedBQVZBi: Device or resource busy

2024-10-22 13:50:54,915 DEBG 'start-script' stderr output:
sed: cannot rename /config/openvpn/sedcsRE5H: Device or resource busy

2024-10-22 13:50:54,919 DEBG 'start-script' stderr output:
sed: cannot rename /config/openvpn/sedFykJuP: Device or resource busy

2024-10-22 13:50:54,923 DEBG 'start-script' stderr output:
sed: cannot rename /config/openvpn/sedBIRxFR: Device or resource busy

2024-10-22 13:50:54,926 DEBG 'start-script' stderr output:
sed: cannot rename /config/openvpn/sedgRYfGS: Device or resource busy

2024-10-22 13:50:54,929 DEBG 'start-script' stderr output:
sed: cannot rename /config/openvpn/sedbxZ8Gc: Device or resource busy

2024-10-22 13:50:54,932 DEBG 'start-script' stderr output:
sed: cannot rename /config/openvpn/sedjHZSO6: Device or resource busy

2024-10-22 13:50:54,936 DEBG 'start-script' stderr output:
sed: cannot rename /config/openvpn/sedHHg8iE: Device or resource busy

2024-10-22 13:50:54,939 DEBG 'start-script' stderr output:
sed: cannot rename /config/openvpn/sedPHuk3b: Device or resource busy
brucegraland commented 1 month ago

When I tried to modify the config file path(-v /root/openvpn/openvpn.ovpn:/config/openvpn/openvpn.ovpn) to the directory(-v /root/openvpn/:/config/openvpn/) , everything became ok , I should really take a closer look at the documentation