<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.kde.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugs.kde.org/"
          
          maintainer="sysadmin@kde.org"
>

    <bug>
          <bug_id>506052</bug_id>
          
          <creation_ts>2025-06-23 14:44:15 +0000</creation_ts>
          <short_desc>powerdevil cannot start because of CAP_WAKE_ALARM for users with UIDs below 500 or above 1000</short_desc>
          <delta_ts>2025-07-03 12:01:39 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>4</classification_id>
          <classification>Plasma</classification>
          <product>plasmashell</product>
          <component>Power management &amp; brightness</component>
          <version>6.4.0</version>
          <rep_platform>Arch Linux</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>regression</keywords>
          <priority>HI</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>1.0</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter>yamagi</reporter>
          <assigned_to name="Plasma Bugs List">plasma-bugs-null</assigned_to>
          <cc>antoine.gatineau</cc>
    
    <cc>bshah</cc>
    
    <cc>chaitanya.chalasani</cc>
    
    <cc>jankmann</cc>
    
    <cc>joe</cc>
    
    <cc>john</cc>
    
    <cc>jonathan.lieb</cc>
    
    <cc>kdedev</cc>
    
    <cc>nate</cc>
    
    <cc>theo</cc>
    
    <cc>walmartshopper</cc>
          
          <cf_commitlink>https://invent.kde.org/plasma/powerdevil/-/commit/6b9fc3d4688219029b94739d348491d433445dd3</cf_commitlink>
          <cf_versionfixedin>6.4.2</cf_versionfixedin>
          <cf_sentryurl></cf_sentryurl>
          <votes>0</votes>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>2435410</commentid>
    <comment_count>0</comment_count>
    <who name="">yamagi</who>
    <bug_when>2025-06-23 14:44:15 +0000</bug_when>
    <thetext>Since Plasma 6.4.0 the powerdevil systemd unit sets &apos;AmbientCapabilities=CAP_WAKE_ALARM&apos;. powerdevil is spawned as a user service and can only gain capabilities which the &apos;systemd --user&apos; service for the session has:

% ps auxww | grep &quot;systemd --user&quot;
yamagi    1180  0.0  0.0  21804 11744 ?        Ss   07:26   0:01 /usr/lib/systemd/systemd --user 

% cat /proc/1180/status | grep CapAmb
CapAmb: 0000000000000000

-&gt; The &apos;systemd --user&apos; has no ambient capabilities, therefor it cannot set &apos;CAP_WAKE_ALARM&apos; and starting powerdevil fails:

% journalctl --user -xu plasma-powerdevil.service
Jun 23 08:52:04 blubb (werdevil)[17116]: plasma-powerdevil.service: Failed to apply ambient capabilities (before UID change): Operation not permitted
Jun 23 08:52:04 blubb (werdevil)[17116]: plasma-powerdevil.service: Failed at step CAPABILITIES spawning /usr/lib/org_kde_powerdevil: Operation not permitted

This can be worked around by commenting the &apos;AmbientCapabilities=CAP_WAKE_ALARM&apos;. Functionality requiring the CAP_WAKE_ALARM won&apos;t work, though.

Linux/KDE Plasma: Arch Linux as of 23.06.2025 ca. 05:00 UTC with Linux 6.15.3-arch1-1 and systemd 257.6-1
KDE Plasma Version: 6.4.0
KDE Frameworks Version: 6.15.0
Qt Version: 6.9.1</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2435519</commentid>
    <comment_count>1</comment_count>
    <who name="Antonio Rojas">arojas</who>
    <bug_when>2025-06-23 18:56:49 +0000</bug_when>
    <thetext>*** Bug 506062 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2435649</commentid>
    <comment_count>2</comment_count>
    <who name="John Kizer">john</who>
    <bug_when>2025-06-24 06:52:53 +0000</bug_when>
    <thetext>For what it&apos;s worth, I can&apos;t reproduce this issue on my Fedora KDE 42 device with Plasma built from git master, so it does include that AmbientCapabilities line, and systemd 257.6.

For others&apos; reference, the relevant code change was made here: https://invent.kde.org/plasma/powerdevil/-/merge_requests/537</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2435927</commentid>
    <comment_count>3</comment_count>
    <who name="Nate Graham">nate</who>
    <bug_when>2025-06-24 19:11:04 +0000</bug_when>
    <thetext>I also can&apos;t reproduce it, either with Fedora packages, or built-from-source powerdevil.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2436084</commentid>
    <comment_count>4</comment_count>
    <who name="Bhushan Shah">bshah</who>
    <bug_when>2025-06-25 04:36:02 +0000</bug_when>
    <thetext>I can&apos;t really reproduce this in Arch Linux setup with same version of systemd and plasma.

Are you using by chance systemd-homed or anything special in your setup wrt PAM or systemd?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2436086</commentid>
    <comment_count>5</comment_count>
    <who name="Bhushan Shah">bshah</who>
    <bug_when>2025-06-25 04:38:26 +0000</bug_when>
    <thetext>For reference CapAmb is wrong for some reason but this is correctly shown,

➜ pscap -p 1739
ppid  pid   uid         command             capabilities
1315  1739  bshah       org_kde_powerde     wake_alarm @ +

~ …
➜ pscap -p 1315
ppid  pid   uid         command             capabilities
1     1315  bshah       systemd             wake_alarm +</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2436115</commentid>
    <comment_count>6</comment_count>
    <who name="">yamagi</who>
    <bug_when>2025-06-25 07:01:12 +0000</bug_when>
    <thetext>Bhushans hints helped a lot. I figured it out. As already suspected this isn&apos;t a KDE problem but a configuration problem at my side: Since version 254 systemd adds CAP_WAKE_ALARM via pam_systemd to the user session - https://github.com/systemd/systemd/blob/0e2f18eedd6b9be32b1c1122dcd2c30319074c7f/NEWS#L703 when compiled with defaults  systemd treats UIDs &gt;= 1000 as user accounts and UIDs &gt;= 500 &amp;&amp; &lt; 1000 as system accounts. This cannot be overridden in /etc/login.defs unless systemd is compiled with -Dcompat-mutable-uid-boundaries=true which Arch doesn&apos;t set.  Sometimes I&apos;m  forced to work on AFS filesystems (yes, these things still exists) and out of convenience I set my local UID to my AFS UID 691. Since UID 691 is treated as a system user systemd doesn&apos;t set CAP_WAKE_ALARM on the session and powerdevil cannot start. Changing the UID to 1001 helps.

With this the problem is solved for me. I&apos;m not closing here because there were other reports marked as duplicate of this bug, they might be caused by different configuration errors or something else. Nevertheless sorry for the noise. :/</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2436265</commentid>
    <comment_count>7</comment_count>
    <who name="">walmartshopper</who>
    <bug_when>2025-06-25 16:55:48 +0000</bug_when>
    <thetext>Changing my uid from 501 to 1000 solved this issue for me.  It also fixed kcm_users not working correctly.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2436282</commentid>
    <comment_count>8</comment_count>
    <who name="John Kizer">john</who>
    <bug_when>2025-06-25 17:24:43 +0000</bug_when>
    <thetext>Hi - Bhushan&apos;s already checked in with the original reporter for that issue that was merged in with this one, so I think it&apos;s safe to mark this one resolved (and then reopen the other one if needed). Thanks!</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2436403</commentid>
    <comment_count>9</comment_count>
    <who name="Theodore Lintkins">theo</who>
    <bug_when>2025-06-25 22:40:16 +0000</bug_when>
    <thetext>I ran into this bug as well, but on the other side of UID range. This is not a Plasma bug per se, but it may be practically necessary to handle these situations better than by failing to start powerdevil.

My environment is all Red Hat IdM joined and the UID base is 82800000. FreeIPA, AD joined sssd, and other AD auth tools will also result in high UID numbers that pam_systemd will consider to be of &quot;container&quot; disposition, and thus will not have any ambient capabilities. So, this is an issue that is likely to affect many larger environments with centralized user management.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2436417</commentid>
    <comment_count>10</comment_count>
    <who name="Joe Knock">joe</who>
    <bug_when>2025-06-25 23:37:18 +0000</bug_when>
    <thetext>I am also using FreeIPA with SSSD (uid=1000003) and I am running into the same issue.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2436555</commentid>
    <comment_count>11</comment_count>
    <who name="Chaitanya Chalasani">chaitanya.chalasani</who>
    <bug_when>2025-06-26 11:57:33 +0000</bug_when>
    <thetext>I have sssd uid 694702680 and powerdevil fails</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2437237</commentid>
    <comment_count>12</comment_count>
    <who name="Antoine Gatineau">antoine.gatineau</who>
    <bug_when>2025-06-29 07:54:55 +0000</bug_when>
    <thetext>hello, same issue with freeipa account (uid=1678900673).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2437393</commentid>
    <comment_count>13</comment_count>
    <who name="Bug Janitor Service">bug-janitor</who>
    <bug_when>2025-06-30 07:14:58 +0000</bug_when>
    <thetext>A possibly relevant merge request was started @ https://invent.kde.org/plasma/powerdevil/-/merge_requests/568</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2437498</commentid>
    <comment_count>14</comment_count>
    <who name="">jankmann</who>
    <bug_when>2025-06-30 16:23:49 +0000</bug_when>
    <thetext>FYI: The workaround posted here https://bugzilla.opensuse.org/show_bug.cgi?id=1245256 is working for me with FreeIPA. Adding a file in &quot;/etc/userdb&quot; that changes the disposition back(?) to regular allowed powerdevil to start again.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2438186</commentid>
    <comment_count>15</comment_count>
    <who name="Nate Graham">nate</who>
    <bug_when>2025-07-03 12:01:39 +0000</bug_when>
    <thetext>Fixed by Bhushan Shah with https://invent.kde.org/plasma/powerdevil/-/commit/6b9fc3d4688219029b94739d348491d433445dd3 for Plasma 6.4.2!</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>