Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Dockland

macrumors 6502a
Original poster
Feb 26, 2021
965
8,909
Sweden
Hi everyone and another.

I have an issue.

My HW is a MAC mini M2 Pro (jada jada, insert bells 'n whistles here) with latest Ventura update installed (13.3.1)

I also have an external 8 TB (enclosed) drive connected via USB3...C. It's a Samsung 8 TB QVO SSD that runs just fine in every aspect.

However, I need to start Drive DX at boot/login and today that works just fine as is.
But, I also use iStat menus (latest version with iStat menus helper tools installed) that also start at login. So far so good.

In order to show my external drive in iStat menus, the app Drive DX n e e d s to start first, in order = Drive DX (and a slight delay for the application to initialise) t h e n when Drive DX is upp and running (takes approx. a couple of seconds) I'd like to start iStat menus, for iStat menus to show my external drive properly.

As of today both services start (virtually) at the same time, with the result iStat menus doesn't properly show my external drive (because Drive DX isn't done initialising probably)

Se this thread for the symptoms/solution, related (sort of) to this my question here:

What I "need" to configure, somehow is Drive DX to start at login as of now (doesn't have to alternate/modify anything here) but, make iStat menus (native service) to start at login with a, perhaps, 10 seconds delay.

Now I do have an app called "Delayed start" that is very simple. You just ad an app or apps with a "plus sign" as usual, set the timer how many seconds after a login the application will start. (https://apps.apple.com/se/app/delay-start/id591620786?l=en&mt=12)

The issue here is, when I add iStat menu to the "Delayed start" app, it starts just fine, but not as a service, it shows the splash screen and with an option to "Start automatically at login" and that's what I want to avoid.

To sumarize, i want the service from iStat menus to start "natively" as designed in the app itself but with a delay of approx. 10 seconds.

Coming from Gentoo Linux these kind of issues was a no brainer. I scripted my way as I wished. Now MacOS isn't Linux, I know that.

But is this even possible to achieve?
 
Last edited:

Brian33

macrumors 65816
Apr 30, 2008
1,460
367
USA (Virginia)
You picked a rather complicated application to fiddle with! I'm running iStat Menus 6 and right now there are four different processes running. Two as root (iStatMenusDaemon and iStatMenusFans) and two as my userid (iStatMenusAgent and iStat Menus Status). This isn't a typical app.

Which one(s) do you need to delay the start of? It appears that these get started by the launchd service, configured by plist files in /Library/LaunchDaemons and /Library/LaunchAgents. Note that all four of the associated plist files specify:

<key>RunAtLoad</key>
<true/>

So launchd will attempt to start them as soon as the .plist file is loaded.

I'm not saying what you want is impossible, but I don't immediately know how to do it. You'd have to modify the proper .plist file(s) and remove the RunAtLoad property. Then I think you could use the 'launchctl' command to load and start the service "manually" from a script which included the appropriate delay.

See 'man launchctl' and 'man launchd.plist' if you want to dig into it.
 
  • Like
Reactions: Dockland

bogdanw

macrumors 603
Mar 10, 2009
5,955
2,906
From https://launchd.info/ Configuration

"...depending on Other Jobs: OtherJobEnabled
The name of this subkey is somewhat misleading. It does not check if a certain job is enabled, but if a job is loaded. The following job will be started (and restarted) when a job with label local.otherJob is not loaded. It will be terminated when a job with label local.otherJob is loaded."

"Delaying the start: AfterInitialDemand
This key affects other keys related to run conditions like RunAtLoad, StartCalendarInterval, WatchPaths or KeepAlive. If set, these keys will be ignored until the job has been started manually."
 
  • Like
Reactions: Dockland
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.