Services to auto-restart on crash (Linux and Windows)

Discussion in 'Ideas' started by Silly English Kniggit, Mar 19, 2018.

Services to auto-restart on crash (Linux and Windows) 5 5 9votes
5/5, 9 votes

  1. Silly English Kniggit

    Joined:
    Sep 13, 2017
    Messages:
    217
    Likes Received:
    78
    Currently services do not restart on crash. They should.

    We have an ongoing issue with some 3CX Linux installs where the SIP service Segmentation Faults and dies. This is supposed to have been fixed in SP3 but hasn't been. This change won't prevent the crash, but will at least ensure automatic recovery - and a LOT more reliably than the workaround supplied by support (which failed completely).

    Both OS support restarting services on crash - but 3CX installer doesn't set this up.

    TODO:
    For Linux, add the lines
    Restart=always
    RestartSec=10

    under the [Service] header of each of these files:
    • /lib/systemd/system/3CXAudioProvider01.service
    • /lib/systemd/system/3CXCfgServ01.service
    • /lib/systemd/system/3CXEventNotificationManager.service
    • /lib/systemd/system/3CXHotelModule01.service
    • /lib/systemd/system/3CXIVR01.service
    • /lib/systemd/system/3CXMediaServer.service
    • /lib/systemd/system/3CXPhoneSystem01.service
    • /lib/systemd/system/3CXPhoneSystemMC01.service
    • /lib/systemd/system/3CXQueueManager01.service
    • /lib/systemd/system/3CXSystemService01.service
    • /lib/systemd/system/3CXTunnel01.service
    Optionally modify this too
    • /lib/systemd/system/nginx.service
    Having read the postgresq*.service - modifying this option doesn't seem like a good idea here.

    Then run “systemctl daemon-reload” to ensure system has reloaded the changes.


    For Windows, set the services to recover using the API of your choice in the installer.
    For example, from the command line you could run...

    sc failure 3CXEventNotificationManager actions=restart/10000/restart/10000/restart/10000 reset=0
    sc failure 3CXAudioProvider01 actions=restart/10000/restart/10000/restart/10000 reset=0
    sc failure 3CXCfgServ01 actions=restart/10000/restart/10000/restart/10000 reset=0
    sc failure 3CXIVR01 actions=restart/10000/restart/10000/restart/10000 reset=0
    sc failure 3CXPhoneSystemMC01 actions=restart/10000/restart/10000/restart/10000 reset=0
    sc failure 3CXQueueManager01 actions=restart/10000/restart/10000/restart/10000 reset=0
    sc failure 3CXPhoneSystem01 actions=restart/10000/restart/10000/restart/10000 reset=0
    sc failure 3CXTunnel01 actions=restart/10000/restart/10000/restart/10000 reset=0
    sc failure 3CXSystemService01 actions=restart/10000/restart/10000/restart/10000 reset=0
    sc failure "3CX PhoneSystem Database Server" actions=restart/10000/restart/10000/restart/10000 reset=0
    sc failure 3CXMediaServer actions=restart/10000/restart/10000/restart/10000 reset=0
    sc failure nginx actions=restart/10000/restart/10000/restart/10000 reset=0

    ...after the services are created.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
    #1 Silly English Kniggit, Mar 19, 2018
    Last edited: Mar 19, 2018
  2. V..

    V..

    Joined:
    Feb 14, 2017
    Messages:
    62
    Likes Received:
    23
    [​IMG]

    +1 paw of approval given to this request
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
    Biochemisch likes this.