2

I have installed kde4 (via running # pkg_add kde4) on my OpenBSD 6.0 VM and I would like to automatically boot KDM on startup. I have followed the most applicable guide Google found me, but it didn't work. Specifically adding:

kdm_flags=""

if [ "X${kdm_flags}" != X"NO" ]; then
   /usr/local/bin/kdm ${kdm_flags} ;
   echo -n 'kdm '
fi

to my /etc/rc.conf does not cause KDM to start on boot for me. Any ideas? My full /etc/rc.conf (which besides the above modification I have not changed since I installed OpenBSD) file can be found here. If it is relevant running startkde4 starts KDE without a problem. /usr/local/bin/kdm does exist.

Josh Pinto
  • 3,483
  • 15
  • 52
  • 87

2 Answers2

2

Leave /etc/rc.conf as is. It even has a prominent header saying DO NOT EDIT THIS FILE!!, twice. Instead, modify /etc/rc.conf.local. But you don't need to do even that:

Tested on OpenBSD 6.1-stable (amd64) running in a VirtualBox VM (this installs kde4-4.14.3 and enables KDM):

$ doas pkg_add kde4
$ doas rcctl enable kdm
$ doas reboot

KDM will start upon reboot. KDM will start the KDE desktop environment when you log in.

You may also start KDM through doas rcctl start kdm without rebooting.

If you already have xenodm(1) (previously known as xdm) running, stop it and disable it first, before starting KDM:

$ doas rcctl stop xenodm
$ doas rcctl disable xenodm
$ doas rcctl enable kdm

See also rcctl(8).


Regarding /etc/doas.conf (from comments):

This is my /etc/doas.conf on my OpenBSD 6.1-stable system:

permit nopass keepenv root as root
permit persist :trusted

It allows root to use doas without password and without resetting the environment (this line is taken straight out of doas.conf(5)), and it allows members of the group trusted (a special group on my system) to use doas with password.

To grant usage of doas to a single user myuser, I'd probably use something like

permit persist myuser

as a bare minimum, or

permit setenv { -ENV PS1=$DOAS_PS1 SSH_AUTH_SOCK } :wheel 

as suggested by doas.conf(5) (and then add the user to the wheel group).

The persist option allows for passwordless doas invocations during five minutes after a successful doas invocation has been done. This option was added in OpenBSD 6.1.

Kusalananda
  • 320,670
  • 36
  • 633
  • 936
  • My `/etc/doas.conf` file is empty. Is there a way to automatically create a basic conf file without knowing its format? I saw the man page http://man.openbsd.org/doas.conf.5 but honestly it's not that helpful. I created the file with no contents (in case it just needs to exist, regardless of contents) and running `doas pkg_add kde4` returns: `doas: Operation not permitted`. – Josh Pinto Jun 14 '17 at 09:59
  • 1
    @BrentonHorne See updated answer. – Kusalananda Jun 14 '17 at 10:11
  • This is odd now (with your doas.conf file) `doas pkg_add kde4` is returning: `doas: syntax error at line 2` and `doas: syntax error at line 3`. – Josh Pinto Jun 14 '17 at 10:15
  • 1
    @BrentonHorne Ah, you're still on OpenBSD 6.0? Skip the `persist` option then. – Kusalananda Jun 14 '17 at 10:15
  • Followed the upgrade guide so I thought it was 6.1, but it could still be at 6.0. – Josh Pinto Jun 14 '17 at 10:16
  • @BrentonHorne If you have issues using `doas` and you just want to get KDM working, just `su -` and run the commands without `doas`. Then get back to configuring `doas` when you're done. Ask a new question about `doas` here if you have further issues getting it to work. – Kusalananda Jun 14 '17 at 10:22
  • I was running this as root, so not used to OpenBSD I didn't know doas was akin to a replacement for sudo. – Josh Pinto Jun 14 '17 at 10:41
  • @BrentonHorne Ah, that too. Yes, `doas` is a replacement for `sudo`. The OpenBSD developers wanted a minimal utility that was easier to configure correctly. It was introduced in OpenBSD 5.8. – Kusalananda Jun 14 '17 at 10:59
1

Hi you can check under OpenBSD specific KDE readme files under:

/usr/local/share/doc/pkg-readmes/

you can find more about KDE OpenBSD related

Jay Patel
  • 23
  • 6