View Single Post
Old 04-29-2010, 01:27 PM   #8
Shaggy
Wizard
Shaggy ought to be getting tired of karma fortunes by now.Shaggy ought to be getting tired of karma fortunes by now.Shaggy ought to be getting tired of karma fortunes by now.Shaggy ought to be getting tired of karma fortunes by now.Shaggy ought to be getting tired of karma fortunes by now.Shaggy ought to be getting tired of karma fortunes by now.Shaggy ought to be getting tired of karma fortunes by now.Shaggy ought to be getting tired of karma fortunes by now.Shaggy ought to be getting tired of karma fortunes by now.Shaggy ought to be getting tired of karma fortunes by now.Shaggy ought to be getting tired of karma fortunes by now.
 
Shaggy's Avatar
 
Posts: 4,293
Karma: 529619
Join Date: May 2007
Device: iRex iLiad, DR800SG
Quote:
Originally Posted by GregorRichards View Post
The standard shutdown process will synchronize and unmount filesystems. After SIGTERM'ing apps of course. I would certainly hope that any builtin apps that depend on their runtime state would catch SIGTERM properly. With a quick look of the sources I happened to already have downloaded, erbrowser does in fact catch SIGTERM and handle it. I don't have the content browser or document viewer source.
Doing it through sysd, it tells the apps that it's going to unmount the filesystem (which I assume causes them to gracefully save), and also tells the configuration tool to export it's settings. Then it waits for them to finish before it really does the unmount. After that it continues with the shutdown sequence.

The problems with doing it outside of sysd are:
1) Do the apps handle a SIGTERM in the same manner as being told by sysd that it is preparing an unmount.
2) Will they finish quick enough, or will the system shutdown send them a SIGKILL while they're still trying to gracefully exit. The system shutdown only waits X seconds before it kills them, it can't sync up with the apps like sysd does.

As Gertjan says, doing it through sysd is a lot cleaner.
Shaggy is offline   Reply With Quote