[ale] Perl script to check process

James Sumners james.sumners at gmail.com
Mon Jan 9 12:05:49 EST 2012


Or get a little more robust --
https://bitbucket.org/jsumners/scripts/src/a5845b3071f0/screen_daemon.sh

On Mon, Jan 9, 2012 at 11:50, Tim Watts <tim at cliftonfarm.org> wrote:
> Does it have to be Perl?  It's simple enough to do in bash:
>
> #!/bin/bash
> while ((1)); do
>        if (ps -fe | grep -v "grep" | grep -P "\Wxboard\W??" >/dev/null); then
>                {your-start-invocation-here}
>        fi
>        sleep 30
> done
>
> Would need to refine that 2nd grep if you get more than one hit.
>
> Alternatively, create a pid file when you invoke xboard and grep for
> that pid.



-- 
James Sumners
http://james.roomfullofmirrors.com/

"All governments suffer a recurring problem: Power attracts
pathological personalities. It is not that power corrupts but that it
is magnetic to the corruptible. Such people have a tendency to become
drunk on violence, a condition to which they are quickly addicted."

Missionaria Protectiva, Text QIV (decto)
CH:D 59



More information about the Ale mailing list