Author Topic: Linux boot script question?  (Read 2023 times)

Legacy_Calvinthesneak

  • Hero Member
  • *****
  • Posts: 1159
  • Karma: +0/-0
Linux boot script question?
« Reply #45 on: April 11, 2011, 06:50:11 pm »


               The odd part is I cannot have the shell script run if I create my own files using mkfifo.  The process automatically makes it's own fifo files which it deletes as soon as it is terminated.  

I suppose the root of my confusion is how he can get the process to run with creating his own.  Crontab shouldn't have to do anything like that.  I simply use crontab to lauch a process monitor to see if the process is hanging at 100% CPU usage every 5 minutes.  I always provide full pathing in linux by habit, more secure and robust to do so.

Since the script is a forked process, even if it terminates abnormally, it should still be deleting the fifo files.  Reading a bit more carefully it seems the crux of the problem is a reboot of the virtual machine.  Maybe his idea is right in that case, still seems odd.  I've had great performance from the script.
               
               

               
            

Legacy_Skildron

  • Sr. Member
  • ****
  • Posts: 421
  • Karma: +0/-0
Linux boot script question?
« Reply #46 on: April 11, 2011, 10:35:08 pm »


               

Calvinthesneak wrote...

The odd part is I cannot have the shell script run if I create my own files using mkfifo.  The process automatically makes it's own fifo files which it deletes as soon as it is terminated.  


Yes, that's right, empty refuses to work if the fifos it shall use are already present - it wants to create the fifos on its own.

I suppose the root of my confusion is how he can get the process to run with creating his own.  Crontab shouldn't have to do anything like that.  I simply use crontab to lauch a process monitor to see if the process is hanging at 100% CPU usage every 5 minutes.  I always provide full pathing in linux by habit, more secure and robust to do so.


On a hard server crash that leads to a cold reboot, empty has no chance to remove its fifo files because no process is terminated normally - in fact, no process is terminated at all. That leaves the hard disc in an unclean state, too.

Since the script is a forked process, even if it terminates abnormally, it should still be deleting the fifo files.  Reading a bit more carefully it seems the crux of the problem is a reboot of the virtual machine.  Maybe his idea is right in that case, still seems odd.  I've had great performance from the script.


Yes, the script is a streak of genius, and if the script terminates abnormally, its child processes like empty would of course be terminated by init. But if the server (the actual machine, not the nwserver executable) hangs? If I understood correctly, that's why knight shield wants crontab to remove the stale fifo files - so that on the following startup, nwservctl.sh runs properly and is not prevented from doing so by preexisting fifo files.

Greetings
Skildron
               
               

               
            

Legacy_Knight_Shield

  • Hero Member
  • *****
  • Posts: 812
  • Karma: +0/-0
Linux boot script question?
« Reply #47 on: April 11, 2011, 10:52:35 pm »


               Ok I did it .....         here is what I put in crontab      

                               @reboot    ~/rm  -f   in.fifo
                               @reboot    ~/rm  -f   out.fifo
               
               

               
            

Legacy_Knight_Shield

  • Hero Member
  • *****
  • Posts: 812
  • Karma: +0/-0
Linux boot script question?
« Reply #48 on: May 30, 2011, 06:30:40 pm »


               Just a note ..I changed pass phrase to ( Running... )because it was taking to long for(  Module loaded )after computer reboot for script to work properly.My mod has grown.
               
               

               


                     Modifié par Knight_Shield, 30 mai 2011 - 05:31 .