OPNsense
  • Home
  • Help
  • Search
  • Login
  • Register

  • OPNsense Forum »
  • English Forums »
  • General Discussion »
  • restarting unbound by cron
« previous next »
  • Print
Pages: [1]

Author Topic: restarting unbound by cron  (Read 7855 times)

JL

  • Newbie
  • *
  • Posts: 31
  • Karma: 0
    • View Profile
    • commandline services
restarting unbound by cron
« on: August 20, 2018, 03:02:37 pm »
Because of recurring performance issues with unbound i think it is wise to restart the service every n hours.

I could not find the way to configure this from the web interface or in the manual pages.

Please advise.


Thank you
Logged

mtn406

  • Newbie
  • *
  • Posts: 11
  • Karma: 0
    • View Profile
Re: restarting unbound by cron
« Reply #1 on: October 17, 2018, 12:53:28 am »
Bump. Same problem. Thanks!
Logged

mtn406

  • Newbie
  • *
  • Posts: 11
  • Karma: 0
    • View Profile
Re: restarting unbound by cron
« Reply #2 on: November 12, 2018, 10:23:43 pm »
Bump, please. This is becoming a significant issue for us and requires manual restart of unbound at least daily.
Logged

Ricardo

  • Full Member
  • ***
  • Posts: 225
  • Karma: 11
    • View Profile
Re: restarting unbound by cron
« Reply #3 on: November 27, 2018, 12:58:47 pm »
Check this:

https://github.com/opnsense/core/issues/2894

the command to restart unbound is "/usr/local/sbin/pluginctl dns", just add it to /etc/crontab (the next firmware update will overwrite crontab, but if you're looking for a solution until unbound is updated that's probably it)
Logged

mtn406

  • Newbie
  • *
  • Posts: 11
  • Karma: 0
    • View Profile
Re: restarting unbound by cron
« Reply #4 on: January 24, 2019, 04:20:47 pm »
Confirmed, this is still an issue on:

OPNsense 18.7.10_3-amd64
FreeBSD 11.1-RELEASE-p18
OpenSSL 1.0.2q 20 Nov 2018

We are having to manually restart unbound on average at least once a day.
Logged

mtn406

  • Newbie
  • *
  • Posts: 11
  • Karma: 0
    • View Profile
Re: restarting unbound by cron
« Reply #5 on: January 24, 2019, 10:17:13 pm »
Working from this thread and the following posts: https://forum.opnsense.org/index.php?topic=2263.0 and http://kb.unixservertech.com/other/networking/opnsense/cron-jobs I was able to create the following and get everything to work from the command line, and schedule via the Cron GUI, but it is still failing to run via the Cron GUI  ???

Here are the steps I followed, please help me understand where I failed.

Use vi to create file:
Code: [Select]
root@opnsense:~ # vi /usr/local/opnsense/service/conf/actions.d/actions_unbound_restart.conf
Information in file:
Code: [Select]
[restart]
command:/usr/local/sbin/pluginctl dns
parameters:
type:script
message:Restart Unbound DNS Service
description:Restart Unbound DNS Service

Restart configd service:
Code: [Select]
root@opnsense:~ # service configd restart
Stopping configd...done
Starting configd.

Verify new action file works as expected:
Code: [Select]
root@opnsense:~ # configctl unbound_restart restart
OK

Next I went to Services:Unbound DNS:Log File and the logs show Unbound restarted successfully.
Code: [Select]
Date                Message
Jan 24 16:01:29     unbound: [67123:0] info: start of service (unbound 1.8.3).

Then I did this to ensure it would show up in the OPNsense GIU:
Code: [Select]
root@opnsense:~ # /usr/local/etc/rc.restart_webgui
Starting web GUI...done.
Generating RRD graphs...done.

I then went to System:Settings:Cron and created a cron job (image attached):

But when the time comes for it to run and I then check Services:Unbound DNS:Log File I do not see that it has restarted.

Please help.

Thanks!
Logged

mtn406

  • Newbie
  • *
  • Posts: 11
  • Karma: 0
    • View Profile
Re: restarting unbound by cron
« Reply #6 on: January 24, 2019, 10:18:06 pm »
Screenshot
Logged

franco

  • Administrator
  • Hero Member
  • *****
  • Posts: 13633
  • Karma: 1174
    • View Profile
Re: restarting unbound by cron
« Reply #7 on: January 25, 2019, 11:12:10 pm »
Are you guys with crashing Unbound using:

[ ] LibreSSL
[ ] DNS over HTTPS (manual options)
[ ] DNS over TLS (manual options)


Cheers,
Franco
Logged

mtn406

  • Newbie
  • *
  • Posts: 11
  • Karma: 0
    • View Profile
Re: restarting unbound by cron
« Reply #8 on: January 26, 2019, 06:25:42 pm »
My apologies, we have no idea why unbound keeps dying. If you can direct me where to look or which log files to post I will. Attached is a screenshot of our unbound config page. I do not think we are running LibreSSL as it is not selected in the firmware page, screenshot also attached.

OPNsense 18.7.10_3-amd64
FreeBSD 11.1-RELEASE-p18
OpenSSL 1.0.2q 20 Nov 2018

Many thanks!
« Last Edit: January 26, 2019, 06:44:25 pm by mtn406 »
Logged

franco

  • Administrator
  • Hero Member
  • *****
  • Posts: 13633
  • Karma: 1174
    • View Profile
Re: restarting unbound by cron
« Reply #9 on: January 30, 2019, 12:37:16 pm »
It could be an unstable WAN causing this... unstable in general or IPv6 in particular. Make sure to disable IPv6 if you don't have connectivity from your ISP and watch out for the system log restarting the WAN interface.

In general, crashes for Unbound need to be reported with Unbound authors. We can deal with configuration errors, but not with segmentation faults without touching code we shouldn't touch.


Cheers,
Franco
Logged

mtn406

  • Newbie
  • *
  • Posts: 11
  • Karma: 0
    • View Profile
Re: restarting unbound by cron
« Reply #10 on: January 30, 2019, 09:23:45 pm »
Ok, we will investigate this, thank you!
Logged

  • Print
Pages: [1]
« previous next »
  • OPNsense Forum »
  • English Forums »
  • General Discussion »
  • restarting unbound by cron
 

OPNsense is an OSS project © Deciso B.V. 2015 - 2023 All rights reserved
  • SMF 2.0.19 | SMF © 2021, Simple Machines
    Privacy Policy
    | XHTML | RSS | WAP2