unifios-utilities icon indicating copy to clipboard operation
unifios-utilities copied to clipboard

Scripts do not seem to run after a reboot

Open slafc94 opened this issue 3 years ago • 12 comments

Describe the bug It seems like the scripts inside of /mnt/data/on_boot.d do not run after my UDM-Pro is rebooted. The scripts are all executable (-rwxr-xr-x) and have the correct format (.sh and #!/bin/sh). An example script is below:

01-Cron-BT.sh #!/bin/sh FILE=/etc/cron.d/bt CONTENTS="* * * * * /bin/sh /mnt/data/on_boot.d/10-BT.sh>/dev/null 2>&1" if [ -f "$FILE" ]; then echo "$FILE exists." else echo "$FILE does not exist. Creating..." echo "$CONTENTS" >> $FILE fi /etc/init.d/S90dcron restart

and 10-BT.sh:

#!/bin/sh

if [ "$(/sbin/ip addr show eth8 | /bin/grep -cim1 '10.20.30.1')" -ge 1 ]; then #echo 'Fake IP on eth8 Exists!' : else echo "Adding Fake IP to eth8" /sbin/ip addr add 10.20.30.1 dev eth8 fi

Expected behavior I'd expect the cronjob file to be created which it isn't until I manually run the script

UDM Information

  • Variant : UDM-PRO
  • Firmware Version: UniFi OS UDM Pro 1.11.1

slafc94 avatar Feb 09 '22 19:02 slafc94

Seeing the same thing here after a reinstall / upgrade of udm-utilities v1.0.5, on a UDM Pro v1.11.0.

I have been on UDMP v1.11.0 for a bit and my scripts WERE being run after reboot. However, I had re-run the udm-utilities force install / upgrade command. The install script output implied I had v1.0.5 previously, but I didn't recognize the 06-cni-bridge.sh or 05-install-cni-plugins.sh scripts that got installed into /mnt/data/on_boot.d - those scripts weren't there before. So I have no idea what version I was on previously.

After the upgrade of udm-utilities, now none of my scripts seem to be executing on boot-up anymore either.

EDIT: I reinstalled via unifi-os shell and afterwards noticed that my systemctl status udm-boot was not reporting the service unit set to enabled. Running systemctl enable udm-boot fixed my issue.

jhspyhard avatar Feb 13 '22 06:02 jhspyhard

Seeing the same thing here after a reinstall / upgrade of udm-utilities v1.0.5, on a UDM Pro v1.11.0.

I have been on UDMP v1.11.0 for a bit and my scripts WERE being run after reboot. However, I had re-run the udm-utilities force install / upgrade command. The install script output implied I had v1.0.5 previously, but I didn't recognize the 06-cni-bridge.sh or 05-install-cni-plugins.sh scripts that got installed into /mnt/data/on_boot.d - those scripts weren't there before. So I have no idea what version I was on previously.

After the upgrade of udm-utilities, now none of my scripts seem to be executing on boot-up anymore either.

EDIT: I reinstalled via unifi-os shell and afterwards noticed that my systemctl status udm-boot was not reporting the service unit set to enabled. Running systemctl enable udm-boot fixed my issue.

was having issues with my udm not starting pihole on reboot, and tried your solution and didnt work for me, using 1.11.0 as well but udm.

campmeharder avatar Feb 22 '22 05:02 campmeharder

I think you should check if the files under /mnt/data have an .sh extension...

docbobo avatar Mar 03 '22 16:03 docbobo

EDIT: I reinstalled via unifi-os shell and afterwards noticed that my systemctl status udm-boot was not reporting the service unit set to enabled. Running systemctl enable udm-boot fixed my issue.

I just ran into this exact same issue systemctl enable udm-boot was the solution. This really should be fixed, since I don't recall this being an issue anytime before.

AndrewDaws avatar Mar 24 '22 05:03 AndrewDaws

Seeing the same thing here after a reinstall / upgrade of udm-utilities v1.0.5, on a UDM Pro v1.11.0.

I have been on UDMP v1.11.0 for a bit and my scripts WERE being run after reboot. However, I had re-run the udm-utilities force install / upgrade command. The install script output implied I had v1.0.5 previously, but I didn't recognize the 06-cni-bridge.sh or 05-install-cni-plugins.sh scripts that got installed into /mnt/data/on_boot.d - those scripts weren't there before. So I have no idea what version I was on previously.

After the upgrade of udm-utilities, now none of my scripts seem to be executing on boot-up anymore either.

EDIT: I reinstalled via unifi-os shell and afterwards noticed that my systemctl status udm-boot was not reporting the service unit set to enabled. Running systemctl enable udm-boot fixed my issue.

Also seeing the same behaviours, systemctl enable udm-boot was the fix

sc994 avatar Mar 30 '22 23:03 sc994

EDIT: I reinstalled via unifi-os shell and afterwards noticed that my systemctl status udm-boot was not reporting the service unit set to enabled. Running systemctl enable udm-boot fixed my issue.

Another win using systemctl enable udm-boot, thank you <3

matwritescode avatar Apr 07 '22 00:04 matwritescode

EDIT: I reinstalled via unifi-os shell and afterwards noticed that my systemctl status udm-boot was not reporting the service unit set to enabled. Running systemctl enable udm-boot fixed my issue.

Another win using systemctl enable udm-boot, thank you <3

Same here. Much love @jhspyhard

dehness avatar Apr 12 '22 20:04 dehness

Yep, udm-boot wasn't enabled. Thanks for the tip @campmeharder

digitalface avatar Apr 15 '22 01:04 digitalface

wow this really needs to be fixed why do i with luck have to find this in the reported issues and its not in any wiki info?

ArmandH avatar May 05 '22 17:05 ArmandH

@ArmandH Feel free to add your notes and fixes to the Wiki. See https://github.com/boostchicken-dev/udm-utilities/blob/master/CONTRIBUTING.md for more info.

gatesry avatar May 09 '22 11:05 gatesry

The remote_install.sh script didn't work for me either setting up a fresh UDM on 1.12.22. Same issue as above, udm-boot was not set to enabled. Performing the "manual install" incl. systemctl enable udm-boot fixed the issue.

logock avatar Jun 21 '22 17:06 logock

UDM Pro. I had to enable this as well. Follow instructions for manual install.

I saw my Adguard for UDM wasn’t accessible or pingable.

checked the script run on boot status- it was disabled (the install is supposed to enable it)

did the manual install (you have to do go into the shell too, don’t skip that step)

use the enable command in the instructions

check the status now. It’s enabled (yay)

Reboot device and double check

Unlearned6688 avatar Oct 05 '22 11:10 Unlearned6688