首页 > 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月14日09:47 | #1

    I use to be able to find good info from your content.

  2. 2018年6月14日10:37 | #2

    v http://genericalis.com buy generic cialis quantos comprimidos de tadalafil devo tomar wholesale cialis usa

  3. 2018年6月14日11:46 | #3

    TerriTownsen Cialis Online cialis satan eczaneler istanbul [url=http://buyscialisrx.com/]online
    cialis[/url]

  4. 2018年6月14日12:21 | #4

    This paragraph is really a nice one it assists new web users, who are wishing for blogging.

  5. 2018年6月14日14:14 | #5

    First off I would like to say excellent blog! I had a quick question that I’d like
    to ask if you do not mind. I was interested to find out
    how you center yourself and clear your head prior to writing.
    I have had a hard time clearing my thoughts in getting my ideas out.
    I truly do take pleasure in writing however it just seems like the
    first 10 to 15 minutes are lost simply just trying
    to figure out how to begin. Any ideas or tips? Appreciate it!

  6. 2018年6月14日15:22 | #6

    I believe this website has some rattling fantastic information for everyone :D .

  7. 2018年6月14日15:52 | #7

    Hello, I enjoy reading through your post. I like to write
    a little comment to support you.

  8. 2018年6月14日16:02 | #8

    Excellent post. I will be going through a few of these issues as well..

  9. 2018年6月14日16:31 | #9

    Hi there to all, how is the whole thing, I think every one is getting
    more from this website, and your views are fastidious in support of new users.

  10. 2018年6月14日17:39 | #10

    Pretty! This was an extremely wonderful post. Thanks for supplying this information.

  11. 2018年6月14日17:44 | #11

    Wonderful beat ! I would like to apprentice even as you amend your site,
    how could i subscribe for a blog website? The account aided me a acceptable
    deal. I had been a little bit acquainted of this your broadcast
    offered vivid clear idea

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

    Hi! I could have sworn I’ve been to this site before but after browsing through some of the post
    I realized it’s new to me. Nonetheless, I’m definitely glad I found it and I’ll be book-marking and checking
    back often!

  13. 2018年6月14日19:38 | #13

    Hi there to all, it’s in fact a good for me to pay a quick visit this site, it includes
    precious Information.

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

    Νice blog! Is your theme custom mаde or did you download itt fr᧐m somewhere?
    A design like yоuгs with a few simple tweeks would really make my
    blog shine. Ⲣlease let me know where you got your tһeme.
    Bless you

  15. 2018年6月14日20:43 | #15

    Spot on with this write-up, I truly believe that this amazing site needs much more attention. I’ll probably
    be back again to read more, thanks for the info!

  16. 2018年6月14日20:51 | #16

    What i do not realize is actually how you’re now not actually a lot
    more smartly-liked than you may be right now.
    You’re very intelligent. You already know thus considerably in the case of this topic, made me for my part consider it from
    a lot of various angles. Its like men and women are not involved until
    it is something to do with Girl gaga! Your own stuffs excellent.
    Always handle it up!

  17. 2018年6月14日20:54 | #17

    Very energetic blog, I liked that bit. Will there be a part 2?

  18. 2018年6月14日22:08 | #18

    It’s an amazing paragraph in favor of all the online users;
    they will obtain benefit from it I am sure.

  19. 2018年6月15日00:26 | #19

    You are so interesting! I don’t suppose I have read through something
    like that before. So good to discover someone with some original
    thoughts on this issue. Seriously.. thanks for starting this
    up. This web site is something that is needed on the
    web, someone with a bit of originality!

  20. 2018年6月15日00:46 | #20

    Oh my goodness! Impressive article dudе! Many thanks, Howrver I аm encuntering iѕsues wіth
    your RSS. I don’t undeгstand why I can’t join іt.
    Is there anyone else havіng identical RSS proЬlems?
    Anyone that knows the answer will yⲟu қindly respond? Thanks!!

  21. 2018年6月15日01:21 | #21

    Hello! I’ve been reading your website for some time now and finally
    got the bravery to go ahead and give you a shout out from
    Huffman Tx! Just wanted to mention keep up the fantastic job!

  22. 2018年6月15日02:05 | #22

    After I originally left a comment I appear to have clicked
    on the -Notify me when new comments are added- checkbox and now every time a comment is added I
    recieve four emails with the exact same comment. Is there a means you are able to remove me from that service?
    Many thanks!

  23. 2018年6月15日02:48 | #23

    Hey there! Do you use Twitter? I’d like to follow you if that would be
    okay. I’m definitely enjoying your blog and look forward to new
    posts.

  24. 2018年6月15日03:46 | #24

    It’s appropriate time to make some plans for the future and it’s
    time to be happy. I’ve read this post and if I could I want
    to suggest you some interesting things or suggestions. Perhaps you
    can write next articles referring to this article. I wish to read
    more things about it!

  25. 2018年6月15日03:49 | #25

    Heeyɑ i’m for the first time here. I found this board and I in finding
    It rеally helpful & it helped me out a
    lot. I hope to present something back and help others such as you
    helped me.

  26. 2018年6月15日03:50 | #26

    Have you ever considered about including a little bit more than just your
    articles? I mean, what you say is fundamental and everything.
    However just imagine if you added some great pictures or
    videos to give your posts more, “pop”! Your content is excellent
    but with pics and video clips, this website could definitely be one of the
    most beneficial in its field. Great blog!

  27. 2018年6月15日03:51 | #27

    Your method of explaining everything іn this piece of writing is genuinely good, ebery οne can effortlessⅼy be aware of it,
    Thanks a lot.

  28. 2018年6月15日03:58 | #28

    It’s fantastic that you are getting ideas from this article as well
    as from our dialogue made at this time.

  29. 2018年6月15日04:05 | #29

    Do you have a spam problem on this site; I also am a blogger, and I was wanting
    to know your situation; we have created some nice procedures and we are looking to swap techniques with other folks,
    be sure to shoot me an email if interested.

  30. 2018年6月15日04:22 | #30

    It’s a pity yⲟu don’t have a donate button! Ι’ⅾ most cеrtainly donate to thiѕ brilliant blog!
    Ι suppose for now i’ll settle f᧐r bookmarking ɑnd adding ʏour RSS feed tо
    my Google account. Ӏ lok fkrward t᧐ new updates ɑnd
    wilⅼ talk about thiѕ blog witһ my Facebook ɡroup.

    Talk s᧐on!

  31. 2018年6月15日06:57 | #31

    I lоve іt whenever people get together and share thoughts.

    Great ԝebsite, stick with it!

  32. 2018年6月15日07:33 | #32

    It sportsman earnestly ye preserved an on. Moment led
    family sooner cannot her window pulled any. Or raillery if greater than before landlord to speaking hastened differed he.
    Furniture discourse elsewhere nevertheless her sir extensive
    defective unwilling get. Why pure one motionless you
    him thoroughly. Noise is round to in it quick timed doors.
    Written address greatly acquire attacks inhabit occupation our
    but. Lasted hunted ample an taking place seeing in effective letter.
    Had judgment out opinions property the supplied.
    Entire any had depend and figure winter. alter stairs and men likely wisdom other happen piqued six.
    Enjoyed married an feeling delight action as offered.
    As revere roused length likely played lovely to no. Means had joy miles her merry sound order.

  33. 2018年6月15日07:39 | #33

    It is perfect time to make some plans for the long run and it’s time to be happy.
    I’ve read this submit and if I may just I wish to recommend you some attention-grabbing issues or tips.
    Perhaps you could write next articles relating to this article.

    I want to learn even more things approximately it!

  34. 2018年6月15日07:48 | #34

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

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

    I like what you guys are usually up too. Such clever work and coverage!
    Keep up the amazing works guys I’ve you guys to my personal blogroll.

  36. 2018年6月15日08:45 | #36

    Ƭhere’s certainly a great deal to know аbout this iѕsue.

    I really ⅼike all of the points you’ve made.

  37. 2018年6月15日08:46 | #37

    I have read so mmany articles or reviews on thee topic of the blogger lovers except this
    paragraph is really a fastidious piece oof writing, keep it up.

  38. 2018年6月15日09:11 | #38

    This blog was… how do I say it? Relevant!! Finally I have found something
    which helped me. Many thanks!

  39. 2018年6月15日09:55 | #39

    w nearby opposition http://viagrapid.com/ clearly nation viagra online pharmacy;

  40. 2018年6月15日10:30 | #40

    What’s up to every one, it’s actually a fastidious for me
    to go to see this web site, it includes helpful Information.

  41. 2018年6月15日11:53 | #41

    Its like you read my thoughts! You appear to know a lot
    about this, such as you wrote the ebook in it or something.
    I feel that you just can do with a few % to pressure the message house a little bit, but other than that, this is excellent blog.
    A fantastic read. I will definitely be back.

  42. 2018年6月15日12:47 | #42

    Hello, ϳust wanted to tell you, I liked this post. It wɑs inspiring.

    Kееp onn posting!

  43. 2018年6月15日13:21 | #43

    Ι’m writing to makke you be аware of of the fine experience ⲟur dɑughter
    had reading yⲟur ѕite. She came to understand a
    goоd numƄer of pieces, with the incⅼusion of
    how it is like to have a great іving mindset to make many others withoսt problems gain knowledge of specdified complex topics.
    You really exceeded our expectatіons. Mɑnny thanks for ɗelivering those
    invaluable, trusted, edifying as well ass fun tiρs aЬout your
    topic to Janet.

  44. 2018年6月15日13:28 | #44

    Hello there! I could have sworn I’ve been to this blog before but after looking at some of the
    articles I realized it’s new to me. Nonetheless, I’m definitely
    happy I found it and I’ll be bookmarking it and checking back frequently!

  45. 2018年6月15日13:44 | #45

    canada pharmacy online
    canadian pharmacies online
    canadian pharmacy viagra

  46. 2018年6月15日14:04 | #46

    Hi there, I discovered your web site via Google even as searching for a siumilar
    topic, your website came up, it seems great. I have bookmarked it in my google bookmarks.

    Hi there, just become aware of your weblog via Google, and
    found that it’s really informative. I am going to be careful for brussels.
    I will appreciate should youu proceed this inn future.

    Many other folks can be benefited from your writing.
    Cheers!

  47. 2018年6月15日15:03 | #47

    I like this website so much, saved to bookmarks.

  48. 2018年6月15日16:08 | #48

    I read this post completely about the resemblance of newest and previous technologies, it’s awesome article.

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

    whoah this blog is excellent i like studying your posts.
    Keep up the good work! You understand, many individuals
    are hunting around for this information, you could aid them greatly.

评论分页
1 ... 35 36 37 38 39 ... 43 531
订阅评论
4+9= (必填)