getmail_lock not removed

Discussion in 'General' started by Ciao121, Jun 5, 2013.

  1. Ciao121

    Ciao121 New Member

    Hi,
    I'm not a shell programmer. So maybe my ieda is wrong.
    Sometimes I get /tmp/getmail_lock not removed so the ispconfig getmail.sh script exits with teh message:
    Found getmail lock file /tmp/.getmail_lock, we quit here.
    and /usr/bin/getmail -v -g /etc/getmail $rcfiles is not executed.

    After this error:
    Jun 5 12:00:41 mail getmail: getmailOperationError error (error resolving name mail.mydomain.com during connect ([Errno -2] Name or service not known))
    due the network was down I had getmail_lock not removed.
    I can't undestrand why it appens, because it should be removed after
    Code:
      if [ "$rcfiles" != "" ]; then
        /usr/bin/getmail -v -g /etc/getmail $rcfiles
      fi
    Has someone idea how to address this?
    Thank you.
     
  2. tkausl

    tkausl New Member

    E: Found it. Normally, it should delete the lockfile after running getmail...

    test.sh:
    Code:
    #!/bin/sh
    PATH=/sbin:/usr/sbin:/bin:/usr/bin:/usr/local/sbin:/usr/local/bin:/usr/X11R6/bin
    if [ -f /tmp/.getmail_lock ]; then
      echo 'Found getmail lock file /tmp/.getmail_lock, we quit here.'
    else
      touch /tmp/.getmail_lock
      ./test2.sh
      rm -f /tmp/.getmail_lock
    fi
    test2.sh:
    Code:
    exit
    works well...
     
    Last edited: Jun 7, 2013
  3. Ciao121

    Ciao121 New Member

    Hi tkausl,
    sorry I can't understand your answer....

    What does
    means?

    And what test.sh and test2.sh are? Scripts by you? To do what?

    Thank you :)
     

Share This Page