Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

7
  • I did not follow your steps 100% I only used your new headers for the script and now I can see the description in yast. My problem is that the script is triggers before the reboot and after. I do not want it happen before. Commented Jul 19, 2012 at 23:10
  • YaST has probably added the script to the reboot and shutdown init. If you use the skeleton (check the openSuse link, it contains a simpler one, look in the 'Action' section). You have to be sure that when start is invoke, you call your PHP script. When stop is invoke, you don't call it. Or you can use @Petr-Uzel solution too, then you simply call your PHP script, no need to apply the skeleton structure. Commented Jul 20, 2012 at 9:34
  • Would you know how to check if calling the script is part of shutdown init? Commented Jul 23, 2012 at 0:21
  • 1
    @Radek when shutting down or rebooting, the runlevel change to (respectively) 0 or 6. If you have the script in /etc/init.d/rcn.d/K* with n equal 0 or 6, then it is called during the shutdown. I have added a gist (see link in my answer) with a simple script you could re-use to call your PHP script. Commented Jul 23, 2012 at 7:15
  • After checking, the runlevel for shutting down and reboot are correct, however, the scripts are not place there. But in their respective start runlevel. So if you put the runlevel 3 to start the script, then in runlevel 3 you will see the shutdown script, the difference is that for startup, the link to the script is S<nn><filename> whereas for the shuttdown it is K<nn><filename> Commented Jul 23, 2012 at 7:32