Adding KeepAlive in LauchDaemon plist

karthikeyan_mac
Valued Contributor

Hi,

I am trying to create a Launch Daemon for EnCase binary file. I have to add KeepAlive to the Launch Daemon plist. The process should be alive even if it exists normally (with exit 0) or crashes with error.

I tried adding <key>KeepAlive</key> in the Launch Daemon(below) created but this keeps on running the Program Arguments resulting in multiple process of the same binary.

<?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>KeepAlive</key> <true/> <key>Label</key> <string>com.guidancesoftware.encase</string> <key>ProgramArguments</key> <array> <string>/usr/local/encase/Encase</string> <string>start</string> </array> <key>QueueDirectories</key> <array/> <key>RunAtLoad</key> <true/> <key>WatchPaths</key> <array/> </dict> </plist>

Someone help me in changing the LauchDaemon plist so that the process kickstart again if it exits?

Thanks & Regards,
Karthikeyan M

1 REPLY 1

talkingmoose
Moderator
Moderator

Two things:
On 9/20/11 6:20 AM, "Karthikeyan M" <karthikeyan.mac at gmail.com> wrote:

Does this really need to be a LaunchDaemon or should it be a LaunchAgent?
A daemon runs as root and an agent runs as the currently logged in user
with all his privileges.

Get a copy of Lingon to help you create the .plist files. It's a simple
GUI application, very inexpensive and will help you create these files
quite easily.

--

William Smith
Technical Analyst
Merrill Communications LLC
(651) 632-1492