kchristensen / udm-le

Let's Encrypt support for Ubiquiti UniFi OS
MIT License
594 stars 79 forks source link

Found error/problem in udm-le.sh in connection with on-boot-script #17

Closed mastaghandi closed 3 years ago

mastaghandi commented 3 years ago

Hi!

i got your great script running to renew an lets encrypt certificate with azure dns.

after that, i installed the on-boot-script for persistant from boostchicken.

when i copy the 99-udm-le.sh into the on_boot.d folder it runs but doesn't start the unifi-os afterwards.

i changed the line 89 in the udm-le.sh from: ${PODMAN_CMD} ${LEGO_ARGS} renew --days 60 && deploy_cert && add_captive && unifi-os restart

to ${PODMAN_CMD} ${LEGO_ARGS} renew --days 60 && deploy_cert && add_captive && unifi-os

without the restart option at the end.

now it runs perfectly after reboots. dont know why this happen (im not an expert in coding) only for your information maybe you know how to correct it or why this happen. ;)

greetings!

UDM Info: (base the round one) controller 6.0.28 fw 1.8.0

kchristensen commented 3 years ago

That's odd, unifi-os starts automatically, the command unifi-os restart restarts it after it has already started during the boot process so the additional certificates you deployed take effect. Just running unifi-os would only do something (it would start unifi-os) if for whatever reason it had failed to start on boot. If I were you I'd check my system logs if this happens again to see if you can't figure out why it failed to start in the first place.

timrettop commented 3 years ago

I believe you are running up against a different bug with 1.8 firmware where unifi-os doesn't start correctly or fails starting on reboots. I have this issue regularly as well, but as far as I've been able to tell, its not because of the LE scripts. I'm having trouble finding the UI community threads, but I did read that other people have had this issue as well with 1.8 firmware.

Incidentally, 1.8.2 firmware is available now: https://community.ui.com/releases/UniFi-Dream-Machine-Firmware-1-8-2/a749e291-6fba-4955-b7b6-abfbbac9f383

Best,

On Wed, Oct 28, 2020 at 2:06 PM Kyle Christensen notifications@github.com wrote:

That's odd, unifi-os starts automatically, the command unifi-os restart restarts it after it has already started during the boot process so the additional certificates you deployed take effect. Just running unifi-os would only do something (it would start unifi-os) if for whatever reason it had failed to start on boot. If I were you I'd check my system logs if this happens again to see if you can't figure out why it failed to start in the first place.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/kchristensen/udm-le/issues/17#issuecomment-718208651, or unsubscribe https://github.com/notifications/unsubscribe-auth/AADKFYLYAWMWB7A44NJGAOTSNCBUPANCNFSM4TCENQIQ .

mastaghandi commented 3 years ago

think they have removed the 1.8.2 cause link is down :) but i will give it a try.. also with the logs.. interesting only that there is no problem when i remove the restart option...

seekerPL commented 3 years ago

think they have removed the 1.8.2 cause link is down :) but i will give it a try.. also with the logs.. interesting only that there is no problem when i remove the restart option...

You need to log-in in order to download Beta version.

mastaghandi commented 3 years ago

You need to log-in in order to download Beta version.

i am :) but no 1.8.2

seekerPL commented 3 years ago

Strange, I manage to download today.

Get Outlook for iOShttps://aka.ms/o0ukef


From: mastaghandi notifications@github.com Sent: Thursday, October 29, 2020 1:00:56 PM To: kchristensen/udm-le udm-le@noreply.github.com Cc: seekerPL seekerpl@gmail.com; Comment comment@noreply.github.com Subject: Re: [kchristensen/udm-le] Found error/problem in udm-le.sh in connection with on-boot-script (#17)

You need to log-in in order to download Beta version.

i am :) but no 1.8.2

— You are receiving this because you commented. Reply to this email directly, view it on GitHubhttps://github.com/kchristensen/udm-le/issues/17#issuecomment-718707154, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AGLYL5K5XAFZ7XBTY7H5JLLSNFKPRANCNFSM4TCENQIQ.

mastaghandi commented 3 years ago

I found the problem, why i couldn't download beta. I have to activate the Beta Option in my User Setting Account. So i will install the 1.8.2 at the weekend and try what happens with or without the restart option....

mastaghandi commented 3 years ago

ok.. same thing is happening with fw 1.8.2... in the logs i see the following, when the scripts begin to run:

user.notice unifi-os: Stopping unifi-os user.err mcad: mcad[3203]: ace_reporter_trsp_curl.check_multi_info(): inform failed with curl code 56 Oct 30 10:58:48 user.err mcad: mcad[3203]: ace_reporter.reporter_fail(): Unknown[11] (http://localhost:8080/inform) Oct 30 10:58:48 user.err mcad: mcad[3203]: ace_reporter.reporter_fail(): inform failed #1 (last inform: 4 seconds ago), rc=11 user.err mcad: mcad[3203]: ace_reporter_trsp_curl.check_multi_info(): inform failed with curl code 7 syslog.info kernel: [ 351.493148] systemd-journald[24]: Received SIGTERM from PID 1 (systemd-shutdow). Oct 30 10:58:50 user.emerg kernel: [ 351.495461] reboot: cmd=cdef0123 Oct 30 10:58:50 user.emerg kernel: [ 351.498744] reboot: called by: [ 3150]/lib/systemd/systemd-shutdown halt --timeout 90000000us --log-level 6 --log-target console --log-color Oct 30 10:58:51 user.err mcad: mcad[3203]: ace_reporter_trsp_curl.check_multi_info(): inform failed with curl code 7 Oct 30 10:58:51 user.warn kernel: [ 352.089389] IN=br0 OUT= MAC=76:ac:b9:1b:79:ee:08:12:a5:de:98:06:08:00 SRC=192.168.1.20 DST=192.168.1.1 LEN=71 TOS=0x00 PREC=0x00 TTL=64 ID=19247 DF PROTO=UDP SPT=59307 DPT=53 LEN=51 Oct 30 10:58:52 user.warn kernel: [ 352.829385] IN=eth4 OUT= MAC=74:ac:b9:1b:79:f1:10:5a:f7:76:4b:df:08:00 SRC=109.73.147.253 DST=80.123.176.162 LEN=152 TOS=0x04 PREC=0x00 TTL=120 ID=3792 DF PROTO=TCP SPT=19909 DPT=22 WINDOW=32759 RES=0x00 ACK PSH URGP=0 Oct 30 10:58:52 user.err mcad: mcad[3203]: ace_reporter_trsp_curl.check_multi_info(): inform failed with curl code 7

interesting the inform URL.. thats not what i have set...

mastaghandi commented 3 years ago

hmm.. i dont know where there is the problem.. when i remove the -restart option.. it runs.. normally.. also in log i only see the following:

'user.notice unifi-os: unifi-os is already running'

SamErde commented 3 years ago

Just to rule out one possible problem: In your last comment, @mastaghandi, you said "the -restart option" but there actually should not be a dash ( "-" ) in front of the restart command. The syntax is unifi-os restart. Hope that helps!

SamErde commented 3 years ago

Also, if you run podman ps, does it show the unifi-os container running?