From Bugzilla Helper: User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4.1) Gecko/20031114 Epiphany/1.0.4 Description of problem: initreq.h is a header file which is required by pbbuttonsd, a package for controlling power management and the "extra keys" that do things like volume, brightness, etc. on laptops (i386 and ppc). This header file basically contains one structure which said program needs, and there's no reason not to export it to /usr/include. See the attached patch. After this patch is applied, I can package up pbbuttonsd for FC. Version-Release number of selected component (if applicable): SysVinit-2.85-21 How reproducible: Always Steps to Reproduce: 1. Try to compile a program which #include's <initreq.h> Additional info:
Created attachment 98817 [details] adds initreq.h to the RPM Of course, header files belong in -devel packages, but it seems hardly worth it for one very small header file. If the maintainer feels it's worth it, I guess technically it should be split up.
Why do the volume/brightness buttons need to signal *init*?
int The daemon has two functions: - those buttons - power management init is used in the latter function. More specifically, here's where it's used to send SIGPWR to init: send_sigpwr (char mode) { struct init_request initreq; FILE *fd; int err = -1; initreq.magic = INIT_MAGIC; initreq.cmd = mode == 'F' ? INIT_CMD_POWERFAIL : INIT_CMD_POWEROK; initreq.sleeptime = 5; if ((fd = fopen(INIT_FIFO, "r+")) != NULL) { err = 0; if ((fwrite(&initreq, sizeof(initreq), 1, fd)) != 1) err = -1; fclose(fd); } if (err == -1) { if ((fd = fopen("/etc/powerstatus", "w")) != NULL) { err = 0; if ((fwrite(&mode, 1, 1, fd)) != 1) err = -1; fclose(fd); } err = kill(1, SIGPWR); /* send SIGPWR to the INIT process */ } return err; }
Hm, it would be simpler if those were gated through the same mechanism as the ACPI buttons.
I forwarded on this bug report to the author of pbbuttonsd. Here is his response: --------------------------------------------------------------------- pbbuttonsd is a power management daemon for apple powerpc machines which don't support ACPI. PBButtonsd can be configured to tell init about the low battery condition. Init has appropriate mechanisms to handle such emergency conditions. Usually an application writes the file /etc/powerstatus and send the signal SIGPWR to the init process but the man page of init (8) depreciated this method: --- quote --- Usage of SIGPWR and /etc/powerstatus is discouraged. Someone wanting to interact with init should use the /dev/initctl control channel - see the source code of the sysvinit package for more documentation about this. --- quote off --- You see installing the include file initreq.h is a step forward. Best Regards Matthias Grimm ---------------------------------------------------------------------
Also from the init man page: [quote] INTERFACE Init listens on a fifo in /dev, /dev/initctl, for messages. Telinit uses this to communicate with init. The interface is not very well documented or finished. Those interested should study the initreq.h file in the src/ subdirectory of the init source code tar archive. [/quote] So, to use the /dev/initctl interface, you need the header that patch provides. From initreq.h: #define INIT_FIFO "/dev/initctl" and from the code listing above: if ((fd = fopen(INIT_FIFO, "r+")) != NULL) So, this looks like the recommended way, from reading the man page.
Yes, it's just that there are also acpi-using buttons for doing soft-power off. In the Grand Scheme, it would be nice to have them all going through the same interface. :)
That may well be so (or not, my knowledge is limited in this area). However, either way, the initreq.h header should be included in any case, because it's inconsistent with the init(8) man page not to include it. The man page says "we recommend you do this, see this header file" (ie. use what's in there, implying #include it). Without the header file included, there is no way *any* application could follow the recommended practice from the man page. Whether or not pbbuttonsd should be using this header file is another discussion, I guess.
Will be fixed in 2.86-1.
Package name is now sysvinit in Fedora.