Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 31 Dec 2016 21:48:08 +0100
From:      Polytropon <freebsd@edvax.de>
To:        David Christensen <dpchrist@holgerdanske.com>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: FreeBSD 11.0 i386, XDM 1.1.11_6, XFCE 4.12_1 -- How to enable GUI shutdown and restart?
Message-ID:  <20161231214808.3cb26db9.freebsd@edvax.de>
In-Reply-To: <a0e0390a-55e2-9ad0-3e74-26f25ae5309f@holgerdanske.com>
References:  <e721fc89-46b0-ea8c-9ed3-ad6c0df58c29@holgerdanske.com> <e0b1bd9a-dbe0-31cb-ee70-0cfe87da694b@bananmonarki.se> <2c0d9213-1adc-48b7-bdf6-a6b4a577d726@bananmonarki.se> <622bd615-48b9-031a-65d8-3c7daf663cb9@holgerdanske.com> <09d1385a-6356-b732-ddd4-ebd678c25419@bananmonarki.se> <507828f7-6621-15f8-f55d-0ad172857fc1@holgerdanske.com> <e4100f12-b37d-3e0b-2d5e-5cb65f5c49a5@bananmonarki.se> <20161230154841.7d2561e2.freebsd@edvax.de> <bca9e1b0-f298-e5da-d583-134ad0bd18b7@holgerdanske.com> <20161231163107.64b0582d.freebsd@edvax.de> <a0e0390a-55e2-9ad0-3e74-26f25ae5309f@holgerdanske.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sat, 31 Dec 2016 10:41:42 -0800, David Christensen wrote:
> On 12/31/16 07:31, Polytropon wrote:
> > On Fri, 30 Dec 2016 22:05:52 -0800, David Christensen wrote:
> >> On 12/30/16 06:48, Polytropon wrote:
> >>> then add a menu entry
> >>> for "System Shutdown" (shutdown -p now) and "System Reboot"
> >>> (shutdown -r now);
> >>
> >> How?
> >
> > There is some XML file you can edit, and I assume that there
> > is some kind of "menu editor" (similar to what Gnome inclused)
> > where you can manually specify a program that will then be
> > indluced in the menu - or on one of the bars.
> >
> > This has been super-easy in XFCE 3, "Add icon". :-(
> >
> > For comparison: I use the same approach in WindowMaker: There
> > is a submenu I called "Functions" where I never chose anything
> > from, but have key combinations assigned. It contains an entry
> > named "System shutdown" with the key combination Control+Mod1+F27
> > which is Ctrl+Alt+Moon on my Sun type 7 USB keyboard. It simply
> > executes the following command:
> >
> > 	xterm -class SHUTDOWN -fg black -bg red -e "shutdown -p now ; read DUMMY"
> >
> > With the membership in the required groups, this is permitted
> > from my user account.
> 
> Yeah, I thought about that (and I should have been able to figure it out 
> myself).  But, it's a hack.  Xfce already has the features I want and I 
> know they work on Debian Wheezy.  It is disappointing that such basic 
> functionality does not work on FreeBSD.

The desktop environment you've chosen hasn't been created
for FreeBSD, or with FreeBSD in mind, primarily. It's a
ported application that requires you to turn down certain
intended means of security. After you've done that, it will
work the same way as on Linux, but I agree, it's not even
a trivial task.

By the way, why don't you simply use the power button of
the computer? It will perform a clean shutdown, and there
is nothing you need to configure in order to get it working.



> > It looks so simple and easy, why shouldn't it be possible to
> > implement something similar with a state-of-the-art desktop
> > environment?
> 
> I assume DBus, hald, policykit, consolekit, etc., facilitate 
> functionality far beyond what a simple 
> desktop-shortcut-invoking-a-suid-script model allows.

That's what they were intended for initially, but on Linux,
they have been deprecated and even obsoleted (HAL) long time
ago. Those mechanisms rely on Linux kernel functionality or
other software libraries found on Linux, working on Linux,
which FreeBSD has to provide some kind of "workaround" for,
simply because FreeBSD != Linux.



> The consistency 
> hobgoblin probably ate shutdown and restart along the way.  The price is 
> that I now have to figure out one or more of the above to get shutdown 
> and restart working as implemented.

I got it working once, but sadly, I didn't document which
change of configuration was the one that made it working.



> >> How do I start policykit, consolekit, and hal?
> >
> > PolicyKit is started by Xfce (the --with-ck-launch options will
> > enable it), and HAL is started by adding
> >
> > 	hald_enable="YES"
> >
> > to /etc/rc.conf.
> 
> man 5 rc.conf leads me to believe that there is no hald_enable option:

The manual for rc.conf covers OS services. HAL (hald) is not
a system service, it's a third party service. Neither will
you find entries for Postgresql, CUPS, or ESD in that manual,
even they all provide *_enable or _flags options. :-)



> 2016-12-31 09:56:43 toor@t7400 ~
> # grep hald /etc/defaults/rc.conf /etc/rc.conf.local /etc/rc.conf
> grep: /etc/rc.conf.local: No such file or directory

The file rc.conf.local does not exist per default, it can be
created by the user if needed. OpenBSD has a stronger border
between "the OS" and "other stuff", so system settings go
to rc.conf, ports settings to rc.conf.local there. (And I
think there's even a 3rd file for site-specific options,
with the intention to use _that_ instead of rc.conf, which
is for OS-supplied settings.)

As I said, HAL is not part of the OS. There are no settings
or examples provided for it per default.



> man 8 hald says that hald is connected to dbus.  (It also gives example 
> incantations for Fedora, which leads me to believe that the man page may 
> not be correct for FreeBSD.)  If hald manages all the hardware devices 
> for FreeBSD, I don't see how it could not be running; but ps said 
> otherwise.  I don't understand.

You need to run both hald and dbus. And you need to refer to
that documentation here, as the manpages probably aren't up
to date (or Linux-specific):

https://www.freebsd.org/gnome/docs/halfaq.html

You can find more Xfce-related information here:

https://wiki.freebsd.org/Xfce

Also see this "nice" dependency tree:

https://wiki.freebsd.org/Xfce?action=AttachFile&do=get&target=xfce4.png

Understand and internalize that you're basically trying to
run Linux software on a FreeBSD OS, and that the time of
cross-platform well-tested and modular programs is over. ;-)



> What is the canonical method to determine if hald is operating on a 
> FreeBSD 11 system?   (Or, ready to operate when needed?)

I think it should appear in "top". Currently I don't have
access to a system running HAL, and my home system did
actually never run it. :-)



> >> startxfce4 does not appear to have a man page or provide command-line
> >> help (?).
> >
> > Modern X programs do not have manpages. They _sometimes_ have
> > documentation scattered across the web, in project pages,
> > Github notes, wikis, user pages, and discussion forums. ;-)
> >
> >
> >
> >> Where are startxfce4 options documented?
> >
> > Honestly? I have no idea. I got the --with-ck-launch simply
> > by web search...
> 
> After 20+ years of beating my head against Linux and *BSD, I'm starting 
> to think FOSS projects will never produce programming systems products 
> [1].  Given [2], [3], [4], [5], etc., FreeBSD seems to be trying harder 
> than most, but XDM and Xfce are separate projects.  Perhaps I should 
> post on the Xfce list?

That might help, and if you have an answer what _currently_
makes Xfce work as intended, post the answer here for further
reference.



> That said, are Gnome or KDE better integrated on FreeBSD?

Probably yes, even though not everyone likes Gnome 3. Personally
I'd go with KDE if I ever needed a desktop environment. But also
consider trying Mate and Cinnamon, which are Gnome 2 descendants.
Additionally, there is the Lumina project, a desktop written for
FreeBSD (an aspect which isn't fully true for all the alternatives
mentioned).



> And, is there a X desktop manager port/ package on FreeBSD 11 with 
> shutdown and restart?

That depends on the configuration the desktop environments
come with. After all, you have to try this yourself, as
Linux is a quickly moving target, and FreeBSD has "only"
the ported versions of Linux desktop environments. Remember
what I said about FreeBSD != Linux easlier in this message.




-- 
Polytropon
Magdeburg, Germany
Happy FreeBSD user since 4.0
Andra moi ennepe, Mousa, ...



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20161231214808.3cb26db9.freebsd>