I am porting an application from UNIX to...
Articles and Tips: qna
01 Apr 2003
Q.
I am porting an application from UNIX to NetWare. This application needs to run always. In UNIX, I make an entry in the inittab file, with the respawn option. This ensures that if the application is killed, the operating system restarts it.
How can I achieve this on NetWare? One solution that I have in mind is to write a monitor NLM that will check from time to time if the application NLM is loaded and if it is not, the monitor NLM loads the application NLM explicitly. Is there another way I can accomplish this or is this strategy good enough?
A.
NetWare doesn't have a "Services" registry like Windows does because it actually has a superior design which allows you to control the order that modules are loaded during start up (STARTUP.NCF and SYS:/SYSTEM/AUTOEXEC.NCF).
To ensure that an NLM is always running, you could load CRON.NLM and configure it to load your NLM at regular intervals (and flag it so it can't be loaded multiple times). You should also make sure no one can kill the NLM with a Ctrl-C. For a CLIB NLM this is accomplished by setting the DONT_CHECK_CTRL_ CHARS when you create the NLM's screen (if it has one). Then call SetNLMDontUnloadFlag to make sure that no one can perform an UNLOAD from the console.
Finally, never exit the last thread in your NLM and it will stay loaded.
* Originally published in Novell AppNotes
Disclaimer
The origin of this information may be internal or external to Novell. While Novell makes all reasonable efforts to verify this information, Novell does not make explicit or implied claims to its validity.