FS#26985 - [openvpn] init script "status" and "vpn_name" options
Attached to Project:
Arch Linux
Opened by Borja Ruiz (borja.ruiz) - Thursday, 17 November 2011, 23:55 GMT
Last edited by Allan McRae (Allan) - Friday, 16 November 2012, 12:10 GMT
Opened by Borja Ruiz (borja.ruiz) - Thursday, 17 November 2011, 23:55 GMT
Last edited by Allan McRae (Allan) - Friday, 16 November 2012, 12:10 GMT
|
Details
Description:
openvpn init script do not privide a "status" option, so manual checked via cmd line is required (embarrasing if a host is running multiple vpn's). Also,by default, openvpn script starts/stops all vpn's .conf config files present in /etc/openvpn A nice feature would be to have control "per vpn", by using the init script like this: /etc/rc.d/openvpn <start|stop|status|restart> [vpn_name] Note: see attached modification of openvpn init script implementing the requested features. Additional info: * package version(s) arch openvpn # openvpn --version OpenVPN 2.2.1 x86_64-unknown-linux-gnu [SSL] [LZO2] [EPOLL] [eurephia] built on Aug 13 2011 Originally developed by James Yonan Copyright (C) 2002-2010 OpenVPN Technologies, Inc. <sales@openvpn.net> $ ./configure --prefix=/usr --enable-password-save --mandir=/usr/share/man --enable-iproute2 Compile time defines: ENABLE_CLIENT_SERVER ENABLE_DEBUG ENABLE_EUREPHIA ENABLE_FRAGMENT ENABLE_HTTP_PROXY ENABLE_MANAGEMENT ENABLE_MULTIHOME ENABLE_PASSWORD_SAVE ENABLE_PORT_SHARE ENABLE_SOCKS USE_CRYPTO USE_LIBDL USE_LZO USE_SSL arch openvpn # * config and/or log files: N/A Steps to reproduce: none needed (default instalation) |
This task depends upon
Closed by Allan McRae (Allan)
Friday, 16 November 2012, 12:10 GMT
Reason for closing: Won't fix
Additional comments about closing: Move to systemd
Friday, 16 November 2012, 12:10 GMT
Reason for closing: Won't fix
Additional comments about closing: Move to systemd
Main initscript is /etc/rc.d/openvpn and main config is /etc/openvpn/openvpn.conf
If you want to create an alternative config you just create a symlink of /etc/rc.d/openvpn. For example:
config: /etc/openvpn/myCompany.conf
symlink: /etc/rc.d/openvpn.myCompany -> /etc/rc.d/openvpn
Status is also implemented: /etc/rc.d/openvpn.myCompany status
EDIT: Modified the initscript in a better way ;)
/etc/rc.d/openvpn has the old function (starting/stopping every conf in /etc/openvpn) but I added the status function.
If you symlink /etc/rc.d/openvpn to /etc/rc.d/openvpn.myCompany and a config /etc/openvpn/myCompany.conf exists /etc/rc.d/openvpn.myCompany will start, stop and get status for the myCompany VPN
openvpn.rc (2 KiB)