Temat: Problem z openvpn i cronem
Witam,
Mam dziwny problem a w zasadzie 2
1 to to, ze w cronie wkolko dodaje mi sie 2 wpisy
* * * * * if [ -z "$(ifconfig | grep tun 2>/dev/null)" ] ; then logger "openvpn stopped, restarting" ; /etc/init.d/openvpn restart ; fi
i czasami 1 czasami 2 wpisy
* * * * * if [ -z "tun0 Link encap:UNSPEC HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00 " ] ; then logger "openvpn stopped, restarting" ; /etc/init.d/openvpn restart ; fi
nie wiem skad to dokladnie sie bierze ?
czy cos gdzies mam nadmiarowo - co za te wpisy odpowiada, aby wyczyscic ten restart z wczesniejszych releasow GG ?
Czy to moze problem gdzies jest w skrypcie openvpn.firewall
.....
have_watchdog=$( grep "ifconfig.*tun.*init.*openvpn" /etc/crontabs/root )
if [ "$enabled" == "1" ] ; then
if [ -z "$have_watchdog" ] ; then
echo '* * * * * if [ -z "$(ifconfig | grep tun 2>/dev/null)" ] ; then logger "openvpn stopped, restarting" ; /etc/init.d/openvpn restart ; fi' >> /etc/crontabs/root
fi
else
if [ -n "$have_watchdog" ] ; then
cat /etc/crontabs/root | grep -v "ifconfig.*tun.*init.*openvpn" > "$tmp_cron"
mv "$tmp_cron" /etc/crontabs/root
fi
fi
.....2 problem to juz omawiany
http://eko.one.pl/forum/viewtopic.php?id=4678&p=2
i problem z
Gargoyle daemon.err openvpn(custom_config)[3056]: TCP/UDP: Socket bind failed on local address [undef]: xxxx : Address already in use
Mam wykozrzystane wszystkie port rj-45 w tym 2 wany mwan3 - i tu tez zagwostka po podlaczeniu 4 lan podnosi on polaczenie na 10 M inne na 100 przy poprzednio bylo tak ze 1 podnosil sie nawet na 1 G reszta na 100 M
Czasami openvpn nie podnosi sie albo nie ma routingu do sieci lokalnej czasami jest
czy mozliwe jest ze router sie na maxa juz dociazyl i nie wyrabia z obrobieniem wszystkiego na raz ?
Zrob ilem narazie cos takiego w
/etc/hotplug.d/iface/27-openvpn
....
sleep 20
/sbin/ifconfig tun0 0.0.0.0 down > /dev/null 2>&1
sleep 5
/etc/init.d/openvpn restart
....chodz za ten komunikat i problem z openvpn podejzewam tego crona.
Moze to jakis blad w funkcji pluginu do creona, po wcisnieciu klawisza zapisz w tym pluginie odrazu pojawia mi sie ten wpis z "tun 0.0.0.0 ...
moze to ta funkcja w JS w pluginie cron szwankuje
function saveChanges()
{
taskTable = document.getElementById('task_table_container').firstChild;
tableData = getTableDataArray(taskTable, true, false);
createCommands = [ "touch /etc/crontabs/root", "rm /etc/crontabs/root" ];
taskTableData = new Array();
for (rowIndex in tableData)
{
rowData = tableData[rowIndex];
createCommands.push("echo \"" + rowData[0].replace(/"/g,"\\\"") + "\" >> /etc/crontabs/root");
}
var commands = createCommands.join("\n");
var param = getParameterDefinition("commands", commands) + "&" + getParameterDefinition("hash", document.cookie.replace(/^.*hash=/,"").replace(/[\t ;]+.*$/, ""));
setControlsEnabled(false, true, UI.Wait);
var stateChangeFunction = function(req)
{
if(req.readyState == 4)
{
setControlsEnabled(true);
resetData();
}
}
runAjax("POST", "utility/run_commands.sh", param, stateChangeFunction);
}