- Revenera Community
- :
- FlexNet Publisher
- :
- FlexNet Publisher Knowledge Base
- :
- How to enable a delay on the license server startup after the machine has been put in to hibernate m...
- Mark as New
- Mark as Read
- Subscribe
- Printer Friendly Page
- Report Inappropriate Content
How to enable a delay on the license server startup after the machine has been put in to hibernate mode
How to enable a delay on the license server startup after the machine has been put in to hibernate mode
Issue
If the server is running and the system goes into hibernate mode automatically , when the system is brought back up the server might throw the below error
16:13:06 (DEMO) Wrong hostid on SERVER line for license file:
16:13:06 (DEMO)) C:\Program Files\FLEXlm\licenses\DEMO).lic
16:13:06 (DEMO)) SERVER line says 0290837ec0211, hostid is "6c6914b445e9 c8763fbe7b98 6ce14b446e9 6c7814b446e8 3c971ab940fa"
16:13:06 (DEMO)) Invalid hostid on SERVER line
This causes the license server to shut down. The problem seems to be caused by a delay in the waking of the network card that the license server is tied to. In this instance if the license server is restarted manually a few moments later then it works.
Solution
You can use the ls_daemon_periodic callback in lsvendor.c. This callback is called approximately once every minute, including shortly after the VD wakes up from hibernate. We have tested this by disabling the network adapter, waiting a few seconds, then re-enabling it.
Sample lsvendor.c pseudocode follows:
static void user_periodic_func();
void (*ls_daemon_periodic)() = user_periodic_func;
static void user_periodic_func()
{
char host_value[buffer] = "";
const int num_tries = 3;
unsigned attempts = 0;
lc_hostid(lm_job, HOSTID_ETHER, host_value);
while (string_contains(host_value, "ffffffff") && attempts < num_tries)
{
/* some message to stdout here, if you want to see attempts in the VD debug log */
sleep (2000);
attempts++;
lc_hostid(lm_job, HOSTID_ETHER, host_value);
}
}