Changeset 528


Ignore:
Timestamp:
Jun 19, 2010, 10:05:03 PM (10 years ago)
Author:
zecrazytux
Message:

Wake up jobq to immediately process the queue if the daemon is running but sleeping

File:
1 edited

Legend:

Unmodified
Added
Removed
  • jobq/jobq

    r527 r528  
    117117    --runner --queue "$queue"
    118118  if [ $? = 1 ]; then
    119     # Daemon is already up, wake it up to process new job immediatly
    120     #kill -USR1 $(cat "$pidfile")  FIXME: to implement, interrupt sleep 5 above with signal
    121     true
     119    # Daemon is already running, wake it up to process new job immediatly
     120    sleeppid=$(ps -o pid,cmd --ppid $(cat "$pidfile") --noheadings | awk '/sleep/{ print $1 }')
     121    if [ -z "$sleeppid" ]; then
     122      kill -USR1 "$sleeppid"
     123    fi
    122124  fi
    123125  if [ $? != 0 ]; then
Note: See TracChangeset for help on using the changeset viewer.