In both the case of what Chris and Justin were saying, take this one
with a grain of salt and caveat emptor etc...  Justin's script was the
more "unix" way to do it, which I'm usually all for, but you can get
the same "restart if it dies" effect in a more mac way if you use
launchd to help out.

I used the utility from the app store Lingon to create a launchd
definition that runs HardwareGrowler for me as a user at login and
restarts it should it crash.  You can get it at
http://dl.dropbox.com/u/7056284/com.kgarner.hardwaregrowler.plist

Once you download that file, you might want to edit it in a text
editor to point at where your copy of HardwareGrowler exists.  Right
now its assumed that HardwareGrowler lives at /Applications/Growl/
HardwareGrowler.app because that's where I put it.

Once the file has the right location for HardwareGrowler, you can copy
it to ~/Library/LaunchAgents and then from the command line do
"launchctl load ~/Library/LaunchAgents/
com.kgarner.hardwaregrowler.plist"

If you have HardwareGrowler as a startup item, you'll probably want to
remove it so you don't get two copies running at login.  Also, when an
updated HardwareGrowler comes out, you'll also want to remember that
you set this up so you can undo it.  Doing a launchctl unload on the
plist file and then removing the plist file you should be back to
where you started.

-- Keith

On Aug 9, 6:48 pm, JY <[email protected]> wrote:
> @Chris -- I am aware that you're on the case, and definitely wasn't
> trying to undermine your efforts! No offense intended; just wanted to
> share what may be helpful to someone else--with the proper technical
> expertise! I understand that line formatting may be an issue--didn't
> actually know what the etiquette on Google groups is here, as this is
> my first contribution. I'd absolutely be open to testing. Feel free to
> reach out directly... Thanks for your efforts!
>
> @ANYONE READING -- As Chris mentions, caveat emptor if you choose to
> use my script. I may have failed to make that clear enough in my first
> post... At any rate, unless you're completely comfortable with
> everything that I talked about in my original post, don't use this
> workaround.
>
> -Justin
>
> On Aug 9, 6:15 pm, Christopher Forsythe <[email protected]> wrote:
>
>
>
>
>
>
>
> > I would be careful about a few things here:
>
> > 1) Lots of people on this list would not understand how to handle this
> > script
>
> > 2) Line formatting may have been messed up when sending inline rather than
> > as an attachment
>
> > Regardless, we're aware of the issue and there are lots of threads about
> > this. We're working on it. Would you be willing to test it for us?
>
> > Chris
>
> > On Tue, Aug 9, 2011 at 3:52 PM, JY <[email protected]> wrote:
> > > I stumbled onto this group while trying to find a solution to HG
> > > crashing in Lion... I also noticed that it usually happens when the
> > > system wakes from sleep (e.g., when I open the lid). As a temporary
> > > workaround, I threw together a small quick script that checks to see
> > > if HG is running and tries to restart it if it's not. I invoke this
> > > every 5 minutes with cron. This minimizes my frustrations for the time
> > > being... Sharing below in hopes that it helps someone else until a
> > > permanent fix is provided
>
> > > (I have also had issues with GrowlTunes crashing, so the script also
> > > checks that--you could easily remove the GT section if not needed.)
>
> > > To use, copy the script below to a text file, save it to something
> > > like ghwatchdog.sh in your home directory. Then, add a crontab entry
> > > like:
>
> > > */5     *       *       *       *       /path/to/ghwatchdog.sh
>
> > > ...Of course, if you don't know how to create/edit crontab entries,
> > > you probably shouldn't use my workaround. But I digress.
>
> > > -Justin
>
> > > ********** BEGIN ghwatchdog.sh SCRIPT **********
>
> > > #!/bin/bash
>
> > > # Watchdog script to run from cron to ensure that
> > > # HardwareGrowler and GrowlTunes helpers are running.
>
> > > NOTIFY='/usr/local/bin/growlnotify'
> > > HG='/Applications/HardwareGrowler.app/Contents/MacOS/HardwareGrowler'
> > > GT='/Applications/GrowlTunes.app/Contents/MacOS/GrowlTunes'
>
> > > if (ps -ax | grep $HG | grep -v grep > /dev/null 2>&1 ) ; then
> > > # Simply, if there's a process, then HardwareGrowler appears to be
> > > running--do nothing.
> > >                # $NOTIFY -m 'ghwatchdog verified that HardwareGrowler is
> > > running.'
> > > ghwatchdog.sh
> > >                :
> > > else
> > > # If there's NO process, HardwareGrowler ain't running--start it.
> > >                $NOTIFY -m 'ghwatchdog ran and determined that
> > > HardwareGrowler
> > > appears to be DOWN; attempting to restart.' ghwatchdog.sh
> > >                $HG &
> > >                if (ps -ax | grep $HG | grep -v grep > /dev/null 2>&1 ) ;
> > > then
> > >                # Check again to see if HardwareGrowler is running.
> > >                                $NOTIFY -s -m 'ghwatchdog successfully
> > > started HardwareGrowler.'
> > > ghwatchdog.sh
> > >                else
> > >                                $NOTIFY -s -m 'ghwatchdog could not start
> > > HardwareGrowler; manual
> > > intervention may be required.' ghwatchdog.sh
> > >                fi
> > > fi
>
> > > if (ps -ax | grep $GT | grep -v grep > /dev/null 2>&1 ) ; then
> > > # Simply, if there's a process, then GrowlTunes appears to be running--
> > > do nothing.
> > >                # $NOTIFY -m 'ghwatchdog verified that GrowlTunes is
> > > running.'
> > > ghwatchdog.sh
> > >                :
> > > else
> > > # If there's NO process, GrowlTunes ain't running--start it.
> > >                $NOTIFY -m 'ghwatchdog ran and determined that GrowlTunes
> > > appears to
> > > be DOWN; attempting to restart.' ghwatchdog.sh
> > >                $GT &
> > >                if (ps -ax | grep $GT | grep -v grep > /dev/null 2>&1 ) ;
> > > then
> > >                # Check again to see if GrowlTunes is running.
> > >                                $NOTIFY -s -m 'ghwatchdog successfully
> > > started GrowlTunes.'
> > > ghwatchdog.sh
> > >                else
> > >                                $NOTIFY -s -m 'ghwatchdog could not start
> > > GrowlTunes; manual
> > > intervention may be required.' ghwatchdog.sh
> > >                fi
> > > fi
>
> > > ********** END ghwatchdog.sh SCRIPT **********
>
> > > --
> > > You received this message because you are subscribed to the Google Groups
> > > "Growl Discuss" group.
> > > To post to this group, send email to [email protected].
> > > To unsubscribe from this group, send email to
> > > [email protected].
> > > For more options, visit this group at
> > >http://groups.google.com/group/growldiscuss?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
"Growl Discuss" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/growldiscuss?hl=en.

Reply via email to