WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Trying to quiet ACPId during boot  (Read 1758 times)

Offline CentralWare

  • Retired Admins
  • Hero Member
  • *****
  • Posts: 764
Trying to quiet ACPId during boot
« on: November 18, 2015, 09:09:12 AM »
Hi guys!

I'm trying to do a little remastering (core.gz) where acpid is embedded, but for the life of me I can't muzzle it when it's launched.

I added --quiet to the start-stop-daemon line in init.d/acpid...  it doesn't like being quiet. :)
I modified the calling command (and the init.d script) sending output to null:
Code: [Select]
/usr/local/etc/init.d/acpid start >/dev/null 2>&1
It launches perfectly, but throws messages while it's loading such as acpid: 1 rule loaded which I need to mute.

SO...  I tried bypassing printk, which is read-only, so I added
Code: [Select]
echo 0 > /tmp/printk
(sudo) mount --bind /tmp/printk /proc/sys/kernel/printk
...didn't work as expected.  (Messages still show.)

I tried setting dmesg to zero...  still no luck.
Any idea where I'm missing putting a cork in this one without having to recompile the source to do so?

Thanks!

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 11044
Re: Trying to quiet ACPId during boot
« Reply #1 on: November 18, 2015, 01:00:33 PM »
If you're sure it's output to the kernel log, use the loglevel= bootcode.
The only barriers that can stop you are the ones you create yourself.

Offline CentralWare

  • Retired Admins
  • Hero Member
  • *****
  • Posts: 764
Re: Trying to quiet ACPId during boot
« Reply #2 on: November 19, 2015, 03:08:22 AM »
@Curaga:
Without digging through the sources for both acpid and start-stop-daemon, the term "sure" (as to whether or not it's StdErr versus StdOut)...  not really sure a'tall. :)

After experimenting for the past hour and change (skipping start-stop-daemon, tinkering with logging, etc.) the following were required to put a cork in acpid:

1) The --quiet flag in start-stop-daemon must be the first in the command line.  Anywhere else and it seems to be ignored.
    start-stop-daemon --start --quiet --exec /usr/local/sbin/acpid Does not work to prevent output
    start-stop-daemon --quiet --start --exec /usr/local/sbin/acpid Works (to a degree with acpid, completely elsewhere for the few I tested)

2) Adding -l /dev/null to the command line when launching the binary sends all logging to oblivion...  which has its down-side as well.

For my needs in this situation, acpid is only being used to detect the power button, so killing the logging/output altogether is of no extreme consequence.
Based on how it reacted, my theory is that acpid itself is not being detached/disowned from tty0 and since the terminal count in TCL is (by design) limited to the one on boot, it's likely programmed to attach itself to the last terminal on the list for output - or at least that is how I would have done it :)  Then again, had I designed acpid, I would have programmed in a switch to disable screen output entirely.