Bug 575320 - acpid fails to load any event config files
Summary: acpid fails to load any event config files
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: acpid
Version: rawhide
Hardware: All
OS: Linux
low
medium
Target Milestone: ---
Assignee: Jiri Skala
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2010-03-20 03:14 UTC by Valdis Kletnieks
Modified: 2014-11-09 22:32 UTC (History)
3 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2010-04-02 09:21:36 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Valdis Kletnieks 2010-03-20 03:14:50 UTC
Description of problem:

# /usr/sbin/acpid -f -d -d -d -l
acpid: proc fs opened successfully
acpid: starting up with proc fs
acpid: skipping conf file /etc/acpi/events/video.conf
acpid: skipping conf file /etc/acpi/events/..
acpid: skipping conf file /etc/acpi/events/.
acpid: skipping conf file /etc/acpi/events/power.conf
acpid: 0 rules loaded

Looking at the source, we find this in events.c:

        /* Compile the regular expression.  This is based on run-parts(8). */
        rc = regcomp(&preg, "^[a-zA-Z0-9_-]+$", RULE_REGEX_FLAGS);
...

                /* skip any files that don't match the run-parts convention */
                if (regexec(&preg, dirent->d_name, 0, NULL, 0) != 0) {
                        acpid_log(LOG_DEBUG, "skipping conf file %s/%s\n",
                                confdir, dirent->d_name);
                        continue;
                }

Unfortunately, since power.conf and video.conf as shipped have a '.' in the filename and the regexp doesn't, they get skipped.

Is this a new thing that the sysadmin needs to rename the *.conf files in order to make them start working?

In addition, the "run-parts convention" seems to be something other than what that regexp actually implements - /usr/bin/run-parts has this:

for i in $(LC_ALL=C; echo $1/*[^~,]) ; do
        [ -d $i ] && continue
        # Don't run *.{rpmsave,rpmorig,rpmnew,swp,cfsaved} scripts
        [ "${i%.cfsaved}" != "${i}" ] && continue
        [ "${i%.rpmsave}" != "${i}" ] && continue
        [ "${i%.rpmorig}" != "${i}" ] && continue
        [ "${i%.rpmnew}" != "${i}" ] && continue
        [ "${i%.swp}" != "${i}" ] && continue
        [ "${i%,v}" != "${i}" ] && continue

In particular, those 'continue' are a bunch more specific than what the regexp does.

Version-Release number of selected component (if applicable):
acpid-2.0.3-1.fc14.x86_64

How reproducible:


Steps to Reproduce:
1.
2.
3.
  
Actual results:


Expected results:


Additional info:

Comment 1 Ted Felix 2010-03-20 21:55:09 UTC
Thanks for the detailed bug report.

This is indeed a new feature in the acpid.  It is based on a version of run-parts that is different from the one you are examining.

I recommend that Fedora rename the config files to remove the dot.  So video.conf becomes videoconf.  This keeps acpid consistent across distros. 

You can do this manually now as a workaround.

Comment 2 Valdis Kletnieks 2010-03-21 17:14:53 UTC
Why not just lose the entire '.conf'?  'mv power.conf power' and be done with
it? fooconf rather than foo or foo.conf just looks odd. ;)

Comment 3 Jiri Skala 2010-04-02 09:21:36 UTC
The acpid will install config files without dot. There is added scriptlet renaming config files.


Note You need to log in before you can comment on or make changes to this bug.