DaemonForums  

Go Back   DaemonForums > OpenBSD > OpenBSD Packages and Ports

OpenBSD Packages and Ports Installation and upgrading of packages and ports on OpenBSD.

Reply
 
Thread Tools Display Modes
  #1   (View Single Post)  
Old 9th February 2020
philo_neo71 philo_neo71 is offline
Spam Deminer
 
Join Date: Jul 2009
Posts: 278
Default non root user xfce4 does not start

hello, i chose to install openBSD 6.5 with xfce4, in root mode xfce4 starts well.
when i use a non root user xfce4 does not start and returns me user rights errors.
how can i set the user rights so that xfce4 starts?
Reply With Quote
  #2   (View Single Post)  
Old 9th February 2020
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 7,984
Default

You must either upgrade to the most recent release, or use xenodm(1). OpenBSD 6.5 does not permit non-root users to execute startx(1) or xinit(1).

This matter was discussed in the 6.5 Upgrade Guide:
Quote:
Xorg(1). The Xorg binary is no longer installed setuid, so startx(1) can no longer be used by non-root users. The xenodm(1) display manager has to be used instead.

To set it up:

# rcctl enable xenodm
# rcctl start xenodm

If you wish to customize X you need to create an executable .xsession file.
Reply With Quote
  #3   (View Single Post)  
Old 9th February 2020
philo_neo71 philo_neo71 is offline
Spam Deminer
 
Join Date: Jul 2009
Posts: 278
Default

Customizing X for start xfce4 ?
what can i put in .xsession file for startxfce4 command ?
Reply With Quote
  #4   (View Single Post)  
Old 9th February 2020
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 7,984
Default

The .xsession script file is similar to the .xinitrc script. Some admins use a linked filename, if these scripts happen to have the exact same contents.

From the xenodm(1) man page:
Quote:
Then xenodm runs the Xsession script as the user. This system session file may do some additional startup and typically runs the .xsession script in the user's home directory. When the Xsession script exits, the session is over.
Reply With Quote
  #5   (View Single Post)  
Old 10th February 2020
shep shep is offline
Real Name: Scott
Arp Constable
 
Join Date: May 2008
Location: Dry and Dusty
Posts: 1,507
Default

From the xfce4 meta-package readme:

Code:
$OpenBSD: README-main,v 1.14 2019/08/15 07:16:48 landry Exp $

+-----------------------------------------------------------------------
| Running ${PKGSTEM} on OpenBSD
+-----------------------------------------------------------------------

The Xfce desktop is composed of 2 meta-packages:
    * xfce, for a base Xfce installation
    * xfce-extras, for a full Xfce installation.

Startup
=======
Xfce desktop environment is launched through the 'startxfce4' script.
Simply add '${LOCALBASE}/bin/startxfce4' to your .xinitrc/.xsession
script if you use startx, xenodm or slim.
If you use gdm or kdm, have a look at
https://wiki.xfce.org/faq#starting_xfce. An xfce4.desktop file is
provided for use by gdm.
Your ~/.xsession needs to be executable.

http://cvsweb.openbsd.org/cgi-bin/cv...ype=text/plain
Reply With Quote
  #6   (View Single Post)  
Old 10th February 2020
johnR johnR is offline
Fdisk Soldier
 
Join Date: Nov 2017
Posts: 57
Default

Quote:
Originally Posted by shep View Post
Your ~/.xsession needs to be executable.
If the commands listed in ./xsession are executable, why does ./xsession itself need to be executable? IIUC it's just a configuration file.

Last edited by johnR; 10th February 2020 at 02:42 PM.
Reply With Quote
  #7   (View Single Post)  
Old 10th February 2020
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 7,984
Default

It is an executed script if executable, or called in a separate shell if not.

$ tail -20 /etc/X11/xenodm/Xsession

Last edited by jggimi; 10th February 2020 at 05:09 PM. Reason: clarity, and not enough lines. -15 changed to -20
Reply With Quote
  #8   (View Single Post)  
Old 10th February 2020
johnR johnR is offline
Fdisk Soldier
 
Join Date: Nov 2017
Posts: 57
Default

Quote:
Originally Posted by jggimi View Post
It is an executed script if executable, or called in a separate shell if not.
Thanks for the explanation.
Reply With Quote
  #9   (View Single Post)  
Old 16th February 2020
hitest's Avatar
hitest hitest is offline
Real Name: George Nielsen
VPN Cryptographer
 
Join Date: Sep 2008
Location: B.C., Canada
Posts: 375
Default

Code:
bsd$ cat .xsession
exec ck-launch-session startxfce4
The above code works for me on XFCE4 and OpenBSD 6.6.

I edit /etc/group and add my regular user to the operator group so that I can use the XFCE4 shutdown button to turn off my laptop.
__________________
hitest
Reply With Quote
Old 17th February 2020
CiotBSD CiotBSD is offline
c107:b5d::
 
Join Date: Jun 2019
Location: Under /
Posts: 175
Default

You can just use into your personal .xsession:

Code:
startxfce4 --with-ck-launch
And, yes for the group operator; it's necessary!

__________________
GPG:Fingerprint ed25519 : 072A 4DA2 8AFD 868D 74CF 9EA2 B85E 9ADA C377 5E8E
GPG:Fingerprint rsa4096 : 4E0D 4AF7 77F5 0FAE A35D 5B62 D0FF 7361 59BF 1733
Reply With Quote
Old 21st February 2020
TheTKS TheTKS is offline
Port Guard
 
Join Date: Sep 2018
Location: Canada
Posts: 43
Default

Quote:
Originally Posted by CiotBSD View Post
You can just use into your personal .xsession:

Code:
startxfce4 --with-ck-launch
And, yes for the group operator; it's necessary!

Quote:
Originally Posted by hitest View Post
Code:
bsd$ cat .xsession
exec ck-launch-session startxfce4
The above code works for me on XFCE4 and OpenBSD 6.6.

I edit /etc/group and add my regular user to the operator group so that I can use the XFCE4 shutdown button to turn off my laptop.
As I understood it, hitest's code is the most recent recommendation from the README (it's the way I've set mine up and it works for me with Xfce 4 on OBSD 6.6 using xenodm), while Ciot's is an older way to do it (but if it works for you, fine... I don't know if there is anything wrong with it.)

TKS
Reply With Quote
Old 21st February 2020
CiotBSD CiotBSD is offline
c107:b5d::
 
Join Date: Jun 2019
Location: Under /
Posts: 175
Default

Hi.

What README?

I use it-as, segun pkg_readme file about Xfce, on 6.6. It's written:
Quote:
$OpenBSD: README-main,v 1.14 2019/08/15 07:16:48 landry Exp $

+-----------------------------------------------------------------------
| Running xfce on OpenBSD
+-----------------------------------------------------------------------

(…)

Logging out and shutting down the computer
==========================================
If your installation supports complete shutdown, clicking on the logout
button on panel will permit you to either logout, rebooting or halt
the computer.

If your user is part of the operator group (and thus can execute
/sbin/shutdown), you should be able to shutdown/logout without further
configuration.
Otherwise, halting and rebooting require consolekit2 and polkit: you'll need to
run a systemwide D-BUS service (enable messagebus using rcctl) and pass
--with-ck-launch argument to startxfce4.

If you run a systemwide D-BUS service, have consolekit2/polkit installed and
don't use --with-ck-launch you will not be able to shutdown/reboot.

(…)
@shep: And no, the .xsession does not need to be executable. It's not necessary to put +x rights on.
As wrote @jggimi, read the bottom of Xsession file. ;-)
Code:
$ tail -20 /etc/X11/xenodm/Xsession
But I'm not agree with you, when you wrote:
Quote:
The .xsession script file is similar to the .xinitrc script
Similar, yes; but different matter.
.xsession is to run after xenodm (or other), and .xinitrc is a tool after your loggin (without dm).
__________________
GPG:Fingerprint ed25519 : 072A 4DA2 8AFD 868D 74CF 9EA2 B85E 9ADA C377 5E8E
GPG:Fingerprint rsa4096 : 4E0D 4AF7 77F5 0FAE A35D 5B62 D0FF 7361 59BF 1733

Last edited by CiotBSD; 21st February 2020 at 06:37 PM.
Reply With Quote
Old 23rd February 2020
TheTKS TheTKS is offline
Port Guard
 
Join Date: Sep 2018
Location: Canada
Posts: 43
Default

Quote:
Originally Posted by CiotBSD View Post
What README?

I use it-as, segun pkg_readme file about Xfce, on 6.6. It's written:
CiotBSD, that is the README I meant, and you are right that it's written as you quoted here
/usr/local/share/doc/pkg-readmes/xfce

I was convinced that I read somewhere, after the README date of 2019/08/15, that both this startxfce4 change and adding the user to the operator group are needed, and that other changes were coming with xfce in 6.6, but I can't find it now (if I find it, I will post.)

It seems that either startxfce4 term still seem to work, but the operator step is definitely needed.

TKS

Last edited by TheTKS; 23rd February 2020 at 01:45 PM. Reason: minor - version reference from 6.7 to 6.6, which needed a change from future to past
Reply With Quote
Old 23rd February 2020
victorvas victorvas is offline
Real Name: Victor
Linux
 
Join Date: May 2019
Posts: 148
Default

What is better from security/performance point of view?
To make .xsession to be executable or not?
Reply With Quote
Old 23rd February 2020
shep shep is offline
Real Name: Scott
Arp Constable
 
Join Date: May 2008
Location: Dry and Dusty
Posts: 1,507
Default

Quote:
What is better from security/performance point of view?
To make .xsession to be executable or not?
It has to execute the startxfce4 command.

As far as it being executable, xenodm(1) provides this guidance:

Quote:
The user's .xsession file might look something like this example. Don't forget that the file must have execute permission.

#! /bin/sh
xrdb -merge "$HOME/.Xresources"
emacs -geometry +0+50 &
xbiff -geometry -430+5 &
xterm -geometry -0+50 -ls &
exec twm
Reply With Quote
Old 23rd February 2020
TheTKS TheTKS is offline
Port Guard
 
Join Date: Sep 2018
Location: Canada
Posts: 43
Default

So this is one of the references I was thinking of

https://marc.info/?l=openbsd-ports&m...0265131529&w=2

The main OpenBSD-specific change is
https://bugzilla.xfce.org/show_bug.cgi?id=14722 (needs testing !)
which will make the consolekit/policykit/messagebus dependency
completely optional, allowing an user in the operator group to shutdown
the machine (ie can run the shutdown binary), or suspend/hibernate if in
the wheel group (ie has access to apmdev), instead of relying on 3
daemons running as root. The previous mode of needing messagebus
running + spawning startxfce4 within consolekit should still work.


which, if I'm reading right, agrees with the text in the README.

So if I understand this right, if you put your user in group operator, you should be able to shut down from Xfce without
Code:
pkg_scripts="messagebus"
in /etc/rc.conf.local

but to launch Xfce from xenodm you still need to add
Code:
exec startxfce4 --with-ck-launch
(or the other command mentioned by hitest, which contrary to what I wrote earlier I now think is the older one but works - and to correct myself, I have --with-ck-launch, not ck-launch-session) - but the previous way should still work.

I need to read up on messagebus.

TKS

Last edited by TheTKS; 23rd February 2020 at 01:48 PM. Reason: minor correction to command argument
Reply With Quote
Old 25th February 2020
hitest's Avatar
hitest hitest is offline
Real Name: George Nielsen
VPN Cryptographer
 
Join Date: Sep 2008
Location: B.C., Canada
Posts: 375
Default

Quote:
Originally Posted by TheTKS View Post
but to launch Xfce from xenodm you still need to add
Code:
exec startxfce4 --with-ck-launch
(or the other command mentioned by hitest, which contrary to what I wrote earlier I now think is the older one but works - and to correct myself, I have --with-ck-launch, not ck-launch-session) - but the previous way should still work.
Thanks. Yes. The older version works. I've modified .xsession to the newer edit.

Code:
exec startxfce4 --with-ck-launch
__________________
hitest
Reply With Quote
Old 23rd February 2020
CiotBSD CiotBSD is offline
c107:b5d::
 
Join Date: Jun 2019
Location: Under /
Posts: 175
Default

@shep: ok, ty!

@TheTKS: If I understand well, what Landry had written, with Xfce 4.14, into OpenBSD 6.6, we're not need to use consolekit2 or polkit, just only as operator to allow shutdown, and as wheel to suspend/hibernate, is'nt-it!?
If exact, then we need just to start xfce, as :
Code:
startxfce4
!!!

----

Why do you use `exec` before `startxfce4`?
My .xsession launch xfce4 without this function.
???

----

Other question: the xfce4-power-manager seems need consolekit2!
(this package 'xfce4-power-manager' is need only on laptop, not?!)

Code:
$ del consolekit2
can't delete consolekit2-1.2.1p8 without deleting accountsservice-0.6.42 colord-1.3.5p1 mate-1.22 mate-session-manager-1.22.2 mate-settings-daemon-1.22.1 mate-system-monitor-1.22.2 pulseaudio-13.0 xfce4-power-manager-1.6.5
Delete them as well ? [y/N/a] n
(del is just a personal alias for 'pkg_delete')
__________________
GPG:Fingerprint ed25519 : 072A 4DA2 8AFD 868D 74CF 9EA2 B85E 9ADA C377 5E8E
GPG:Fingerprint rsa4096 : 4E0D 4AF7 77F5 0FAE A35D 5B62 D0FF 7361 59BF 1733

Last edited by CiotBSD; 23rd February 2020 at 11:58 AM.
Reply With Quote
Old 23rd February 2020
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 7,984
Default

Quote:
Originally Posted by CiotBSD View Post
Why do you use `exec` before `startxfce4`?
This question is one that I can answer. From the sh(1) man page:
Code:
     exec [command [arg ...]]
         Replace the shell with command (and any optional arguments), without
         creating a new process....
Reply With Quote
Old 23rd February 2020
TheTKS TheTKS is offline
Port Guard
 
Join Date: Sep 2018
Location: Canada
Posts: 43
Default

Quote:
Originally Posted by CiotBSD View Post
@TheTKS: If I understand well, what Landry had written, with Xfce 4.14, into OpenBSD 6.6, we're not need to use consolekit2 or polkit, just only as operator to allow shutdown, and as wheel to suspend/hibernate, is'nt-it!?
That’s what it sounds like to me, too, for shutdown and suspend/hibernate in Xfce.

Quote:
If exact, then we need just to start xfce, as :
Code:
startxfce4
!!!

----

Why do you use `exec` before `startxfce4`?
My .xsession launch xfce4 without this function.
???
If it works for you, then you’re right about this as well. This is code I found somewhere, but I will look into what exec does and post what I find, and if it is not needed, I’ll delete it.

Quote:
Other question: the xfce4-power-manager seems need consolekit2!
(this package 'xfce4-power-manager' is need only on laptop, not?!)

Code:
$ del consolekit2
can't delete consolekit2-1.2.1p8 without deleting accountsservice-0.6.42 colord-1.3.5p1 mate-1.22 mate-session-manager-1.22.2 mate-settings-daemon-1.22.1 mate-system-monitor-1.22.2 pulseaudio-13.0 xfce4-power-manager-1.6.5
Delete them as well ? [y/N/a] n
(del is just a personal alias for 'pkg_delete')
I use OpenBSD only on a desktop tower and don’t know the details of what power-manager does, so can’t help you with this one, but my guess from your output is that there are many other things that have consolekit2 as a dependency

Edit: jggimi beat me by one minute with the answer about exec. Thanks!

TKS
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
HOWTO: mounting an USB device as normal non-root user in OpenBSD J65nko Guides 6 20th May 2017 12:03 PM
Cannot start X from a non-root account notooth NetBSD Security 4 2nd July 2015 02:31 PM
root: unknown user roddierod FreeBSD General 9 28th April 2009 10:18 PM
Run daemon as other user than root phreud FreeBSD General 8 11th November 2008 04:11 AM
Non-root user editing automatically mounted smb share tad1214 FreeBSD General 8 8th July 2008 02:28 AM


All times are GMT. The time now is 04:57 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Content copyright © 2007-2010, the authors
Daemon image copyright ©1988, Marshall Kirk McKusick