Project

General

Profile

Actions

Bug #111

closed

/sbin/reboot doesn't run /etc/init.d/rcK

Added by Hammel over 12 years ago. Updated over 12 years ago.

Status:
Closed
Priority:
Immediate
Assignee:
Category:
root file system
Target version:
Start date:
15 May 2012
Due date:
% Done:

100%

Estimated time:
Severity:
Critical

Description

My inittab has this:

# Stuff to do for the 3-finger salute
::ctrlaltdel:/sbin/reboot

# Stuff to do before rebooting
::ctrlaltdel:/etc/init.d/rcK
::ctrlaltdel:/bin/umount -a -r
::ctrlaltdel:/sbin/swapoff -a

But the rcK script, which runs the "stop" function of all init scripts, is not getting run when /sbin/reboot is called.

To get around this I can do the following:
  • Create a postbuild script in Buildroot
  • If /sbin/reboot.bin does not exist but /sbin/reboot does,

cp /sbin/reboot /sbin/reboot.bin
create /sbin/reboot.sh to call rcK && /sbin/reboot.bin
ln -s /sbin/reboot.sh /sbin/reboot

Actions #1

Updated by Hammel over 12 years ago

  • % Done changed from 0 to 30

I looked at the init code in Busybox. SHUTDOWN is the correct event to recognize, but only a SIGTERM actually causes the SHUTDOWN events to be processed. reboot issues a SIGINT.

So the way around this is to have a postinstall script in the Buildroot build that removes /sbin/reboot and replaces it with the following script:

#!/bin/sh
kill -15 1

I should check on the Busybox list as to my interpretation here. Maybe I missed something. But it seems like /sbin/reboot should cause SIGTERM and not SIGINIT if you want to be able to run SHUTDOWN events in init.

Actions #2

Updated by Hammel over 12 years ago

  • Status changed from New to Resolved
  • % Done changed from 30 to 100

For reasons not yet clear, this issue has cleared up on the latest build. It was mostly likely caused by a combination of issues related to how I modified the run time including inittab.

For now, the issue is resolved. We'll return to it again if it shows up again.

Actions #3

Updated by Hammel over 12 years ago

  • Status changed from Resolved to Closed

Retried this today. /sbin/reboot does, indeed, run rcK. Not sure what the original problem was, but it's not there now.

Closing this issue.

Actions

Also available in: Atom PDF