Index: src/helper/UserSession.cpp
--- src/helper/UserSession.cpp.orig
+++ src/helper/UserSession.cpp
@@ -39,7 +39,7 @@
 #include <unistd.h>
 #include <fcntl.h>
 #include <sched.h>
-#ifdef Q_OS_FREEBSD
+#if defined(Q_OS_FREEBSD) || defined(Q_OS_OPENBSD)
 #include <login_cap.h>
 #endif
 
@@ -103,6 +103,7 @@ namespace SDDM {
 
             qInfo() << "Starting X11 session:" << m_displayServerCmd << command;
             if (m_displayServerCmd.isEmpty()) {
+                qInfo() << "Run session command:" << command;
                 auto args = QProcess::splitCommand(command);
                 setProgram(args.takeFirst());
                 setArguments(args);
@@ -276,7 +277,7 @@ namespace SDDM {
             exit(Auth::HELPER_OTHER_ERROR);
         }
 
-#if defined(Q_OS_FREEBSD)
+#if defined(Q_OS_FREEBSD) || defined(Q_OS_OPENBSD)
         // execve() uses the environment prepared in Backend::openSession(),
         // therefore environment variables which are set here are ignored.
         if (setusercontext(NULL, &pw, pw.pw_uid, LOGIN_SETALL) != 0) {
