possible bug in sysvinit?
Hi everyone...
I'm not sure if -mentors is the right place for this, but I figured
that if anyone can point me in the right direction (where to post
this) you guys can.
I think *maybe* I've found a bug in sysvinit but I'd like a sanity
check before filing an official bug report on it.
First of all, I am running slink, so please don't berate me for
running a stable distribution. If compiling the sysvinit source from
potato will help, so be it, but I'm not prepared to fully upgrade at
this point.
The problem is this:
I've got a UPS daemon (mgeupsd, not debianized, but I might work on
that if I can get this problem resolved.)
It works fine when the power fails: it writes FAIL to /etc/powerstatus
and sends SIGPWR to init. init then looks at these lines in inittab:
# What to do when the power fails/returns.
pf::powerwait:/etc/init.d/powerfail start
pn::powerfailnow:/etc/init.d/powerfail now
po::powerokwait:/etc/init.d/powerok
and runs the appropriate commands to initiate a shutdown in 10
minutes.
When the power is restored, mgeupsd writes OK to /etc/powerstatus and
sends SIGPWR to init. At this point, init apparently does nothing.
The first line of /etc/init.d/powerok calls logger, and checking the
system logs, it is seemingly not called. (Note that it originally was
"/etc/init.d/powerfail stop" but this wasn't effective either so I
changed it a litle in a vain debugging attempt.)
This is obviously a problem for me, because if I'm not there to cancel
the shutdown, the system goes down every time the power blips (which
is frequent around here.) At least it's a graceful shutdown, but
still...
Now I can't do strace on init, so I can't see exactly what's wrong.
I did fiddle with init.c and recompiled sysvinit so that it logs that
it did recieve a SIGPWR and notices that the power is now in OK
status... in other words, it is correctly reading /etc/powerstatus.
However, it does not seem to act on the po:: line in inittab.
I'm not sure where to go from here since I can't exactly trace init.
It's seemingly not running my powerok script and I don't know how to
debug it from here.
Does anyone have any suggestions, or thinks I should post this on a
different list or something?
Clarifications gladly provided.
Thanks,
Preston Landers
Reply to: