[Bug 16336] New: Unexpected action removal from /etc/inittab

bugzilla at busybox.net bugzilla at busybox.net
Thu Apr 17 21:12:55 UTC 2025


https://bugs.busybox.net/show_bug.cgi?id=16336

            Bug ID: 16336
           Summary: Unexpected action removal from /etc/inittab
           Product: Busybox
           Version: 1.37.x
          Hardware: All
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P5
         Component: Other
          Assignee: unassigned at busybox.net
          Reporter: kwrzalik at gmail.com
                CC: busybox-cvs at busybox.net
  Target Milestone: ---

I have a system with following lines in /etc/inittab, which only differ in
their action (shutdown vs ctraltdel):

tty5::shutdown:/etc/rc.kill
tty5::ctrlaltdel:/etc/rc.kill

It appears that the script is only called on control-alt-delete but not on
invoking `reboot`. The culprit turns out to be new_init_action() in init/init.c
where an existing action is overwritten with newly added one if their console
and command are the same. This comparison does not make action_type into
account which leads to the aforementioned unexpected behaviour.

A simple fix employs changing comparison in new_init_action() so that it reads:

                if (a->action_type == action
                 && strcmp(a->command, command) == 0
                 && strcmp(a->terminal, cons) == 0

-- 
You are receiving this mail because:
You are on the CC list for the bug.


More information about the busybox-cvs mailing list