john_paul I am trying to figure out what I'm doing wrong. I have the following lines in my server.conf file script-security 2 client-connect /etc/openvpn/scripts/connect.sh and the connect.sh file has the following content #!/bin/bash /usr/bin/touch /tmp/connected with chmod 755 permissions on the script file. Yet when a client connects nothing appears in the /tmp/ directory. The openvpn.log file has no mention of running a client-connect script. How can I diagnose this problem? Here is my full config file (minus sensitive information) dev tun proto udp port 1194 ca /etc/openvpn/easy-rsa/pki/ca.crt cert /etc/openvpn/easy-rsa/pki/issued/********.crt key /etc/openvpn/easy-rsa/pki/private/********.key dh none topology subnet server 10.8.0.0 255.255.255.0 # Set your primary domain name server address for clients push "dhcp-option DNS 208.67.222.222" push "dhcp-option DNS 208.67.220.220" # Prevent DNS leaks on Windows push "block-outside-dns" # Override the Client default gateway by using 0.0.0.0/1 and # 128.0.0.0/1 rather than 0.0.0.0/0. This has the benefit of # overriding but not wiping out the original default gateway. client-config-dir ccd script-security 2 client-connect /etc/openvpn/scripts/connect.sh client-to-client keepalive 1800 3600 remote-cert-tls client tls-version-min 1.2 tls-crypt /etc/openvpn/easy-rsa/pki/ta.key cipher AES-256-CBC auth SHA256 user nobody group nogroup persist-key persist-tun crl-verify /etc/openvpn/crl.pem status /var/log/openvpn-status.log 20 status-version 3 syslog verb 3 #DuplicateCNs allow access control on a less-granular, per user basis. #Remove # if you will manage access by user instead of device. #duplicate-cn # Generated for use by PiVPN.io
john_paul This is the contents of /lib/systemd/system/openvpn.service [Unit] Description=OpenVPN service After=network.target [Service] Type=oneshot RemainAfterExit=yes ExecStart=/bin/true ExecReload=/bin/true WorkingDirectory=/etc/openvpn [Install] WantedBy=multi-user.target Is there something wrong with this? Thanks for the suggestion.
john_paul OK, I found it. There were several other systemd files including: /lib/systemd/system/openvpn@.service /lib/systemd/system/openvpn-server@.service which had the setting PrivateTmp=true This was causing the problem. Thanks for making me double check!