pbrah / wpa_supplicant-udmpro

110 stars 24 forks source link

podman path & command option restart unless-stopped #4

Open cwm12345 opened 4 years ago

cwm12345 commented 4 years ago

noting a couple of issues with current 1.6.6-rc.1.2428 & podman specifics:

  1. path for certs and conf should likely be /mnt/data/podman (instead of /mnt/data/docker). this needs to be reflected in the several places the path appears in the README
  2. the "--restart unless-stopped " option fails in this version w error "Error: the unless-stopped restart policy is not supported: invalid argument"
  3. logging option seems out of date: "ERRO[0000] json-file logging specified but not supported. Choosing k8s-file logging instead"
GiulianoM commented 4 years ago

Re: 2

Perhaps SystemD could handle the restarts?

https://podman.io/blogs/2018/09/13/systemd.html

I don't have a UDM Pro yet, just ordered one tonight.

fryjr82 commented 4 years ago

I changed the restart to on-failure and also changed the log-driver. No errors on my fresh podman install on 1.7.0-rc.6 using the following commands:

mkdir /mnt/data/podman/wpa_supplicant/

cp -arfv /tmp/*pem /tmp/wpa_supplicant.conf /mnt/data/podman/wpa_supplicant/

sed -i 's,ca_cert=",ca_cert="/etc/wpa_supplicant/conf/,g' /mnt/data/podman/wpa_supplicant/wpa_supplicant.conf

sed -i 's,client_cert=",client_cert="/etc/wpa_supplicant/conf/,g' /mnt/data/podman/wpa_supplicant/wpa_supplicant.conf

sed -i 's,private_key=",private_key="/etc/wpa_supplicant/conf/,g' /mnt/data/podman/wpa_supplicant/wpa_supplicant.conf

podman run --privileged=true --network=host --name=wpa_supplicant-udmpro -v /mnt/data/podman/wpa_supplicant/:/etc/wpa_supplicant/conf/ --log-driver=k8s-file --restart=on-failure -detach -ti pbrah/wpa_supplicant-udmpro:v1.0 -Dwired -ieth8 -c/etc/wpa_supplicant/conf/wpa_supplicant.conf

cwm12345 commented 4 years ago

@fryjr82 Does it come up/restart with the UDM is rebooted?

fryjr82 commented 4 years ago

I tried rebooting this AM and wpa_supplicant-udmpro wasn't running. I had to issue the start command.

podman start wpa_supplicant-udmpro

I will try some things over the weekend and report back if I can get it to 'start' on reboot. This isn't a big deal to me since I only reboot when I am updating the firmware of the UDMP.

fryjr82 commented 4 years ago

@fryjr82 Does it come up/restart with the UDM is rebooted? Well there is no way to use Init.D as Busybox wipes it out on reboot but I found a workaround by using my Ubuntu VM. Just follow bigjohn's post here: https://community.ui.com/questions/UDM-and-UDM-Pro-Does-ATT-eapproxy-method-work/cd9368b8-0496-4f2e-9b63-60c0a213096e#answer/2d80c3f0-ac1c-4d72-ad31-2264d05e8eac

boostchicken commented 4 years ago

https://github.com/boostchicken/udm-utilities/tree/master/on-boot-script

That might be of use.

DavidMonostori commented 4 years ago

https://github.com/boostchicken/udm-utilities/tree/master/on-boot-script

That might be of use.

Just saw this on reddit yesterday. Many people would love this so we don't have to fear losing internet. Only thing to clarify is that OP made this on 1.7.0, so may not work on 1.6.6

GiulianoM commented 4 years ago

https://github.com/boostchicken/udm-utilities/tree/master/on-boot-script That might be of use.

Just saw this on reddit yesterday. Many people would love this so we don't have to fear losing internet. Only thing to clarify is that OP made this on 1.7.0, so may not work on 1.6.6

I was in that same reddit thread, and the OP said it should work on 1.6.6.

I'm going to try to set it up today.

boostchicken commented 4 years ago

I am the OP. Should work on 1.6.6 just fine.

GiulianoM commented 4 years ago

Yep, works fine on 1.6.6.

Although I made a typo the first time around, using 127.0.0.1 instead of 127.0.1.1 in the SSH.

After I tried the first time with the incorrect IP address, the udm.sh and udmboot.service files disappeared from within the unifi-os container, so I'm not sure what was up with that.

I tried it a second time, and it works.

` systemctl status udmboot ● udmboot.service - Run On Startup UDM Loaded: loaded (/etc/systemd/system/udmboot.service; enabled; vendor preset: enabled) Active: inactive (dead) since Sun 2020-05-31 11:25:40 EDT; 2min 20s ago Process: 52 ExecStart=/etc/init.d/udm.sh (code=exited, status=0/SUCCESS) Main PID: 52 (code=exited, status=0/SUCCESS)

May 31 11:25:39 ubnt systemd[1]: Started Run On Startup UDM. May 31 11:25:39 ubnt systemd[1]: /etc/systemd/system/udmboot.service:4: Unknown lvalue 'After' in se ction 'Service', ignoring May 31 11:25:39 ubnt udm.sh[52]: Welcome to UbiOS May 31 11:25:39 ubnt udm.sh[52]: By logging in, accessing, or using the Ubiquiti product, you May 31 11:25:39 ubnt udm.sh[52]: acknowledge that you have read and understood the Ubiquiti May 31 11:25:39 ubnt udm.sh[52]: License Agreement and agree to be bound by its terms. May 31 11:25:40 ubnt udm.sh[52]: wpa_supplicant-udmpro May 31 11:25:40 ubnt systemd[1]: udmboot.service: Succeeded. `

boostchicken commented 4 years ago

Thanks for testing @GiulianoM