I have a very important process which is having a Queue, In Queue i'm storing important data and when if someone trap that process it must have to process the data which is there in the Queue after that it will terminate itself.So if user perform a shut-down operation then that process will be killed and my data will be lossed...So my Question is, Do we have any command which will wait or do not allow machine to shut-down, Or give your valuable alternative suggestion for handling this situation.
Is there any command in linux which will force linux machine to not shut-down
linux;command line;shutdown
If your software do a critical job you have to write a service file and put it under /etc/init.d that when computer goes down your script start stop function in that script which you need to clean up to not mess up your program. Like Oracle DB that when system goes down it will close ports to don't transaction any information and then save the information on the hard disk (Clean Up!).NOTE: Good software clean up data itself after the stop function in service file sends specific signal (Mostly 15).NOTE: Normal users can't execute shutdown procedure with commands like reboot -p or shutdown -h now or init 0.NOTE: Normal users can't kill process which owned by root.