首页 > linux > openvpn进程异常退出

openvpn进程异常退出

2015年2月27日 eric 发表评论 阅读评论

最近的openvpn服务异常退出了多次,由于当初为了排查问题记录大量的debug日志,导致出现问题的时候想定位问题很难,瞬间日志就被刷没了,进程掉了,瞬间启动、瞬间又掉了,导致很多订单丢了!由于日子文件记录了太多无用信息,不敢通过查日志来定位问题,开始大胆猜测:
1. openvpn 服务器(虚拟机)的 内存不够了 因为只有 2G 内存
2. I/O过高,因为日志开启了 DEBUG 的原因,大量写日志操作,
3. 打开文件描述符不够,系统默认 1024
4. 有人恶意攻击openvpn 服务

根据猜测的4点,开始应对,
1. 首选把openpvn服务器(虚拟机)内存调整到了4G,重启后发现openvpn 服务在启动后的 几分钟还是异常掉,
2. 把日志调整为 error ,openvpn 在启动后 几分钟还是异常退出了。查看日志发现是

Feb 18 17:17:42 localhost openvpn[1219]: qn_anqiu/xxx.xxx.xxx.xx:27351 CRL: cannot read: /usr/local/cine/etc/keys/crl.pem: Too many open files (errno=24) 

3. 有上面的错误日志提示,说明猜想的 第三点是对的。 执行命令:

shell $> ulimit -SHn 65535 

在启动 openvpn 进程后,正常了没有再次退出了。
4. 查看日志 发现有一个 IP 每分钟都在非正常请求 openvpn 服务器,直接在 iptables 过滤掉此IP

Feb 16 13:06:16 localhost openvpn[1219]: 58.244.191.51:47374 WARNING: Bad encapsulated packet length from peer (18245), which must be > 0 and < = 1544 -- please ensure that --tun-mtu or --link-mtu is equal on both peers -- this condition could also indicate a possible active attack on the TCP link -- [Attemping restart...]
Feb 16 13:07:21 localhost openvpn[1219]: 58.244.191.51:6043 WARNING: Bad encapsulated packet length from peer (18245), which must be > 0 and < = 1544 -- please ensure that --tun-mtu or --link-mtu is equal on both peers -- this condition could also indicate a possible active attack on the TCP link -- [Attemping restart...] 

经过上面的修改,经过两天后 openvpn 还是异常掉了一次,经过查看日志还是老问题:

Feb 18 17:17:42 localhost openvpn[1219]: qn_anqiu/xxx.xxx.xxx.xx:27351 CRL: cannot read: /usr/local/cine/etc/keys/crl.pem: Too many open files (errno=24) 

就算打开文件描述符进程也不应该掉啊,这说明是openvpn 的 BUG, crl.pem 该文件里存的是注销的证书,如果是注销的证书验证是不能通过,openvpn服务就会拒绝连接,我目前有 800多个客户端来连接,难道是每个连接都要请求该文件没有释放吗?就算没有释放65535 个文件描述符还是不够么?
为了解决问题只好修改配置文件把这个验证注销证书的参数去掉,在重启 openvpn 进程,就正常了再也没有出现过问题。具体如何产生还需要进一步观察和研究。

转载请注明:文章转载自:Eric's linux and nginx! (http://www.nginxs.com)
本文地址:http://www.nginxs.com/linux/531.html

分类: linux 标签: ,
  1. 2018年6月12日08:10 | #1

    Excellent goods from yߋu, man. I have be mindful your stuff
    previous to and you’re just extremely magnificent. I really like whаt you’ve receіved rright herе, really like what you’re
    stating and the way in which during whiⅽh yߋu aѕsert it.
    You’re making it entertainung and you conyinue too takе care of to keep it sensible.
    I can’t wait to reaɗ much more from you. This is really a great web
    site.

  2. 2018年6月12日08:24 | #2

    Hi there! Would you mind if I share your blog
    with my facebook group? There’s a lot of people that
    I think would really enjoy your content. Please let me know.
    Cheers

  3. 2018年6月12日08:42 | #3

    You made some really good points there. I looked on the net for more info about the issue and found most individuals will go along with your views
    on this web site.

  4. 2018年6月12日08:49 | #4

    I’m gone to say to my little brother, that he should also pay a visit this weblog on regular basis to obtain updated from most up-to-date information.

  5. 2018年6月12日09:02 | #5

    Hi to all, how is everything, I think every one
    is getting more from this site, and your views are fastidious in support
    of new users.

  6. 2018年6月12日09:16 | #6

    When I initially commented I seem to have clicked the -Notify me
    when new comments are added- checkbox and now whenever a comment is added I
    get four emails with the same comment. Is there an easy method you are able to
    remove me from that service? Thanks!

  7. 2018年6月12日09:35 | #7

    Thanks for a marvelous posting! I seriously enjoyed reading it, you happen to be a great author.I will make sure to bookmark your blog and will eventually come back later on.
    I want to encourage one to continue your great work,
    have a nice evening!

  8. 2018年6月12日09:38 | #8

    I am not certain where you’re getting your information, however great topic.
    I needs to spend a while learning much more or working out more.
    Thank you for great info I was on the lookout for this info for my mission.

  9. 2018年6月12日09:41 | #9

    Hello, constantly i used to check blog posts here early in the break of day,
    for the reason that i enjoy to learn more and more.

  10. 2018年6月12日11:14 | #10

    I’m not sure where you are getting your info, but great topic.

    I needs to spend some time learning much more or understanding more.
    Thanks for magnificent info I was looking for this info for my mission.

  11. 2018年6月12日11:45 | #11

    Howdy just wanted to give you a quick heads up and let
    you know a few of the pictures aren’t loading correctly.
    I’m not sure why but I think its a linking issue.
    I’ve tried it in two different internet browsers and both show
    the same results.

  12. 2018年6月12日12:29 | #12

    Don’t ask how specific models are selling in specific geographic areas, but you can ask in general whether any
    individual product is doing unexpectedly well (or poorly) in any
    specific geographic area.

  13. 2018年6月12日13:10 | #13

    Hello! This is my first visit to your blog! We are
    a collection of volunteers and starting a new project in a community
    in the same niche. Your blog provided us beneficial information to work
    on. You have done a wonderful job!

  14. 2018年6月12日14:17 | #14

    you are in point of fact a good webmaster. The site loading velocity is incredible.
    It kind of feels that you are doing any unique trick. In addition, The contents are
    masterpiece. you have performed a fantastic job on this subject!

  15. 2018年6月12日14:17 | #15

    It’s in point of fact a great and helpful piece of information.
    I’m glad that you simply shared this helpful info with us.
    Please keep us informed like this. Thank you for sharing.

  16. 2018年6月12日15:06 | #16

    What’s up to every body, it’s my first pay a quick visit of this website; this webpage contains remarkable and
    genuinely excellent data for visitors.

  17. 2018年6月12日15:08 | #17

    Asking questions are in fact good thing if you are not understanding anything entirely, however this piece of writing offers fastidious understanding even.

  18. 2018年6月12日15:16 | #18

    online casino real money
    slot game
    kasino
    casino games real money
    casino slotsslots online

  19. 2018年6月12日15:40 | #19

    I love it when folks get together and share ideas. Great website, stick
    with it!

  20. 2018年6月12日15:40 | #20

    I love it when folks get together and share ideas.
    Great website, stick with it!

  21. 2018年6月12日16:30 | #21

    Greetings! Very useful advice in this particular post! It’s the little changes that will make the biggest changes.
    Thanks a lot for sharing!

  22. 2018年6月12日16:43 | #22

    Hey there, You’ve done a fantastic job. I will definitely digg it
    and personally suggest to my friends. I am confident
    they’ll be benefited from this website.

  23. 2018年6月12日16:51 | #23

    Thanks designed for ѕharing such a good іdea, ɑrticle is nice,
    thɑts why i have read it entirely

  24. 2018年6月12日17:05 | #24

    Hi there, I log on to your blogs like every week. Your humoristic style is awesome, keep it up!

  25. 2018年6月12日17:43 | #25

    What’s Taking place i’m new to this, I stumbled upon this I have discovered It absolutely useful and it has aided me out loads.
    I’m hoping to give a contribution & help other users like its helped me.
    Great job.

  26. 2018年6月12日18:19 | #26

    Saved as a favorite, I really like your blog!

  27. 2018年6月12日18:46 | #27

    Very nice post. I simply stumbled upon your weblog and wished to
    say that I have truly loved surfing around your blog posts.
    In any case I’ll be subscribing for your feed and I
    hope you write once more soon!

  28. 2018年6月12日19:00 | #28

    What’s up, how’s it going? Just shared this post with a colleague, we had a good laugh.

  29. 2018年6月12日19:34 | #29

    Более половины пользователей моложе 25-ти лет.

  30. 2018年6月12日19:57 | #30

    Hmmm, yup no uncertainty Google is most excellent in favor of blogging except now word press is also good as a blogging because its Search engine optimization is pleasant defined already.

  31. 2018年6月12日20:13 | #31

    These are actually fantastic ideas in about blogging. You have
    touched some pleasant points here. Any way keep up wrinting.

  32. 2018年6月12日20:32 | #32

    Hello, I enjoy reading through your article. I wanted to write a
    little comment to support you.

  33. 2018年6月12日20:38 | #33

    replica oakley sunglasses Replica Oakley Sunglasses a aaaaa 11006

  34. 2018年6月12日21:25 | #34

    I pay a quick visit everyday some web sites and blogs to read articles, however this website presents feature
    based writing.

  35. 2018年6月12日21:45 | #35

    Hi, I do think this is a great website. I stumbledupon it
    ;) I will return once again since i have saved as a favorite it.
    Money and freedom is the best way to change, may you
    be rich and continue to guide other people.

  36. 2018年6月12日22:25 | #36

    When I originally commented I clicked the “Notify me when new comments are added” checkbox and now each
    time a comment is added I get several emails
    with the same comment. Is there any way you can remove people from that service?

    Cheers!

  37. 2018年6月12日22:55 | #37

    100 payday loan п»їpayday loans online same day payday loan [url=https://onlinepaydayloan.us.org ]online payday loans direct lenders[/url]

  38. 2018年6月12日23:43 | #38

    slot game
    best online casino
    online casino
    online gambling casino
    casino games real money

  39. 2018年6月13日00:08 | #39

    What’s up, yeah this piece of writing is really nice and I have learned lot of things from it about
    blogging. thanks.

  40. 2018年6月13日00:36 | #40

    Ӏ’m extremely іnsрiгеd wih your writing skills as smartly as with
    the structhre on your weblog. Is that this a paid
    subject matter or did you customize it your self?
    Eiither wayy stay upp the nice һigh quality writing, it is rawre to look a great
    blog like this one today..

  41. 2018年6月13日00:39 | #41

    Hmm it looks like your website ate my first comment (it
    was extremely long) so I guess I’ll just sum it up what I submitted and say, I’m thoroughly enjoying your blog.
    I too am an aspiring blog blogger but I’m still new to the whole thing.
    Do you have any helpful hints for novice blog writers?
    I’d definitely appreciate it.

  42. 2018年6月13日00:51 | #42

    Howdy this is kind of of off topic but I was wondering if blogs use
    WYSIWYG editors or if you have to manually code with HTML.

    I’m starting a blog soon but have no coding experience so I wanted to get advice from someone with experience.
    Any help would be greatly appreciated!

  43. 2018年6月13日01:40 | #43

    AliᎬxpress Wіgs provides unique 7A hair assortment.

  44. 2018年6月13日02:57 | #44

    Heya! I’m at ѡork surfing aгound youг blog from my new iphone!
    Jսst ѡanted tо ѕay I love reading througvh yοur blog
    and look forward to all ʏoᥙr posts! Carry on thе outstandng ᴡork!

  45. 2018年6月13日03:05 | #45

    wh0cd69496 [url=http://buyhydrochlorothiazide.us.com/]hydrochlorothiazide without a prescription[/url] [url=http://buycialis.us.org/]cheap cialis[/url] [url=http://albendazole.us.com/]albendazole 400 mg[/url] [url=http://proscar.us.com/]buy proscar[/url] [url=http://buynexium.us.com/]buy nexium[/url] [url=http://buyaugmentin.us.com/]augmentin online[/url] [url=http://buymethotrexate.us.com/]buy methotrexate[/url] [url=http://buylevaquin.us.com/]buy levaquin[/url] [url=http://acyclovirbestprice.us.com/]purchase acyclovir online[/url] [url=http://arthritistrouble.com/]celebrex over the counter[/url] [url=http://sildalis.us.com/]buy sildalis[/url]

  46. 2018年6月13日03:13 | #46

    Askng questions are truly pleasant thing if you are not understanding something fully,
    except this paragraph presents nice understandxing even.

  47. 2018年6月13日03:27 | #47

    You really make it seem so easy with your presentation but I find this matter
    to be actually something that I think I would never understand.

    It seems too complex and extremely broad foor me. I am looking forward ffor your next post,
    I’ll try to get the hang of it!

  48. 2018年6月13日03:44 | #48

    Thanks very interesting blog!

  49. 2018年6月13日04:11 | #49

    Shop thinning hair and hair loss products at
    Sephora.

  50. 2018年6月13日05:09 | #50

    casino online gambling
    casino games slots
    casino online usa
    new usa online casinos

评论分页
1 ... 33 34 35 36 37 ... 172 531
订阅评论
2+7= (必填)