epics-modules / xxx

APS BCDA synApps module: xxx
http://epics-modules.github.io/xxx
Other
5 stars 6 forks source link

stale procServ info file prevents IOC from being started #51

Closed kmpeters closed 2 years ago

kmpeters commented 2 years ago

It is possible for the iocxxx-ps-info.txt file to continue to exist even though procServ and the IOC are no longer running. When this occurs it is not possible to start the IOC without first deleting the procServ info file.

I believe the problem occurs when the computer running an IOC that resides on a network drive is rebooted, but I haven't tested this yet.

kmpeters commented 2 years ago

The problem is easy to reproduce by killing procServ with the kill -9 command.

A temporary workaround is to add a start-anyway command that calls the following function:

start_anyway() {
    if [ -f "${IOC_STARTUP_DIR}/${PROCSERV_INFO_FILE}" ]; then
        echo "Removing ${IOC_STARTUP_DIR}/${PROCSERV_INFO_FILE}"
        rm -f ${IOC_STARTUP_DIR}/${PROCSERV_INFO_FILE}
    fi
    start
}

It is NOT safe to use the start-anyway option while an IOC is running or run it on a different computer.

More sophisticated solutions would involve adding return values to the xxx.sh commands so that failures to start the IOC can be detected.

kmpeters commented 2 years ago

Thanks @keenanlang! that is a nicer solution than start_anyway.