bug fix, missing "check file" target files result in error "Invalid checksum" sha1 has a string length of 40

#17 Merged at 4d61d31
Repository
mschenck2
Branch
fix-addchecksum-sha1
Repository
tildeslash
Branch
master
Author
  1. michael schenck
Reviewers

Comments (3)

  1. michael schenck author

    Here's an example of the failure, and fix:

    [root@dev6-mschenck-685bf155.ewr01 ~]# /etc/init.d/monit restart
    Stopping monit:                                            [  OK  ]
    Starting monit: checksum: file /tmp/foobar is not regular file
    /etc/monit.d/foobar.monit:2: Cannot compute a checksum for file /tmp/foobar 'restart'
    /etc/monit.d/foobar.monit:2: Invalid checksum [00000000000000000000000000000000] for file /tmp/foobar 'restart'
                                                               [FAILED]
    [root@dev6-mschenck-685bf155.ewr01 ~]# cat /etc/monit.d/foobar.monit
    check file twem.conf path /tmp/foobar
      if changed sha1 checksum then exec "/etc/init.d/nginx restart"
      depends on nginx
    [root@dev6-mschenck-685bf155.ewr01 ~]#
    [root@dev6-mschenck-685bf155.ewr01 ~]#        # installing patched RPM (in another screen)
    [root@dev6-mschenck-685bf155.ewr01 ~]#
    [root@dev6-mschenck-685bf155.ewr01 ~]# /etc/init.d/monit restart
    Stopping monit:                                            [FAILED]
    Starting monit: checksum: file /tmp/foobar is not regular file
    /etc/monit.d/foobar.monit:2: Cannot compute a checksum for file /tmp/foobar 'restart'
    Starting monit daemon with http interface at [*:2812]
                                                               [  OK  ]
    [root@dev6-mschenck-685bf155.ewr01 ~]#