Jump to content

Recommended Posts

Posted

Hi

I need to execute some command when system is going down for halt/poweroff.

I need to know this inside my script /etc/init.d/myScript which is called when system is going down.

I used to do it by checking $runlevel variable and if it is set to 0, then system was going down for halt, it was working for instance in Raspbian a few years ago.

However, in my Linux cubieboard2 4.9.12-sunxi Armbian this variable is not set, and when I execute "runlevel" command inside "STOP" case in myScript it says it is in N 5 runlevel which is not true because I have executed poweroff

All tips are welcome

Best Regards

Marek

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines