The monitored process cannot be started properly

Issue #1055 closed
fuqingxin created an issue

I want to get some help,This is my debug log:

[1970-01-01T10:30:01+0800] debug : Cannot read proc file '/proc/886/attr/current' -- Invalid argument
[1970-01-01T10:30:01+0800] debug : Cannot read proc file '/proc/9/attr/current' -- Invalid argument
[1970-01-01T10:30:01+0800] debug : Cannot read proc file '/proc/944/attr/current' -- Invalid argument
[1970-01-01T10:30:01+0800] debug : Cannot read proc file '/proc/956/attr/current' -- Invalid argument
[1970-01-01T10:30:01+0800] debug : 'A40I-GN' process test failed [pid=5889] -- No such process
[1970-01-01T10:30:01+0800] error : 'A40I-GN' process is not running
[1970-01-01T10:30:01+0800] info : 'A40I-GN' trying to restart
[1970-01-01T10:30:01+0800] debug : 'A40I-GN' process test failed [pid=5889] -- No such process
[1970-01-01T10:30:01+0800] debug : 'A40I-GN' process test failed [pid=5889] -- No such process
[1970-01-01T10:30:01+0800] info : 'A40I-GN' start: '/A40I/A40I-GN/A40I-GN.sh start'
[1970-01-01T10:30:11+0800] debug :


  • GN 单板软件 *
  • *
  • [1970-01-01T10:30:11+0800] debug : *版 本 号: 1.0.0.20221102 *
  • *编译时间: 16:13:35 *

************* 版权所有(C)2022-2023 珠海高凌信息科技股份有限公司 *************

*** Packet Forwarder ***
Ver[1970-01-01T10:30:11+0800] debug : sion: undefined
*** SX1302 HAL library version info ***
Version: 2.1.0;


As you can see, my A40I-GN process does not exist, monit tries to start it, after executing my script, I can see from the log that the A40I-GN process is started, but when I check the status, my A40I-GN process is not started

Comments (5)

  1. Tildeslash repo owner

    The log excerpt doesn’t show what happened after the restart attempt … normally Monit waits for the start to finish or timeout. Did the start time out?

    If it didn’t timeout, please check logs of the application being started. Monit just logs the start and error output, which showed some startup activity.

  2. fuqingxin reporter

    @Tildeslash

    Thank you very much for your reply, I have a full log here:

    [1970-01-01T14:03:08+0800] debug : 'A40I-GN' process test failed [pid=16222] -- No such process
    [1970-01-01T14:03:08+0800] error : 'A40I-GN' process is not running
    [1970-01-01T14:03:08+0800] info : 'A40I-GN' trying to restart
    [1970-01-01T14:03:08+0800] debug : 'A40I-GN' process test failed [pid=16222] -- No such process
    [1970-01-01T14:03:08+0800] debug : 'A40I-GN' process test failed [pid=16222] -- No such process
    [1970-01-01T14:03:08+0800] info : 'A40I-GN' start: '/A40I/A40I-GN/A40I-GN.sh start'
    [1970-01-01T14:03:08+0800] debug :


    • GN 单板软件 *
    • *
    • [1970-01-01T14:03:08+0800] debug : *版 本 号: 1.0.0.20221103 *
    • *编译时间: 11:27:58 *

    ************* 版权所有(C)2022-2023 珠海高凌信息科技股份有限公司 *************
    [1970-01-01T14:03:09+0800] debug : 'A40I-GN' started

    [1970-01-01T14:03:19+0800] debug : 'A40I-GN' process test failed [pid=16243] -- No such process
    [1970-01-01T14:03:19+0800] error : 'A40I-GN' process is not running
    [1970-01-01T14:03:19+0800] info : 'A40I-GN' trying to restart
    [1970-01-01T14:03:19+0800] debug : 'A40I-GN' process test failed [pid=16243] -- No such process
    [1970-01-01T14:03:19+0800] debug : 'A40I-GN' process test failed [pid=16243] -- No such process
    [1970-01-01T14:03:19+0800] info : 'A40I-GN' start: '/A40I/A40I-GN/A40I-GN.sh start'
    [1970-01-01T14:03:19+0800] debug :


    • GN 单板软件 *
    • *
    • [1970-01-01T14:03:19+0800] debug : *版 本 号: 1.0.0.20221103 *
    • *编译时间: 11:27:58 *

    ************* 版权所有(C)2022-2023 珠海高凌信息科技股份有限公司 *************

    [1970-01-01T14:03:19+0800] debug : Cannot read proc file '/proc/1/attr/current' -- Invalid argument
    [1970-01-01T14:03:19+0800] debug : Cannot read proc file '/proc/10/attr/current' -- Invalid argument
    [1970-01-01T14:03:19+0800] debug : Cannot read proc file '/proc/103/attr/current' -- Invalid argument
    [1970-01-01T14:03:19+0800] debug : Cannot read proc file '/proc/108/attr/current' -- Invalid argument
    [1970-01-01T14:03:19+0800] debug : Cannot read proc file '/proc/109/attr/current' -- Invalid argument
    [1970-01-01T14:03:19+0800] debug : Cannot read proc file '/proc/11/attr/current' -- Invalid argument

    Please note the timestamp. monit tries to restart process A40I-GN and then execute my script. I see in the log "[1970-01-01T14:03:09+0800] debug: 'A40I-GN' started ', but after 10 seconds (I set the monit scan period to 10s), monit tried again to restart A40I-GN. I tried to manually execute the script I had written, and the process A40I-GN could run in the background

  3. fuqingxin reporter

    @Tildeslash 

    hi!

    I tried to modify my script file and monit can start the process A40I-GN normally

    Before :/A40I/ a40i-gn /A40I & (monit cannot start A40I-GN)

    Now :nohup /A40I/A40I-GN/ A40I-gn > /dev/null &

    I wonder why this is so

  4. Tildeslash repo owner

    monit requires that the start program will daemonize the application (run in background and detach from the controlling terminal)

  5. Log in to comment