Portál AbcLinuxu, 21. července 2025 21:19
Fri Jan 29 08:11:44 2010 TCP/UDP: Closing socket Fri Jan 29 08:11:44 2010 route del -net 192.168.74.0 netmask 255.255.255.0 SIOCDELRT: Operation not permitted Fri Jan 29 08:11:44 2010 ERROR: Linux route delete command failed: shell command exited with error status: 7 Fri Jan 29 08:11:44 2010 route del -net 192.168.40.0 netmask 255.255.255.0 SIOCDELRT: Operation not permitted Fri Jan 29 08:11:44 2010 ERROR: Linux route delete command failed: shell command exited with error status: 7 Fri Jan 29 08:11:44 2010 route del -net 192.168.2.0 netmask 255.255.255.0 SIOCDELRT: Operation not permitted Fri Jan 29 08:11:44 2010 ERROR: Linux route delete command failed: shell command exited with error status: 7 Fri Jan 29 08:11:44 2010 route del -net 192.168.4.0 netmask 255.255.255.0 SIOCDELRT: Operation not permitted Fri Jan 29 08:11:44 2010 ERROR: Linux route delete command failed: shell command exited with error status: 7 Fri Jan 29 08:11:44 2010 route del -net 192.168.30.0 netmask 255.255.255.0 SIOCDELRT: Operation not permitted Fri Jan 29 08:11:44 2010 ERROR: Linux route delete command failed: shell command exited with error status: 7 Fri Jan 29 08:11:44 2010 route del -net 192.168.51.0 netmask 255.255.255.0 SIOCDELRT: Operation not permitted Fri Jan 29 08:11:44 2010 ERROR: Linux route delete command failed: shell command exited with error status: 7 Fri Jan 29 08:11:44 2010 route del -net 192.168.50.0 netmask 255.255.255.0 Fri Jan 29 08:11:44 2010 SIGTERM[hard,] received, process exiting Fri Jan 29 08:20:51 2010 OpenVPN 2.0.9 i486-pc-linux-gnu [SSL] [LZO] [EPOLL] built on Sep 20 2007 Fri Jan 29 08:20:51 2010 Static Encrypt: Cipher 'BF-CBC' initialized with 128 bit key Fri Jan 29 08:20:51 2010 Static Encrypt: Using 160 bit message hash 'SHA1' for HMAC authentication Fri Jan 29 08:20:51 2010 Static Decrypt: Cipher 'BF-CBC' initialized with 128 bit key Fri Jan 29 08:20:51 2010 Static Decrypt: Using 160 bit message hash 'SHA1' for HMAC authentication Fri Jan 29 08:20:51 2010 LZO compression initialized Fri Jan 29 08:20:51 2010 TUN/TAP device tun0 opened Fri Jan 29 08:20:51 2010 ifconfig tun0 172.18.0.2 pointopoint 172.18.0.1 mtu 1500 sh: ifconfig: command not foundNevim proc nedokaze najit a spustit route a ifconfig Pod rootem mi z prikazove radky prikazy /etc/init.d/openvpn stop a /etc/init.d/openvpn start zafunguji v poradku Prosim o radu
Řešení dotazu:
ps axu | grep vpn
0,10,20,30,40,50 * * * * root /usr/script/failover_skript.sh
?which ifconfig
Obvykle bývá v /sbin
, což je cesta, kterou má v $PATH
obvykle jen root, normální uživatel musí psát celou cestu. Mě ten příkaz nekolabuje, ale změna UID/GID na nobody/nogroup podle mého logu proběhne až poté, co projdou příkazy ifconfig a route - a je to celkem logické.
Vypadá to spíš na problém s cronem než na problém s vpn. Podívejte se, co po sobě nechává cron v logu.
Možná by taky bylo jednodušší, kdybyste sem hodil ten výpis z logu celý - evidentně toho tam kus není. Krom toho by se hodil i konfigurák, příslušný crontab a skript, kterým to celé spouštíte.
/etc/init.d/openvpn stop echo "`date '+%Y-%m-%d %H:%M:%S'`: Prenastaveni openvpn na primarni ..." >> /var/log/failover_log.log /bin/cp /etc/openvpn/vpn5.conf.aktiv /etc/openvpn/vpn5.conf sleep 2 /etc/init.d/openvpn startlog cronu: Jan 29 08:20:01 routervr /USR/SBIN/CRON[22411]: (root) CMD (/usr/script/failover_skript.sh) cili skript je spusten pod rootem ale openvpn se nenahodi, ztroskota to na ifconfig - log z openvpn je:
Fri Jan 29 08:11:44 2010 SIGTERM[hard,] received, process exiting Fri Jan 29 08:20:51 2010 OpenVPN 2.0.9 i486-pc-linux-gnu [SSL] [LZO] [EPOLL] built on Sep 20 2007 Fri Jan 29 08:20:51 2010 Static Encrypt: Cipher 'BF-CBC' initialized with 128 bit key Fri Jan 29 08:20:51 2010 Static Encrypt: Using 160 bit message hash 'SHA1' for HMAC authentication Fri Jan 29 08:20:51 2010 Static Decrypt: Cipher 'BF-CBC' initialized with 128 bit key Fri Jan 29 08:20:51 2010 Static Decrypt: Using 160 bit message hash 'SHA1' for HMAC authentication Fri Jan 29 08:20:51 2010 LZO compression initialized Fri Jan 29 08:20:51 2010 TUN/TAP device tun0 opened Fri Jan 29 08:20:51 2010 ifconfig tun0 172.18.0.2 pointopoint 172.18.0.1 mtu 1500 sh: ifconfig: command not found Fri Jan 29 08:20:51 2010 Linux ifconfig failed: could not execute shell command Fri Jan 29 08:20:51 2010 Exiting- pote jsem nahodil z openvpn z prikazove radky pod rootem a to proslo
Fri Jan 29 08:32:06 2010 OpenVPN 2.0.9 i486-pc-linux-gnu [SSL] [LZO] [EPOLL] built on Sep 20 2007 Fri Jan 29 08:32:06 2010 Static Encrypt: Cipher 'BF-CBC' initialized with 128 bit key Fri Jan 29 08:32:06 2010 Static Encrypt: Using 160 bit message hash 'SHA1' for HMAC authentication Fri Jan 29 08:32:06 2010 Static Decrypt: Cipher 'BF-CBC' initialized with 128 bit key Fri Jan 29 08:32:06 2010 Static Decrypt: Using 160 bit message hash 'SHA1' for HMAC authentication Fri Jan 29 08:32:06 2010 LZO compression initialized Fri Jan 29 08:32:06 2010 TUN/TAP device tun0 opened Fri Jan 29 08:32:06 2010 ifconfig tun0 172.18.0.2 pointopoint 172.18.0.1 mtu 1500 Fri Jan 29 08:32:06 2010 route add -net 192.168.1.0 netmask 255.255.255.0 gw 172.18.0.1 Fri Jan 29 08:32:06 2010 route add -net 192.168.50.0 netmask 255.255.255.0 gw 172.18.0.1 Fri Jan 29 08:32:06 2010 route add -net 192.168.51.0 netmask 255.255.255.0 gw 172.18.0.1 Fri Jan 29 08:32:06 2010 route add -net 192.168.30.0 netmask 255.255.255.0 gw 172.18.0.1 Fri Jan 29 08:32:06 2010 route add -net 192.168.4.0 netmask 255.255.255.0 gw 172.18.0.1 Fri Jan 29 08:32:06 2010 route add -net 192.168.2.0 netmask 255.255.255.0 gw 172.18.0.1 Fri Jan 29 08:32:06 2010 route add -net 192.168.40.0 netmask 255.255.255.0 gw 172.18.0.1 Fri Jan 29 08:32:06 2010 route add -net 192.168.74.0 netmask 255.255.255.0 gw 172.18.0.1 Fri Jan 29 08:32:06 2010 Data Channel MTU parms [ L:1545 D:1450 EF:45 EB:135 ET:0 EL:0 AF:3/1 ] Fri Jan 29 08:32:06 2010 Local Options hash (VER=V4): '66385af3' Fri Jan 29 08:32:06 2010 Expected Remote Options hash (VER=V4): '7f940237' Fri Jan 29 08:32:06 2010 GID set to nogroup Fri Jan 29 08:32:06 2010 UID set to nobody Fri Jan 29 08:32:06 2010 UDPv4 link local (bound): xx.xx.xx.130:5005 Fri Jan 29 08:32:06 2010 UDPv4 link remote: xx.xx.xx.41:5005 Fri Jan 29 08:32:07 2010 Peer Connection Initiated with xx.xx.xx.41:5005 Fri Jan 29 08:32:07 2010 Initialization Sequence CompletedJe videt ze u me se taky nejsdrive spousti prikazy pod root a pote se prejde n a uzivatele nobody Prosim o radu
Tiskni
Sdílej:
ISSN 1214-1267, (c) 1999-2007 Stickfish s.r.o.