Project Home
Project Home
Documents
Documents
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - Shutdown dll: (14 Items)
   
Shutdown dll  
Hi all,

 

I'm working on QNX 7.0 and using the "shutdown_system_with_reason()"  API : http://www.qnx.com/developers/docs/7.0.0/#
com.qnx.doc.neutrino.lib_ref/topic/s/shutdown_system.html

 

I've provided the shutdown_nvram.so dll . The function "save_reset_info_to_nv()" is being called but the following 
warning also comes along with it:

" open_shutdown_dll: shutdown dll NOT open! "

 

I've provided another DLL containing the board_pre_shutdown() and board_shutdown() APIs and assigned the dll to 
BOARD_SHUTDOWN_DLL env variable as told. But the warning still prevails

 

1. Why is the warning coming?

2. Should we provide 2 dlls?

3. How do the board_pre_shutdown() and board_shutdown() APIS get invoked?
Re: Shutdown dll  
That error message should include the name of your DLL, so I suspect the code couldn't determine it. Did you get any 
error messages before that one?

As the docs mention, if you don't set BOARD_SHUTDOWN_DLL, the function builds the name based on the type of hardware. 
Did you get an error message mentioning uname()?

If you specified a name in BOARD_SHUTDOWN_DLL, and dlopen() couldn't open it, then you should have had an error message 
from that call. 

What's the value of BOARD_SHUTDOWN_DLL?
Re: Shutdown dll  
There is neither any name of the dll included in the warning nor any error mentioning uname()

The only error message that i get is the one that I've mentioned earlier " open_shutdown_dll: shutdown dll NOT open!" . 
There are no other errors present

The value of BOARD_SHUTDOWN_DLL is "shutdown_test" since I've provided the dll shutdown_test.so along with 
shutdown_nvram.so and assigned the name of the former to the board dll env variable

Another observation is that the error is only coming if I use the APIs shutdown_system() and 
shutdown_system_with_reason().
The error doesn’t appear if I use the “shutdown” utility from the commandline : http://www.qnx.com/developers/docs/7.
0.0/index.html#com.qnx.doc.neutrino.utilities/topic/s/shutdown.html
Re: Shutdown dll  
The environment variable needs the ".so" extension in it too. Where is your DLL located?  
Re: Shutdown dll  
I tried it again, and you either have to specify a full path for your DLL in the environment variable, or your DLL has 
to be in one of the directories listed in LD_LIBRARY_PATH or _CS_LIBPATH. I'll add that to the docs.
Re: Shutdown dll  
Hi,

The dlls are kept at "/lib/dll"  location. It is included in the LD_LIBRARY_PATH env variable
I've tried again including the ".so" extension in the board environment variable. I'm still being encountered with the 
same error!
Re: Shutdown dll  
Can you post your code, along with the way you're setting BOARD_SHUTDOWN_DLL?
Re: Shutdown dll  
I'm assigning the DLL as 
BOARD_SHUTDOWN_DLL=shutdown_test.so 
or BOARD_SHUTDOWN_DLL=shutdown_test in the command line

I'm trying to test it both the ways

I've attached the codes for both shutdown_test.so and shutdown_nvram.so
Attachment: Image 2018-07-20_10h28_59.png 10.2 KB Image 2018-07-20_10h29_19.png 9.22 KB
Re: Shutdown dll  
You need to export the environment variable, so that your shell's children get it too:

export BOARD_SHUTDOWN_DLL=shutdown_test.so

Re: Shutdown dll  
Thanks a lot Steve! It's working :)
 
Re: Shutdown dll  
You're welcome. I've added a few more details to the documentation to make it easier for others who need to do this.
Re: Shutdown dll  
Hi,

I'm trying to customize the shutdown process by using the callouts provided by QNX : http://www.qnx.com/developers/docs/
7.0.0/#com.qnx.doc.neutrino.lib_ref/topic/s/shutdown_system.html

I've experimented with the shutdown_display() and shutdown_progress() callouts by providing them in the shutdown_nvram.
so dll

I've filled those callouts with print statements to check at which point of shutdown process they were being called. But
 I couldn't find any print output on the console from those callouts

I tried placing the functions in shutdown_baord.so(the dll assosiated with BOARD_SHUTDOWN_DLL env variable) too. But 
there was no success.

What is the proper way to use those callouts?
Re: Shutdown dll  
The shutdown utility defines its versions of the callouts in the same C file that calls shutdown_system(). If you want 
them in a separate DLL, you just need to link your program against it before linking against libshutdown.a.
Re: Shutdown dll  
Thanks a lot! Its working. I thought the callouts had to given in the dlls

 
I have one more question ::

Can you explain the process of shutdown in QNX?

From analyzing the prints of these callouts during shutdown and from the information given in the QNX docs, I could 
understand that the OS first classifies all the processes and then shuts them one class at a time. 

At the end of all this , shutdown_done() callout was called and then board_shutdown() function was called out which we 
have provided in one of our Dll's. After this point, I cannot see any log on the console

What happens after this? Is there any other activities that the OS performs apart from what was analyzed?