Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9167731
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T15:27:45+00:00 2026-06-17T15:27:45+00:00

I created a launchd agent which opens a non-password-protected sparse disk image (and mounts

  • 0

I created a launchd agent which opens a non-password-protected sparse disk image (and mounts its solitary volume) daily at 2:45AM in preparation for backup software to write to the volume. The launchd agent’s plist file is saved in ~/Library/LaunchAgents/. Here are the plist file’s parameters:

Label: my.DiskImageOpener
KeepAlive: NO
RunAtLoad: NO
StartCalendar:
    Hour: 2
    Minute: 45
ProgramArguments:
    hdiutil
    attach
    /path/to/MyDiskImage.sparseimage

As long as the computer’s display is awake, the agent works as advertised, opening the disk image and mounting its volume at the time specified in the launch agent. On the other hand, if the display is asleep at the time specified in the launch agent, the disk image fails to open until the display is awoken from sleep (even if that is several hours later), at which point the disk image immediately opens and mounts its volume. The same phenomenon happens if I replace the hdiutil attacj /path/to/MyDiskImage.sparseimage command with open /path/to/MyDiskImage.sparseimage, or place the command in a separate executable shell script that the launch agent executes.

How can I get the launch agent to open the disk image and mount its volume when the display is asleep?

I am using a MacBook Pro laptop running OS X 10.8.2 Mountain Lion. Thank you for any assistance with this problem.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T15:27:46+00:00Added an answer on June 17, 2026 at 3:27 pm

    I think I stumbled on the solution. As long as I keep the computer set to never sleep in the Energy Saver preference pane, then even if the display is asleep and/or the hard drive is set to sleep when possible, then the launch agent runs successfully, opening the disk image and mounting the volume. Inexplicably, if the computer is set to any setting other than never to sleep (even though it may in fact be awake), the launch agent fails.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have created Cocoa app which is type of launch agent. To distribute this
i have created an installer(dot net deployment project) on VS 2005 which automatically installs
I created a sample package listener application which get launched when user clicks any
I have created a Java Web Start application which works fine when launched from
I want to save a Unique ID (which is a String) which gets created
I created a VSTO Outlook Addin that uses a library Html2Xhtml.dll (.NET) which calls
I created and launch the SQLJ Java procedure (using SQL Developer). I have some
I created a class to launch the MailComposer so that my iPhone app would
When I set a Launch Image , Xcode creates a copy as Default.png and
I created process and launched help-file Process help = new Process(); help.StartInfo.FileName = C:\MyProjects\comp\help_eng.hlp;

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.