-->

pidfile '/var/log/contextBroker/contextBroker.

2019-08-01 05:56发布

问题:

I installed the new version of ContextBroker:

curl localhost:1026/version

{
"orion" : 
    {
    "version" : "1.2.1",
    "uptime" : "0 d, 0 h, 7 m, 58 s",
    "git_hash" : "af44fd1fbdbbfd28d79ef4f929e871e515b5452e",
    "compile_time" : "Thu Jun 16 15:46:51 CEST 2016",
    "compiled_by" : "fermin",
    "compiled_in" : "centollo"
    }
}

Then I installed the watchdog and verifying the file /var/log/contextBroker/monitBROKER.log , I encounter the following error:

error    : 'contextBroker' failed to start (exit status 1) -- /etc/init.d/contextBroker: Starting...
contextBroker está parado
Starting contextBroker...                         pidfile not found[FALLÓ]

debug    : Socket test failed for [::1]:1026 -- HTTP error: Regular expression doesn't match: No match
debug    : Socket test failed for [127.0.0.1]:1026 -- HTTP error: Regular expression doesn't match: No match
error    : 'localhost' failed protocol test [HTTP] at [localhost]:1026/version [TCP/IP] -- HTTP error: Regular expression doesn't match: No match
info     : 'localhost' exec: /etc/init.d/contextBroker
debug    : 'monitBROKER.log' file exists
debug    : 'monitBROKER.log' is a regular file or socket
debug    : 'monitBROKER.log' size check succeeded [current size=19.5 kB]
debug    : pidfile '/var/log/contextBroker/contextBroker.pid' does not exist
error    : 'contextBroker' process is not running
info     : 'contextBroker' trying to restart
debug    : pidfile '/var/log/contextBroker/contextBroker.pid' does not exist
debug    : pidfile '/var/log/contextBroker/contextBroker.pid' does not exist
info     : 'contextBroker' start: /etc/init.d/contextBroker
debug    : pidfile '/var/log/contextBroker/contextBroker.pid' does not exist
debug    : Starting...
contextBroker está parado
Starting contextBroker...                         pidfile not found[FALLÓ]
debug    : pidfile '/var/log/contextBroker/contextBroker.pid' does not exist

Preventing the operation of watchdog.

Could you please tell how to fix it?

EDIT 1

This is the command execution contextBroker (in bold the folder where the PID file is created):

/usr/bin/contextBroker -port 1026 -logDir /var/log/contextBroker -pidpath /var/run/contextBroker/contextBroker.pid -dbhost localhost -db orion -multiservice

How I can modify it to create the PID file where it should?

Or should modify the configuration of watchdog to point to that folder?

EDIT 2

I modified the configuration of the watchdog modifying the monitBROKER.conf file to point to the folder /var/run/contextBroker/

Following the steps indicated by fgalan, I made the "full reset".

If at first you run the script watchdog and observing their log:

info     : Starting Monit 5.14 daemon
info     : 'ServidorCaptura.guest.domain' Monit 5.14 started
debug    : Socket test failed for [::1]:1026 -- Connection refused
debug    : Socket test failed for [127.0.0.1]:1026 -- Connection refused
error    : 'localhost' failed protocol test [HTTP] at [localhost]:1026/version [TCP/IP] -- Connection refused
debug    : 'monitBROKER.log' file exists
debug    : 'monitBROKER.log' is a regular file or socket
debug    : 'monitBROKER.log' size check succeeded [current size=464 B]
debug    : pidfile '/var/run/contextBroker/contextBroker.pid' does not exist
error    : 'contextBroker' process is not running
info     : 'contextBroker' trying to restart
debug    : pidfile '/var/run/contextBroker/contextBroker.pid' does not exist
debug    : pidfile '/var/run/contextBroker/contextBroker.pid' does not exist
info     : 'contextBroker' start: /etc/init.d/contextBroker
debug    : pidfile '/var/run/contextBroker/contextBroker.pid' does not exist
debug    : Starting...
contextBroker está parado
Starting contextBroker...                         [  OK  ]
debug    : 'contextBroker' started
debug    : Socket test failed for [::1]:1026 -- HTTP error: Regular expression doesn't match: No match
debug    : Socket test failed for [127.0.0.1]:1026 -- HTTP error: Regular expression doesn't match: No match
error    : 'localhost' failed protocol test [HTTP] at [localhost]:1026/version [TCP/IP] -- HTTP error: Regular expression doesn't match: No match
debug    : 'monitBROKER.log' file exists
debug    : 'monitBROKER.log' is a regular file or socket
debug    : 'monitBROKER.log' size check succeeded [current size=1.9 kB]
info     : 'contextBroker' process is running with pid 1493
debug    : 'contextBroker' zombie check succeeded
debug    : 'contextBroker' total mem amount check succeeded [current total mem amount=3.3 MB]
debug    : 'contextBroker' cpu usage check succeeded [current cpu usage=0.0%]
debug    : 'contextBroker' cpu usage check succeeded [current cpu usage=0.0%]
debug    : Socket test failed for [::1]:1026 -- HTTP error: Regular expression doesn't match: No match
debug    : Socket test failed for [127.0.0.1]:1026 -- HTTP error: Regular expression doesn't match: No match
error    : 'localhost' failed protocol test [HTTP] at [localhost]:1026/version [TCP/IP] -- HTTP error: Regular expression doesn't match: No match
info     : 'localhost' exec: /etc/init.d/contextBroker
debug    : 'monitBROKER.log' file exists
debug    : 'monitBROKER.log' is a regular file or socket
debug    : 'monitBROKER.log' size check succeeded [current size=3.1 kB]
debug    : 'contextBroker' process is running with pid 1493
debug    : 'contextBroker' zombie check succeeded
debug    : 'contextBroker' total mem amount check succeeded [current total mem amount=3.8 MB]
debug    : 'contextBroker' cpu usage check succeeded [current cpu usage=0.0%]
debug    : 'contextBroker' cpu usage check succeeded [current cpu usage=0.0%]
debug    : Socket test failed for [::1]:1026 -- HTTP error: Regular expression doesn't match: No match
debug    : Socket test failed for [127.0.0.1]:1026 -- HTTP error: Regular expression doesn't match: No match
error    : 'localhost' failed protocol test [HTTP] at [localhost]:1026/version [TCP/IP] -- HTTP error: Regular expression doesn't match: No match
info     : 'localhost' exec: /etc/init.d/contextBroker
debug    : 'monitBROKER.log' file exists
debug    : 'monitBROKER.log' is a regular file or socket
debug    : 'monitBROKER.log' size check succeeded [current size=4.3 kB]
debug    : pidfile '/var/run/contextBroker/contextBroker.pid' does not exist
error    : 'contextBroker' process is not running
info     : 'contextBroker' trying to restart
debug    : pidfile '/var/run/contextBroker/contextBroker.pid' does not exist
debug    : pidfile '/var/run/contextBroker/contextBroker.pid' does not exist
info     : 'contextBroker' start: /etc/init.d/contextBroker
debug    : pidfile '/var/run/contextBroker/contextBroker.pid' does not exist
debug    : Starting...
contextBroker está parado
Starting contextBroker...                         pidfile not found[FALLÓ]
debug    : pidfile '/var/run/contextBroker/contextBroker.pid' does not exist
debug    : pidfile '/var/run/contextBroker/contextBroker.pid' does not exist
debug    : pidfile '/var/run/contextBroker/contextBroker.pid' does not exist
debug    : pidfile '/var/run/contextBroker/contextBroker.pid' does not exist
debug    : pidfile '/var/run/contextBroker/contextBroker.pid' does not exist
debug    : pidfile '/var/run/contextBroker/contextBroker.pid' does not exist
debug    : pidfile '/var/run/contextBroker/contextBroker.pid' does not exist
debug    : pidfile '/var/run/contextBroker/contextBroker.pid' does not exist
debug    : pidfile '/var/run/contextBroker/contextBroker.pid' does not exist
debug    : pidfile '/var/run/contextBroker/contextBroker.pid' does not exist
debug    : pidfile '/var/run/contextBroker/contextBroker.pid' does not exist
debug    : pidfile '/var/run/contextBroker/contextBroker.pid' does not exist
debug    : pidfile '/var/run/contextBroker/contextBroker.pid' does not exist
debug    : pidfile '/var/run/contextBroker/contextBroker.pid' does not exist
debug    : pidfile '/var/run/contextBroker/contextBroker.pid' does not exist
debug    : pidfile '/var/run/contextBroker/contextBroker.pid' does not exist
debug    : pidfile '/var/run/contextBroker/contextBroker.pid' does not exist
debug    : pidfile '/var/run/contextBroker/contextBroker.pid' does not exist
debug    : pidfile '/var/run/contextBroker/contextBroker.pid' does not exist
debug    : pidfile '/var/run/contextBroker/contextBroker.pid' does not exist
debug    : pidfile '/var/run/contextBroker/contextBroker.pid' does not exist
debug    : pidfile '/var/run/contextBroker/contextBroker.pid' does not exist
debug    : pidfile '/var/run/contextBroker/contextBroker.pid' does not exist
debug    : pidfile '/var/run/contextBroker/contextBroker.pid' does not exist
debug    : pidfile '/var/run/contextBroker/contextBroker.pid' does not exist
debug    : pidfile '/var/run/contextBroker/contextBroker.pid' does not exist
debug    : pidfile '/var/run/contextBroker/contextBroker.pid' does not exist
debug    : pidfile '/var/run/contextBroker/contextBroker.pid' does not exist
debug    : pidfile '/var/run/contextBroker/contextBroker.pid' does not exist
debug    : pidfile '/var/run/contextBroker/contextBroker.pid' does not exist
debug    : pidfile '/var/run/contextBroker/contextBroker.pid' does not exist
error    : 'contextBroker' failed to start (exit status 1) -- /etc/init.d/contextBroker: Starting...
contextBroker está parado
Starting contextBroker...                         pidfile not found[FALLÓ]

debug    : Socket test failed for [::1]:1026 -- HTTP error: Regular expression doesn't match: No match
debug    : Socket test failed for [127.0.0.1]:1026 -- HTTP error: Regular expression doesn't match: No match
error    : 'localhost' failed protocol test [HTTP] at [localhost]:1026/version [TCP/IP] -- HTTP error: Regular expression doesn't match: No match
info     : 'localhost' exec: /etc/init.d/contextBroker
debug    : 'monitBROKER.log' file exists
debug    : 'monitBROKER.log' is a regular file or socket
debug    : 'monitBROKER.log' size check succeeded [current size=9.0 kB]
debug    : pidfile '/var/run/contextBroker/contextBroker.pid' does not exist
error    : 'contextBroker' process is not running
info     : 'contextBroker' trying to restart
debug    : pidfile '/var/run/contextBroker/contextBroker.pid' does not exist
debug    : pidfile '/var/run/contextBroker/contextBroker.pid' does not exist
info     : 'contextBroker' start: /etc/init.d/contextBroker
debug    : pidfile '/var/run/contextBroker/contextBroker.pid' does not exist
debug    : Starting...
contextBroker está parado
Starting contextBroker...                         pidfile not found[FALLÓ]
debug    : pidfile '/var/run/contextBroker/contextBroker.pid' does not exist
debug    : pidfile '/var/run/contextBroker/contextBroker.pid' does not exist
debug    : pidfile '/var/run/contextBroker/contextBroker.pid' does not exist
debug    : pidfile '/var/run/contextBroker/contextBroker.pid' does not exist
debug    : pidfile '/var/run/contextBroker/contextBroker.pid' does not exist
debug    : pidfile '/var/run/contextBroker/contextBroker.pid' does not exist
...

Or if you first started the Context Broker: /etc/init.d/contextBroker start , the PID file is created in the folder /var/run/contextBroker/ , then run the script watchdog and observing the log of the latter:

debug    : pidfile '/var/log/contextBroker/monit.pid' does not exist
info     : Starting Monit 5.14 daemon
info     : 'ServidorCaptura.guest.domain' Monit 5.14 started
debug    : Socket test failed for [::1]:1026 -- HTTP error: Regular expression doesn't match: No match
debug    : Socket test failed for [127.0.0.1]:1026 -- HTTP error: Regular expression doesn't match: No match
error    : 'localhost' failed protocol test [HTTP] at [localhost]:1026/version [TCP/IP] -- HTTP error: Regular expression doesn't match: No match
debug    : 'monitBROKER.log' file exists
debug    : 'monitBROKER.log' is a regular file or socket
debug    : 'monitBROKER.log' size check succeeded [current size=664 B]
debug    : 'contextBroker' process is running with pid 2299
debug    : 'contextBroker' zombie check succeeded
debug    : 'contextBroker' total mem amount check succeeded [current total mem amount=5.3 MB]
debug    : 'contextBroker' cpu usage check skipped (initializing)
debug    : 'contextBroker' cpu usage check skipped (initializing)
debug    : Socket test failed for [::1]:1026 -- HTTP error: Regular expression doesn't match: No match
debug    : Socket test failed for [127.0.0.1]:1026 -- HTTP error: Regular expression doesn't match: No match
error    : 'localhost' failed protocol test [HTTP] at [localhost]:1026/version [TCP/IP] -- HTTP error: Regular expression doesn't match: No match
debug    : 'monitBROKER.log' file exists
debug    : 'monitBROKER.log' is a regular file or socket
debug    : 'monitBROKER.log' size check succeeded [current size=1.7 kB]
debug    : 'contextBroker' process is running with pid 2299
debug    : 'contextBroker' zombie check succeeded
debug    : 'contextBroker' total mem amount check succeeded [current total mem amount=5.8 MB]
debug    : 'contextBroker' cpu usage check succeeded [current cpu usage=0.0%]
debug    : 'contextBroker' cpu usage check succeeded [current cpu usage=0.0%]
debug    : Socket test failed for [::1]:1026 -- HTTP error: Regular expression doesn't match: No match
debug    : Socket test failed for [127.0.0.1]:1026 -- HTTP error: Regular expression doesn't match: No match
error    : 'localhost' failed protocol test [HTTP] at [localhost]:1026/version [TCP/IP] -- HTTP error: Regular expression doesn't match: No match
info     : 'localhost' exec: /etc/init.d/contextBroker
debug    : 'monitBROKER.log' file exists
debug    : 'monitBROKER.log' is a regular file or socket
debug    : 'monitBROKER.log' size check succeeded [current size=2.9 kB]
debug    : 'contextBroker' process is running with pid 2299
debug    : 'contextBroker' zombie check succeeded
debug    : 'contextBroker' total mem amount check succeeded [current total mem amount=5.9 MB]
debug    : 'contextBroker' cpu usage check succeeded [current cpu usage=0.0%]
debug    : 'contextBroker' cpu usage check succeeded [current cpu usage=0.0%]
debug    : Socket test failed for [::1]:1026 -- Connection refused
debug    : Socket test failed for [127.0.0.1]:1026 -- Connection refused
error    : 'localhost' failed protocol test [HTTP] at [localhost]:1026/version [TCP/IP] -- Connection refused
info     : 'localhost' exec: /etc/init.d/contextBroker
debug    : 'monitBROKER.log' file exists
debug    : 'monitBROKER.log' is a regular file or socket
debug    : 'monitBROKER.log' size check succeeded [current size=4.0 kB]
debug    : pidfile '/var/run/contextBroker/contextBroker.pid' does not exist
error    : 'contextBroker' process is not running
info     : 'contextBroker' trying to restart
debug    : pidfile '/var/run/contextBroker/contextBroker.pid' does not exist
debug    : pidfile '/var/run/contextBroker/contextBroker.pid' does not exist
info     : 'contextBroker' start: /etc/init.d/contextBroker
debug    : pidfile '/var/run/contextBroker/contextBroker.pid' does not exist
debug    : Starting...
contextBroker está parado
Starting contextBroker...                         [  OK  ]
debug    : 'contextBroker' started
debug    : Socket test failed for [::1]:1026 -- HTTP error: Regular expression doesn't match: No match
debug    : Socket test failed for [127.0.0.1]:1026 -- HTTP error: Regular expression doesn't match: No match
error    : 'localhost' failed protocol test [HTTP] at [localhost]:1026/version [TCP/IP] -- HTTP error: Regular expression doesn't match: No match
info     : 'localhost' exec: /etc/init.d/contextBroker
debug    : 'monitBROKER.log' file exists
debug    : 'monitBROKER.log' is a regular file or socket
debug    : 'monitBROKER.log' size check succeeded [current size=5.5 kB]
info     : 'contextBroker' process is running with pid 2386
debug    : 'contextBroker' zombie check succeeded
debug    : 'contextBroker' total mem amount check succeeded [current total mem amount=3.3 MB]
debug    : 'contextBroker' cpu usage check succeeded [current cpu usage=0.0%]
debug    : 'contextBroker' cpu usage check succeeded [current cpu usage=0.0%]
debug    : Socket test failed for [::1]:1026 -- HTTP error: Regular expression doesn't match: No match
debug    : Socket test failed for [127.0.0.1]:1026 -- HTTP error: Regular expression doesn't match: No match
error    : 'localhost' failed protocol test [HTTP] at [localhost]:1026/version [TCP/IP] -- HTTP error: Regular expression doesn't match: No match
info     : 'localhost' exec: /etc/init.d/contextBroker
debug    : 'monitBROKER.log' file exists
debug    : 'monitBROKER.log' is a regular file or socket
debug    : 'monitBROKER.log' size check succeeded [current size=6.7 kB]
debug    : pidfile '/var/run/contextBroker/contextBroker.pid' does not exist
error    : 'contextBroker' process is not running
info     : 'contextBroker' trying to restart
debug    : pidfile '/var/run/contextBroker/contextBroker.pid' does not exist
debug    : pidfile '/var/run/contextBroker/contextBroker.pid' does not exist
info     : 'contextBroker' start: /etc/init.d/contextBroker
debug    : pidfile '/var/run/contextBroker/contextBroker.pid' does not exist
debug    : Starting...
contextBroker está parado
Starting contextBroker...                         pidfile not found[FALLÓ]
debug    : pidfile '/var/run/contextBroker/contextBroker.pid' does not exist
debug    : pidfile '/var/run/contextBroker/contextBroker.pid' does not exist
debug    : pidfile '/var/run/contextBroker/contextBroker.pid' does not exist
debug    : pidfile '/var/run/contextBroker/contextBroker.pid' does not exist
debug    : pidfile '/var/run/contextBroker/contextBroker.pid' does not exist
debug    : pidfile '/var/run/contextBroker/contextBroker.pid' does not exist
debug    : pidfile '/var/run/contextBroker/contextBroker.pid' does not exist
debug    : pidfile '/var/run/contextBroker/contextBroker.pid' does not exist
debug    : pidfile '/var/run/contextBroker/contextBroker.pid' does not exist
debug    : pidfile '/var/run/contextBroker/contextBroker.pid' does not exist
debug    : pidfile '/var/run/contextBroker/contextBroker.pid' does not exist
debug    : pidfile '/var/run/contextBroker/contextBroker.pid' does not exist
debug    : pidfile '/var/run/contextBroker/contextBroker.pid' does not exist
debug    : pidfile '/var/run/contextBroker/contextBroker.pid' does not exist
debug    : pidfile '/var/run/contextBroker/contextBroker.pid' does not exist
debug    : pidfile '/var/run/contextBroker/contextBroker.pid' does not exist
debug    : pidfile '/var/run/contextBroker/contextBroker.pid' does not exist
debug    : pidfile '/var/run/contextBroker/contextBroker.pid' does not exist
debug    : pidfile '/var/run/contextBroker/contextBroker.pid' does not exist
debug    : pidfile '/var/run/contextBroker/contextBroker.pid' does not exist
debug    : pidfile '/var/run/contextBroker/contextBroker.pid' does not exist
debug    : pidfile '/var/run/contextBroker/contextBroker.pid' does not exist
debug    : pidfile '/var/run/contextBroker/contextBroker.pid' does not exist
debug    : pidfile '/var/run/contextBroker/contextBroker.pid' does not exist
debug    : pidfile '/var/run/contextBroker/contextBroker.pid' does not exist
debug    : pidfile '/var/run/contextBroker/contextBroker.pid' does not exist
debug    : pidfile '/var/run/contextBroker/contextBroker.pid' does not exist
debug    : pidfile '/var/run/contextBroker/contextBroker.pid' does not exist
debug    : pidfile '/var/run/contextBroker/contextBroker.pid' does not exist
debug    : pidfile '/var/run/contextBroker/contextBroker.pid' does not exist
debug    : pidfile '/var/run/contextBroker/contextBroker.pid' does not exist
error    : 'contextBroker' failed to start (exit status 1) -- /etc/init.d/contextBroker: Starting...
contextBroker está parado
Starting contextBroker...                         pidfile not found[FALLÓ]

debug    : Socket test failed for [::1]:1026 -- HTTP error: Regular expression doesn't match: No match
debug    : Socket test failed for [127.0.0.1]:1026 -- HTTP error: Regular expression doesn't match: No match
error    : 'localhost' failed protocol test [HTTP] at [localhost]:1026/version [TCP/IP] -- HTTP error: Regular expression doesn't match: No match
info     : 'localhost' exec: /etc/init.d/contextBroker
debug    : 'monitBROKER.log' file exists
debug    : 'monitBROKER.log' is a regular file or socket
debug    : 'monitBROKER.log' size check succeeded [current size=11.5 kB]
debug    : pidfile '/var/run/contextBroker/contextBroker.pid' does not exist
error    : 'contextBroker' process is not running
info     : 'contextBroker' trying to restart
debug    : pidfile '/var/run/contextBroker/contextBroker.pid' does not exist
debug    : pidfile '/var/run/contextBroker/contextBroker.pid' does not exist
info     : 'contextBroker' start: /etc/init.d/contextBroker
debug    : pidfile '/var/run/contextBroker/contextBroker.pid' does not exist
debug    : Starting...
contextBroker está parado
Starting contextBroker...                         pidfile not found[FALLÓ]
debug    : pidfile '/var/run/contextBroker/contextBroker.pid' does not exist
debug    : pidfile '/var/run/contextBroker/contextBroker.pid' does not exist
...

回答1:

I'd suggest to do a "full reset", then try again.

By "full reset" I mean to ensure that CB is stopped and all its running artifact are removed. In particular (as root or using the sudo command):

  • Do /etc/init.d/contextBroker stop
  • Ensure that contextBroker is no longer running with ps ax | grep contextBroker. If the process is still there, stop it using the kill command (or kill -9 if the former doesn't work).
  • Remove any existing /var/log/contextBroker/contextBroker.pid file.

EDIT: In order to change the PID file, edit the BROKER_PID_FILE variable in the /etc/sysconfig/contextBroker, then restart the service.