Xfce Forum

Sub domains
 

You are not logged in.

#1 2015-11-30 09:41:42

dancaer69
Member
Registered: 2015-08-30
Posts: 9

Authorization problems with xfce without desktop manager

Hello,
I've recently installed ubuntu minimal(only the base system) and the provided packages xfce4 and xfce4-goodies. The problem is that I don't want to use a desktop manager, but without it I have authorization problems. I cannot reboot/shutdown without asked for password from polkit and I cannot run systemctl reboot from terminal without authorization(this works fine if I run it from tty console). I also cannot add or edit connections in network-manager. I tried to create a file in /etc/polkit1/localauthority/50-local.d folder with this content:

[Local restart]
#Identity=unix-user: myuser
Identity=unix-group:powerdev
Action=org.freedesktop.consolekit.system.restart
ResultAny=yes
ResultInactive=no
ResultActive=yes

[Local shutdown]
#Identity=unix-user: myuser
Identity=unix-group:powerdev
Action=org.freedesktop.consolekit.system.stop
ResultAny=yes
ResultInactive=no
ResultActive=yes

[Local restart - multiple]
#Identity=unix-user: myuser
Identity=unix-group:powerdev
Action=org.freedesktop.consolekit.system.restart-multiple-users
ResultAny=yes
ResultInactive=no
ResultActive=yes

[Local shutdown - multiple]
#Identity=unix-user: myuser
Identity=unix-group:powerdev
Action=org.freedesktop.consolekit.system.stop-multiple-users
ResultAny=yes
ResultInactive=no
ResultActive=yes

but seems that is ignored.
These problems go away with xdm installed, but it doesn't support autologin and it's faster and simpler and lighter to autologin without a desktop manager.
I autologin the user via a systemd service and I use .xinitrc and .bash_profile to start xfce. These are the contents of those files:
.xinitrc:

#!/bin/sh

userresources=$HOME/.Xresources
usermodmap=$HOME/.Xmodmap
sysresources=/etc/X11/xinit/.Xresources
sysmodmap=/etc/X11/xinit/.Xmodmap

# merge in defaults and keymaps

if [ -f $sysresources ]; then

    xrdb -merge $sysresources

fi

if [ -f $sysmodmap ]; then
    xmodmap $sysmodmap
fi

if [ -f "$userresources" ]; then

    xrdb -merge "$userresources"

fi

if [ -f "$usermodmap" ]; then
    xmodmap "$usermodmap"
fi

# start some nice programs

if [ -d /etc/X11/xinit/xinitrc.d ] ; then
 for f in /etc/X11/xinit/xinitrc.d/?*.sh ; do
  [ -x "$f" ] && . "$f"
 done
 unset f
fi
# Here Xfce is kept as default
session=${1:-xfce}

case $session in
    awesome           ) exec awesome;;
    bspwm             ) exec bspwm;;
    catwm             ) exec catwm;;
    cinnamon          ) exec cinnamon-session;;
    dwm               ) exec dwm;;
    enlightenment     ) exec enlightenment_start;;
    ede               ) exec startede;;
    fluxbox           ) exec startfluxbox;;
    gnome             ) exec gnome-session;;
    gnome-classic     ) exec gnome-session --session=gnome-classic;;
    i3|i3wm           ) exec i3;;
    icewm             ) exec icewm-session;;
    jwm               ) exec jwm;;
    kde               ) exec startkde;;
    mate              ) exec mate-session;;
    monster|monsterwm ) exec monsterwm;;
    notion            ) exec notion;;
    openbox           ) exec openbox-session;;
    unity             ) exec unity;;
    xfce|xfce4        ) exec startxfce4 --with-ck-launch ;;
    xmonad            ) exec xmonad;;
    lumina            ) exec Lumina-DE;;
    # No known session, try to run it as command
    *) exec $1;;
esac

.xsession:

#!/bin/sh

#
# ~/.xsession
#
# Executed by xdm/gdm/kdm at login
#

/bin/bash --login -i ~/.xinitrc

.bash_profile:

#
# ~/.bash_profile
#
[[ -f ~/.bashrc ]] && . ~/.bashrc
#[[ -z $DISPLAY && $XDG_VTNR -eq 1 ]] && /home/useful/selSession.sh
[[ -z $DISPLAY && $XDG_VTNR -eq 1 ]] && xinit xfce

I also tried  "--with-ck-launch" but it didn't make any difference.
How to fix this?

Last edited by dancaer69 (2015-11-30 09:44:11)

Offline

#2 2015-11-30 16:29:29

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 11,494

Re: Authorization problems with xfce without desktop manager

Is the polkit-gnome-authentication-agent-1 process running? I found that I had to comment out the "AutostartCondition" line in /etc/xdg/autostart/polkit-gnome-authentication-agent-1.desktop file for it to start automatically in the Xfce environment.

I also copy over the /etc/xdg/xfce4/xinitrc file to ~/.xinitrc and use "startx" to fire up the session. I prepend:

if [ -d /etc/X11/xinit/xinitrc.d ] ; then
 for f in /etc/X11/xinit/xinitrc.d/?*.sh ; do
  [ -x "$f" ] && . "$f"
 done
 unset f
fi

...this snippet just after the first line in this .xinitrc file to ensure that the dbus environment is properly set up.

Here is my ~/.bash_profile:

#
# ~/.bash_profile
#
[[ -f ~/.bashrc ]] && . ~/.bashrc
[[ -z $DISPLAY && $XDG_VTNR -eq 1 ]] && startx

Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Offline

#3 2015-11-30 20:20:28

dancaer69
Member
Registered: 2015-08-30
Posts: 9

Re: Authorization problems with xfce without desktop manager

Thank you very much.
Your way works with startx. I did all that you suggested and I started xfce with startxfce4 at first and there was no difference. But starting xfce with startx worked as expected.

Offline

#4 2015-12-01 18:26:10

dancaer69
Member
Registered: 2015-08-30
Posts: 9

Re: Authorization problems with xfce without desktop manager

Hello again,
I thought that the problem solved, but I still have authentication problems with polkit. Now I have problems when an application needs authentication, as gparted or any other which need root rights and uses polkit(I can use sudo without problem). Then the desktop locks and the only think I can get is to kill X from another tty.

Offline

#5 2015-12-01 19:53:11

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 11,494

Re: Authorization problems with xfce without desktop manager

How are you starting the applications that require root access? Which other applications are you trying to run?

Ubuntu no longer ships gksu/gksudo installed by default and have migrated over to pkexec. For gparted, try running "gparted-pkexec" and see if that gets it working.

Other apps, like for example mousepad, need a special pkexec policy file. This particular file is now included in the xubuntu-default-settings package. For other apps, you'll need to create these policy files (you can use the mousepad one as an example).

Or alternatively, install the "gksu" package and use gksudo to start the applications. My understanding is that gksudo is deprecated though.


Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Offline

#6 2015-12-01 20:13:00

dancaer69
Member
Registered: 2015-08-30
Posts: 9

Re: Authorization problems with xfce without desktop manager

Sorry, I forgot to update my post. I fixed this by enable Policykit authentication agent in autostart. It was disabled and the authentication dialog could not run.

Offline

Registered users online in this topic: 0, guests: 1
[Bot] ClaudeBot

Board footer

Powered by FluxBB
Modified by Visman

[ Generated in 0.010 seconds, 7 queries executed - Memory usage: 546.63 KiB (Peak: 547.47 KiB) ]