DeMus wrote:Just post your solution, others will be very thankful.
// allow suspend for all users
polkit.addRule(function(action, subject) {
if ((action.id == "org.freedesktop.login1.suspend")) {
return polkit.Result.YES;
}
});
polkit.addRule(function(action, subject) {
if ((action.id == "org.freedesktop.login1.suspend-multiple-sessions")) {
return polkit.Result.YES;
}
});
// allow changing brighness for all users
polkit.addRule(function(action, subject) {
if ((action.id == "org.kde.powerdevil.backlighthelper.brightness")) {
return polkit.Result.YES;
}
});
polkit.addRule(function(action, subject) {
if ((action.id == "org.kde.powerdevil.backlighthelper.setbrightness")) {
return polkit.Result.YES;
}
});
tomane wrote:According to polkit documentation, rules can be added in /etc/polkit-1/rules.d and /usr/share/polkit-1/rules.d directories.
I added my rules in directory /usr/share/polkit-1/rules.d/
doktor5000 wrote:custom rules should only be added in /etc/polkit-1/rules.d as that way you ensure that they are not touched by upgrades,
doktor5000 wrote:Well, you probably will. FWIW, you might want to see https://wiki.mageia.org/en/Useful_polkit_policies
tomane wrote:I'm not sure you understand well what polkit does : polkit allows a regular user to change system settings (that can be very basic like mounting usb keys or changing brightness) that normally (ie without polkit) require to be logged as root, either by asking root password, asking user password or just without notification, depending on the default rule.
tomane wrote:Actually, as I already said, none of the default rules work for me since last update.
tomane wrote:At the moment, I'm hesitating between continuing like that or reinstalling completely mageia 5.
I don't think just reinstalling polkit is possible, if you know a way to do that, please tell me.
urpmi --replacepkgs --replacefiles $(rpm -qa | grep polkit)
cat /run/systemd/users/$(id -u)
ps -ef|grep -v grep|grep -iE "polkit|policykit"
systemctl status polkit.service -a
how do you start your X session
how do you login to your X session, and is this your first login on this boot or did you logout/login before on this boot?
output of the following commands:
$ cat /run/systemd/users/$(id -u)
# This is private data. Do not parse.
NAME=brian
STATE=online
RUNTIME=/run/user/1001
SERVICE=user@1001.service
SLICE=user-1001.slice
DISPLAY=c5
REALTIME=1444082187250185
MONOTONIC=40551042148
SESSIONS=c5 c4 c2
SEATS=seat0 seat0 seat0
ACTIVE_SESSIONS=c5
ONLINE_SESSIONS=c5
ACTIVE_SEATS=seat0
ONLINE_SEATS=seat0
$ ps -ef|grep -v grep|grep polkit
polkitd 2325 1 0 06:41 ? 00:00:00 /usr/lib/polkit-1/polkitd --no-debug
brian 23112 1 0 20:59 ? 00:00:00 /usr/lib64/kde4/libexec/polkit-kde-authentication-agent-1
$ systemctl status polkit.service -a
● polkit.service - Authorization Manager
Loaded: loaded (/usr/lib/systemd/system/polkit.service; static)
Active: active (running) since Mon 2015-10-05 10:41:46 EDT; 10h ago
Docs: man:polkit(8)
Main PID: 2325 (polkitd)
CGroup: /system.slice/polkit.service
└─2325 /usr/lib/polkit-1/polkitd --no-debug
$ grep -i state /run/systemd/users/$(id -u)
STATE=online
[root@localhost brian]# drakconf&
[1] 27289
[root@localhost brian]# "/usr/sbin/drakmenustyle" is not executable [Menus] at /usr/libexec/drakconf line 831.
"/usr/sbin/drakbackup" is not executable [Backups] at /usr/libexec/drakconf line 831.
"/usr/sbin/tomoyo-gui" is not executable [Tomoyo Policy] at /usr/libexec/drakconf line 831.
"/usr/sbin/drakguard" is not executable [Parental Controls] at /usr/libexec/drakconf line 831.
banjo wrote:
- Code: Select all
$ grep -i state /run/systemd/users/$(id -u)
STATE=online
I have to admit that I don't understand what most of those results mean. What does STATE=online mean in this context?
https://bugs.mageia.org/show_bug.cgi?id=16396#c8 wrote:I was just looking into what this STATE business was all about and found this on the sd_uid_get_state (3) manpage:
- "online" (user logged in, but not active, i.e. has no session in the foreground),
- "active" (user logged in, and has at least one active session, i.e. one session in the foreground)
tomane wrote:Same thing for me as Banjo.
State is online.
I don't know what it means, but it's a bit strange.
First I don't understand really why it affects polkit, you would say "never mind" but I personally mind. Second, if it affects polkit, it may also affect other things.
tomane wrote:I've had some strange problems with the sound.
And it also, probably, means that the bug is not in polkit.
tomane wrote:EDIT: Ok, I just read the comment https://bugs.mageia.org/show_bug.cgi?id=16396#c14
So, nothing related with polkit.
cat /run/systemd/users/$(id -u)
# This is private data. Do not parse.
NAME=brian
STATE=active
RUNTIME=/run/user/1001
SERVICE=user@1001.service
SLICE=user-1001.slice
DISPLAY=c2
REALTIME=1444476838390042
MONOTONIC=23311952
SESSIONS=c2 c1
SEATS=seat0 seat0
ACTIVE_SESSIONS=c2
ONLINE_SESSIONS=c2
ACTIVE_SEATS=seat0
ONLINE_SEATS=seat0
doktor5000 wrote:DiBosco wrote:Am I missing something?
Yes, essential information. See viewtopic.php?p=59728#p59728
doktor5000 wrote:Happens because this thread was a global announcement, which changes the link depending from which forum you are viewing it. Changed it back to a normal topic now, try again.
Anyways, it's just a dozen posts further up, and linked also in bold red big letters in the initial post of this thread.
grep -i state /run/systemd/users/$(id -u)
STATE=active
cat /run/systemd/users/$(id -u)
# This is private data. Do not parse.
NAME=robertw
STATE=active
RUNTIME=/run/user/500
SERVICE=user@500.service
SLICE=user-500.slice
DISPLAY=c2
REALTIME=1452534880026436
MONOTONIC=52987573
SESSIONS=c2 c1
SEATS=seat0 seat0
ACTIVE_SESSIONS=c2
ONLINE_SESSIONS=c2
ACTIVE_SEATS=seat0
ONLINE_SEATS=seat0
[robertw@linux ~]$
ps -ef|grep -v grep|grep -iE "polkit|policykit"
robertw 9879 1 0 18:17 ? 00:00:00 /usr/lib64/kde4/libexec/polkit-kde-authentication-agent-1
polkitd 10857 1 0 18:25 ? 00:00:00 /usr/lib/polkit-1/polkitd --no-debug
systemctl status polkit.service -a
● polkit.service - Authorization Manager
Loaded: loaded (/usr/lib/systemd/system/polkit.service; static)
Active: active (running) since Mon 2016-01-11 18:25:15 GMT; 10min ago
Docs: man:polkit(8)
Main PID: 10857 (polkitd)
CGroup: /system.slice/polkit.service
└─10857 /usr/lib/polkit-1/polkitd --no-debug
Jan 11 18:25:15 linux.local polkitd[10857]: Started polkitd version 0.113
Jan 11 18:25:15 linux.local polkitd[10857]: Loading rules from directory /etc/polkit-1/rules.d
Jan 11 18:25:15 linux.local polkitd[10857]: Loading rules from directory /usr/share/polkit-1/rules.d
Jan 11 18:25:15 linux.local polkitd[10857]: Finished loading, compiling and executing 3 rules
Jan 11 18:25:15 linux.local polkitd[10857]: Acquired the name org.freedesktop.PolicyKit1 on the system bus
Jan 11 18:25:15 linux.local polkitd[10857]: Registered Authentication Agent for unix-session:c2 (system bus name :1.134 [/usr/lib64/kde4/libexec/polkit-kde-authentication-agent-1], object path /org/kde/PolicyKit1/AuthenticationAgent, locale en_GB.UTF-8)
Jan 11 18:25:26 linux.local polkitd[10857]: Operator of unix-session:c2 successfully authenticated as unix-user:root to gain TEMPORARY authorization for action org.mageia.drakconf.pkexec.run for unix-process:10882:189580 [/usr/bin/perl /usr/bin/drakconf] (owned by unix-user:robertw)
[root@linux robertw]#
DiBosco wrote:OK, sorry if I'm being slow or dumb, but I followed those links at the top of the thread last night and couldn't see any fix there. I'm clearly missing something important, but maybe I've just stared at this too long.
pkexec whoami
Users browsing this forum: No registered users and 1 guest