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 1048599
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T16:28:59+00:00 2026-05-16T16:28:59+00:00

Hello generous computerists! So I have a launchd plist item that is calling the

  • 0

Hello generous computerists!

So I have a launchd plist item that is calling the below shell script every thirty seconds. It checks to see if a program is running and if it isn’t, it restarts it. Or at least that is what it’s supposed to do.

The problem is, even when the process has been killed, the shell script is stating that the process is still running. I think this is because somehow the boolean is not being reset (Or something along those lines). Any help?

 n=`ps -ef | grep Intel | grep -v grep | wc -l`

 if [ $n -gt 0 ]

 then

       echo `date` CURRENTLY RUNNING. >> /Library/A_Intel_WATCHDOG/A_Intel_WatchLog.txt

 else

  echo `date` not running. ATTEMPTING RESTART... >> /Library/A_Intel_WATCHDOG/A_Intel_WatchLog.txt
  cd /Library/LaunchAgents/
  launchctl load com.Intel.plist

 fi

EDIT 1

It has been suggested that adding a ‘Keep Alive’ argument may be a good solution to my general problem. Any comments?

Here would be my updated plist file which should guarantee that my app keeps running perpetually:

<?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.Intel</string>
    <key>OnDemand</key>
    <true/>
    <key>ProgramArguments</key>
    <array>
         <string>/Library/LaunchAgents/Contents/Intel</string>
    </array>
     <key>RunAtLoad</key>
    <true/>
     <key>KeepAlive</key>
    <true/>
</dict>
</plist>

I would love to hear if people think this is correct or not. Thanks so much!

  • 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-05-16T16:29:00+00:00Added an answer on May 16, 2026 at 4:29 pm

    To troubleshoot the immediate problem, try logging the output of the ps command:

    processes=`ps -ef | grep [I]ntel`
    if [ -n "$processes" ]
    then
        echo `date` CURRENTLY RUNNING. "$processes" >> /Library/A_Intel_WATCHDOG/A_Intel_WatchLog.txt
    ...
    

    I suspect there’s something else running (maybe even the script itself) matching Intel; this’ll tell you in the log.

    However, I think this is irrelevant, because this script seems to be trying to solve a problem that’s better solved elsewhere: launchd is entirely capable of monitoring and restarting the processes it manages (it’s one of its significant features). Just add

    <key>KeepAlive</key>
    <true/>
    

    to /Library/LaunchAgents/com.Intel.plist, and launchd will restart the program itself.

    BTW, if you for some reason did need to manually restart a launchd-managed process, launchctl load is the wrong incantation — you want launchd start.

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

Sidebar

Related Questions

Hello I have the following error by git-fsck, which cannot be cleaned by git-gc
Hello I am working with a simulator that uses rcS scripts to boot, this
Hello we have an SQL server application running over a low bandwith connection. We
Hello I have two dependants select box, the second one is popularited after onchange
Hello everyone i have big query to calculation and counter by clinic ID SELECT
Hello every one. I'm faced with a weird problem. My application has a simple
Hello again ladies and gents! OK, following on from my other question on ASP.NET
Hello I was writing a Regular Expression (first time in my life I might
Hello can anybody solve this please I'm creating the object in the action class
Hello I am compiling a program with make but I get the error of

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.