There are modules in the Car PC community that can provide such functionality. Here's an example:
http://www.cartft.com/catalog/il/1540
This is a UPS that safely shuts down when the UPS battery runs low.
You can also use a Car PC shutdown controller: Quick Specifications
This uses an accessories wire to switch the PC on and off. I have used this in a mobile device with a NUC DE3815TYBE board.