I have i8k configured to only start the i8kmon daemon to control the fans. rc-status reports i8k as "crashed", yet the daemon is running in the background and doing its job. "/etc/init.d/i8k stop" doesn't give an error message (just says ok), and the daemon continues to run and control the fans. Reproducible: Always Steps to Reproduce: kork ~ # /etc/init.d/i8k start i8k | * Starting i8kmon ... [ ok ] kork ~ # /etc/init.d/i8k stop i8k | * Stopping i8kmon ... [ ok ] Actual Results: kork ~ # ps ax | grep i8kmon | grep -v grep 12817 ? Ss 0:00 tclsh /usr/bin/i8kmon -- -d The daemon hasn't stopped. Restarting the service results in another instance of the daemon running, leading to race conditions if the configuration changed (fans going up and down like mad). Expected Results: The i8kmon daemon should no longer be running after having been stopped. I am using sys-apps/openrc-0.2.1-r1 sys-apps/baselayout-2.0.0 app-laptop/i8kutils-1.25 (only version in portage, stable) Changing the init script as below solves the problem (only tested with baselayout-2, openrc). The i8kbutton part uses a pidfile already. --- /root/i8k 2008-04-07 18:14:40.000000000 +0200 +++ /etc/init.d/i8k 2008-04-07 18:27:21.000000000 +0200 @@ -26,9 +26,8 @@ fi if [ ! -n "$NOMON" ]; then ebegin "Starting i8kmon" - start-stop-daemon --start -b --quiet \ - --exec /usr/bin/i8kmon --background \ - --name "tclsh /usr/bin/i8kmon" \ + start-stop-daemon --start --quiet --pidfile /var/run/i8kmon.pid \ + --make-pidfile --exec /usr/bin/i8kmon --background \ -- -d ${NOAUTO:+-na} ${TIMEOUT:+-t $TIMEOUT} eend $? fi @@ -42,7 +41,7 @@ fi if [ ! -n "$NOMON" ]; then ebegin "Stopping i8kmon" - start-stop-daemon --stop --quiet --name "tclsh /usr/bin/i8kmon" + start-stop-daemon --stop --quiet --pidfile /var/run/i8kmon.pid eend $? fi } It appears that something didn't work right using baselayout-1 and a pidfile, see bug #110572.
The supperfluous tcl runtime dependency of the init script hasn't been stated btw...
Created attachment 170179 [details, diff] Fixes stopping i8kmon
This patch also seems to fix the "crashed" after started bug. (I think the crashed is encountered after trying to start i8k again after stopping via init.d scripts?)
One additional note, /usr/bin/i8kmon should have tcl/tk isolated so i8kutils can be built without the extra tk/tcl support. I believe the author only used tk/tcl for the gui stuff. Since these init scripts can work without the gui, should isolate the tk/tcl stuff from /usr/bin/i8kmon. <shrugs> I'm hesitant to pick-up this task as I'm quite busy right now.
I just confirmed that roger's patch works for me. Thanks. (In reply to comment #4) > One additional note, /usr/bin/i8kmon should have tcl/tk isolated so i8kutils > can be built without the extra tk/tcl support. I believe the author only used > tk/tcl for the gui stuff. I believe i8kmon does use tcl. ps ax shows 4045 ? Ss 0:00 tclsh /usr/bin/i8kmon -- -d I think this is what Carsten Lohrke was saying in comment #1. That still leaves tk, though. Sincerely, Henry
Great. This bug is *fixed* with init.i8k.patch. (Please get this committed so I don't have to worry about my laptop for awhile. ;-) Right. i8kmon depends on tclsh. After reviewing /usr/bin/i8kmon script, it's really an entire tcl script embedded into a sh script wrapper. Looking at the depends for dev-lang/tcl, tcl seems like a minimally sized package. Think the tk use flag is also minimal with system resources. Granted, script should be in bash/python/C, but it's what the author used and it's 743 lines of scripting. Guess it can wait another day or two for recoding.
alright, the patch is in 1.25-r1, I trust you all that this works for you.
Forgot to mention. Yup, works for me! Marking as fixed. (Didn't know if you were still around Olivier!) Thanks.