Bug 575320

Summary: acpid fails to load any event config files
Product: [Fedora] Fedora Reporter: Valdis Kletnieks <valdis.kletnieks>
Component: acpidAssignee: Jiri Skala <jskala>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: low    
Version: rawhideCC: aglotov, jskala, ted
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2010-04-02 09:21:36 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

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.