2

For my app i want to make a background process so i did. But now when try to load the process by script in postinst like this /Library/LaunchDaemons/com.dev.app.

i am getting error msg:

Could not open job overrides database at: /private/var/db/launchd.db/com.apple.launchd/overrides.plist: 2: No such file or directory

can anyone please help me to get rid of this?

Edit:

Debian postinst script:

chown root:wheel /Library/LaunchDaemons/com.dev.app.plist
launchctl load /Library/LaunchDaemons/com.dev.app.plist
Community
  • 1
  • 1
M.Shuaib Imran
  • 1,287
  • 16
  • 29

1 Answers1

1

I see this error message, too.

If you look on your phone's filesystem (e.g. login with ssh), I bet you don't have a folder at /private/var/db/launchd.db.

Just because iOS can't find that database file doesn't mean your daemon isn't loaded (or unloaded). Use the ps -Aef command at the command line (logged into the phone) to check whether your daemon process is running or not.

Inside your daemon's plist file (e.g. /System/Library/LaunchDaemons/com.mycompany.mydaemon.plist), you can set a Disabled flag (but, you probably won't). The overrides.plist file can override the Disabled setting from your daemon's plist file.

My guess is that this is primarily an OS X feature, and not commonly used by iOS, which shares much of the same codebase.

Edit:

If you really feel the need to get rid of the message, it looks like simply creating that directory will get rid of it. So, you could add something like this in your postinst script, before calling launchctl:

mkdir -p /var/db/launchd.db/com.apple.launchd
Nate
  • 31,017
  • 13
  • 83
  • 207
  • You are right After listing running processes i get to know that my process is running successfully but why this is happening now because before 6 months when i created a background process like that, it didn't show any error like that. And i also don't have /var/db/launchd.db/com.apple.launchd. Thanks again for your help – M.Shuaib Imran Jun 04 '14 at 07:41
  • iOS 7 might be different. I don't have an older, jailbroken iOS device available right now, but Apple may have either changed their code, or removed extra directories that aren't "needed" on iOS, causing this message to **start** appearing. – Nate Jun 05 '14 at 20:54