FS#11146 - [openvpn] package needs an rc script and a logrotate script
Attached to Project:
Arch Linux
Opened by David Rosenstrauch (darose) - Thursday, 07 August 2008, 21:51 GMT
Last edited by Thomas Bächler (brain0) - Thursday, 23 July 2009, 14:02 GMT
Opened by David Rosenstrauch (darose) - Thursday, 07 August 2008, 21:51 GMT
Last edited by Thomas Bächler (brain0) - Thursday, 23 July 2009, 14:02 GMT
|
Details
Like the subject says. Not sure why it doesn't have
these.
I've already created an rc script (attached). I can write a logrotate script too if needed. |
This task depends upon
Closed by Thomas Bächler (brain0)
Thursday, 23 July 2009, 14:02 GMT
Reason for closing: Fixed
Additional comments about closing: rc.d script added
logrotate? there is no default logfile I am aware of (default is syslog to /var/log/messages.log), so any user has to add it himself if he chooses to use a custom logfile.
Thursday, 23 July 2009, 14:02 GMT
Reason for closing: Fixed
Additional comments about closing: rc.d script added
logrotate? there is no default logfile I am aware of (default is syslog to /var/log/messages.log), so any user has to add it himself if he chooses to use a custom logfile.
FS#6231with a similar request. Also openvpn relatedFS#5562FS#6231, but it doesn't handle tap interfaces either. The tarball contains some init examples for gentoo, suse, etc, and they all suggest the use of a separate script for any commands that need to be run before openvpn is started i.e. for any foo.conf in /etc/openvpn, run foo.sh if it exists, then start openvpn. The given example has openvpn --mktun... as a typical use of this script. I'm inclined to go with that option, as it will keep the init script cleaner.I currently use openvpn as a client only, so I'd appreciate any additional input on this. If necessary, however, I will put something together myself - it will be going to [testing] first anyway.
Gentoo example attached.
FS#6231does way too many things like setting ip_forward on its own (potentially dangerous). My script is better because it leaves the responsibility to the parts that are supposed to be responsible for them. In my scripts, if you wanted to created a bridged VPN server, you would* Put tun in MODULES in rc.conf
* Set ip_forward in /etc/sysctl.conf if appropriate (I don't think this is even needed for bridging?)
* use conf.d/bridges to create a bridge
* set in in your conf.d/openvpn:
OPENVPN_TAP=(tap0)
* create an "up" script in /etc/openvpn with:
brctl addif NameOfTheBridge $1
ifconfig $1 up
* set in server.conf:
up /etc/openvpn/up
This sounds more logical than the other solutions, and it keeps rc.openvpn simple stupid.
Glenn - as per the gentoo example, something like
for conf in $(ls /etc/openvpn/*.conf); do
openvpn --daemon ... --config $conf
done
Guillermo's does it with a vpnX array per conf in conf.d/openvpn, making it a fair bit more complicated in the process.
In conf.d:
vpn0="--daemon openvpn0 --config /etc/openvpn/server.conf"
vpn1="--daemon openvpn1 --config /etc/openvpn/server2.conf"
OPENVPNS=(vpn0 vpn1)
In rc.d:
for vpn in ${OPENVPNS[@]}; do
eval vpncfg="\$${vpn}"
/usr/sbin/openvpn ${vpncfg} & 2> /dev/null
echo $! > /var/run/openvpn/${vpn}.pid
done
Setting up tap devices could be handled by a script that is called before the network script, so a tap device can be added to a bridge permanently. I will write something simple later.