View the Most Wanted LQ Wiki articles.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 02-23-2014, 12:40 PM   #1
Registered: Aug 2004
Posts: 173

Rep: Reputation: 0
How to close file handles gracefully during "reboot" command ?

Hi everyone,

i have a linux embedded system, no NAND flash, only uses SD card for storage.

Our app has several processes, they open database files and consistently working on them.

Now if you press the reset button, or "reboot" cmd from console, the next time we see database file corruption. My guess is our app is not closing file handles gracefully.

Our software reset button gives app a little bit time to clean up, how can i check the opened file handles at this point ? Can i have a separate process and close these file handles in other processes by that file handle hex value ?

Thanks !
Old 02-23-2014, 01:18 PM   #2
Senior Member
Registered: Oct 2011
Location: Budapest
Distribution: Debian/GNU/Linux, AIX
Posts: 2,646

Rep: Reputation: 754Reputation: 754Reputation: 754Reputation: 754Reputation: 754Reputation: 754Reputation: 754
No. Your programs have to receive and process signals like SIGINT and SIGTERM, and flush/close their files themselves.
1 members found this post helpful.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
how to close "any" application cleanly from command line pponnath Red Hat 5 06-23-2011 07:18 PM
[SOLVED] Errors executing shell script: "command not found" and "no such file or directory" eko000 Linux - Newbie 1 01-14-2011 08:54 AM
Command "mail" returns "panic: temporary file seek" kenneho Linux - Software 5 12-23-2008 04:27 AM
"NIM thread blocked" & "Deadman Switch (DMS) close to trigger" errors sosborne Linux - Networking 1 06-28-2006 03:07 PM
Tiny Sofa 2.0 - I thought "halt", "reboot" were only root command ?? sorcerer Linux - Distributions 1 08-21-2004 04:28 PM

All times are GMT -5. The time now is 07:57 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration