mirror of
https://github.com/amidaware/tacticalrmm.git
synced 2026-04-26 23:15:57 +03:00
[GH-ISSUE #1591] macOS Ventura boot loop (arm64 and amd64) #995
Labels
No labels
In Process
bug
bug
dev-triage
documentation
duplicate
enhancement
fixed
good first issue
help wanted
integration
invalid
pull-request
question
requires agent update
security
ui tweak
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/tacticalrmm#995
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @ghost on GitHub (Aug 9, 2023).
Original GitHub issue: https://github.com/amidaware/tacticalrmm/issues/1591
macOS 13 (Ventura)
Agent version: 2.4.9
Installing either arm64 or amd64 agents on two macOS Ventura machines causes boot loop on both machines. Other Ventura machines have no problems.
It appears that the agent isn't the sole cause as the boot loop stops after being removed from the client list in TRMM even after rm 'ing the agent itself.
Both affected machines are Apple M1 / M2 processors.
@ghost commented on GitHub (Aug 9, 2023):
7 machines now. All Ventura apart from one on 11.7, either M or x64 processors.
The launchdeamon also needs to be deleted to fix it.
@silversword411 commented on GitHub (Aug 11, 2023):
You're saying your Mac is constantly restarting when the TRMM agent is installed?
Can you provide something showing it's TRMM doing it like a log file or something? I've got 30+ Mac's, and don't have a problem with any of them
You sure you don't have a check script that has a reboot command built in or something?
@ghost commented on GitHub (Aug 11, 2023):
Ah, good call. There is an uptime check script. I've disabled it and will monitor today.
@ghost commented on GitHub (Aug 12, 2023):
The uptime script was the cause of the problem. I tried changing it but it made no difference to problem.
Can someone check this script and tell me why it works with other RMM software but not TRMM?
@NiceGuyIT commented on GitHub (Aug 12, 2023):
I can't help with fixing your script but I can tell you what's wrong.
Relying on "relative" commands is not good. I have Homebrew installed and
uptimeis pulling from the Homebrew version, not the macOS version. This means you might get different results depending if Homebrew or other software is in the path. Compare the output of the two commands.Comparing the output between the two, you should see the problem. Your
awk '{print $3}'expression is taking the 3rd word as days. In the Homebrew version, the 3rd word isHH:MMminutes and in the macOS version, the 3rd word is NN minutes. This is why your script is boot looping. It's comparing the uptime in minutes if it hasn't been up for at least a day.To fix that, you might want to look into the
last rebootcommand. This will show the last time the computer was rebooted. Linux has the same command but in a different format.To extract the date, we can go back to awk. In case you don't know,
awkassigns the input to the$1variable for the first word,$2for the 2nd word,$3for the third word, etc.$0refers to the entire line. Assigning""to$1and$2removes that "word" from the line. Thesub()function removes the leading whitespace. The result is just the date.Now let's convert that date to something meaningful. The
datecommand can process dates and output a formatted date. Useman datefor details.-jmeans "do not try to set the date". This is important because TRMM is running as root.-fcontains the input format while"+..."represents the output format. Seeman strftimefor details about the date formats.This shows we can correctly process the date and control the output. According to
strftime,%jrepresents "the day of the year as a decimal number (001-366)." You can use this to calculate the number of days between the last reboot and "now" as shown in the 2nd command. This logic will fail at the end of the year. I'll leave it up to you to determine how to fix that edge case.