I have recently created a script that I will be using for a monthly policy to encourage users to reboot their Macs regularly. I'm using Swift Dialog to show a prompt to users to reboot. I am giving them the ability to defer rebooting up to 3 times. I also added a function in the script that will check if either Zoom or Teams is in a meeting. The Swift Dialog window won't appear if either app is in a meeting. Instead a launch daemon is installed and loaded to ensure that the policy runs again. When a user defers, the deferral time is written to a PLIST. The PLIST tracks the time and date of each deferral, how many times the user has deferred, and how many deferrals are remaining. The launch daemon is also installed after a deferral. I want the launch daemon to launch the policy again 1 day after the user defers or after the script finds that the user is in a Zoom or Teams meeting. In my tests, I set the StartInterval to 300 seconds so I wouldn't need to wait a full day. After I saw that the policy was being launched by the launch daemon, I changed the StartInterval value to 86,400 seconds. I have not seen the policy relaunch on my Mac when I have the StartInterval set at that value. I currently have RunAtLoad set to false since this was causing the policy to relaunch immediately after a deferral. The launch daemon also runs as root. The only thing this launch daemon does is run "/usr/local/jamf/bin/jamf policy -event monthly-reboot". When a user reboots, the script unloads the launch daemon and deletes it and the deferral PLIST. Does anyone have any ideas why my launch daemon isn't working as expected when I set the StartInterval to a full day? It works perfectly when I set it at a lower value for testing. I'm posting the launch daemon below. I have written a lot of launch daemons in the past. They all worked. I took my company name out of the Label string since they don't like me to identify who I work for here 🤷🏽
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.myCompany.Reboot</string>
<key>ProgramArguments</key>
<array>
<string>/usr/local/jamf/bin/jamf</string>
<string>policy</string>
<string>-event</string>
<string>monthly-reboot</string>
</array>
<key>RunAtLoad</key>
<false/>
<key>StartInterval</key>
<integer>86400</integer>
<key>UserName</key>
<string>root</string>
</dict>
</plist>