# Slim display manager freeze (updated)



## sk8harddiefast (Sep 10, 2013)

I installed from ports SLIM display manager but on login it freezes completely. Here is all I made:
`cd /usr/ports/x11/slim`
`sudo make install clean` (no PAM flag enabled)

I put in /etc/rc.conf:

```
slim_enable="YES"
```

And here is my .xinitrc:


```
export LC_CTYPE="el_GR.ISO8859-7"
export LC_COLLATE="el_GR.ISO8859-7"
mixer -f /dev/mixer +100:100 &
exec startxfce4
```

and my `uname -a`:

```
FreeBSD Unix 9.2-PRERELEASE FreeBSD 9.2-PRERELEASE #2 r255261: Fri Sep  6 03:19:01 EEST 2013     root@Unix:/usr/obj/usr/src/sys/GENERIC  amd64
```

Did I miss something?


----------



## sk8harddiefast (Sep 11, 2013)

Ok. I made some progress.

First of all I get this error on /var/log/slim.log

```
slim: waiting for X server to begin accepting connections.
```

Also I connected on my computer using SSH. I stop the Slim service from /usr/local/etc/rc.d and then I start it again and then Slim worked. So when I restart Slim, then it works fine but always when I boot the first time it freezes.


----------



## sk8harddiefast (Sep 12, 2013)

None have any idea how to make Slim work?


----------



## cpm@ (Sep 12, 2013)

Show the full output of `% tail /var/log/slim.log`

Also, check that you have added this line in your /etc/rc.conf

```
dbus_enable="YES"
```


----------



## sk8harddiefast (Sep 12, 2013)

```
slim: waiting for X server to begin accepting connections.
slim: waiting for X server to shut down
slim: waiting for X server to begin accepting connections.slim: unexpected signal 15
slim: waiting for X server to begin accepting connections.
```

Dbus is enabled on /etc/rc.conf


----------



## cpm@ (Sep 12, 2013)

Check out that the default login command and the available sessions in /usr/local/etc/slim.conf say:

```
login_cmd           exec /bin/sh - ~/.xinitrc %session
sessions            xfce4,ratpoison,gnome2,evilwm,kde,lxde
```


----------



## sk8harddiefast (Sep 12, 2013)

Because Slim is not working, I changed this

```
login_cmd           exec /bin/sh - ~/.xinitrc %session
sessions            xfce4,ratpoison,gnome2,evilwm,kde,lxde
```
to this:

```
login_cmd           exec /bin/sh - ~/.xinitrc %session
sessions            xfce4
```
to see if this will work. Both didn't work*.*


----------



## cpm@ (Sep 13, 2013)

I think this may solve your problem. Please, read ports/170381.


> You get these errors, because you run Xfce with wrong way.
> 
> Please, use xinitrc file provides by x11-wm/xfce4-session. This script launches consolekit session if necessary.
> 
> ...


----------



## sk8harddiefast (Sep 13, 2013)

I made it but still freezes  And

```
login_cmd exec /bin/sh - ~/.xinitrc %session
```
is the same*.*


----------



## cpm@ (Sep 13, 2013)

Please, show your /usr/local/etc/slim.conf

Try to start Xfce by adding the following line in .xinitrc

```
/usr/local/bin/startxfce4 --with-ck-launch
```
instead using

```
exec startxfce4
```


----------



## sk8harddiefast (Sep 13, 2013)

My /usr/local/etc/slim.conf


```
# Path, X server and arguments (if needed)
# Note: -xauth $authfile is automatically appended
default_path        /bin:/usr/bin:/usr/local/bin
default_xserver     /usr/local/bin/X
# The X server needs to be started on an unused virtual terminal,
# for FreeBSD in a default configuration, the first one of those is #09
xserver_arguments   vt09

# Commands for halt, login, etc.
halt_cmd            /sbin/shutdown -p now
reboot_cmd          /sbin/shutdown -r now
console_cmd         /usr/local/bin/xterm -C -fg white -bg black +sb -T "Console login" -e /bin/sh -c "/bin/cat /etc/motd; exec /usr/bin/login"
suspend_cmd        /usr/sbin/acpiconf -s 3

# Full path to the xauth binary
xauth_path         /usr/local/bin/xauth

# Xauth file for server
authfile           /var/run/slim.auth


# Activate numlock when slim starts. Valid values: on|off
# numlock             on

# Hide the mouse cursor (note: does not work with some WMs).
# Valid values: true|false
# hidecursor          false

# This command is executed after a succesful login.
# you can place the %session and %theme variables
# to handle launching of specific commands in .xinitrc
# depending of chosen session and slim theme
#
# NOTE: if your system does not have bash you need
# to adjust the command according to your preferred shell,
# i.e. for freebsd use:
login_cmd           exec /bin/sh - ~/.xinitrc %session
#login_cmd           exec /bin/bash -login ~/.xinitrc %session

# Commands executed when starting and exiting a session.
# They can be used for registering a X11 session with
# sessreg. You can use the %user variable
#
# sessionstart_cmd	some command
reboot_cmd	/sbin/shutdown -r now

# Start in daemon mode. Valid values: yes | no
# Note that this can be overriden by the command line
# options "-d" and "-nodaemon"
# daemon	yes

# Available sessions (first one is the default).
# The current chosen session name is replaced in the login_cmd
# above, so your login command can handle different sessions.
# see the xinitrc.sample file shipped with slim sources
sessions            xfce4

# Executed when pressing F11 (requires imagemagick)
screenshot_cmd      import -window root /slim.png

# welcome message. Available variables: %host, %domain
welcome_msg         Welcome to %host

# Session message. Prepended to the session name when pressing F1
# session_msg         Session: 

# shutdown / reboot messages
shutdown_msg       The system is powering down...
reboot_msg         The system is rebooting...

# default user, leave blank or remove this line
# for avoid pre-loading the username.
#default_user        simone

# Focus the password field on start when default_user is set
# Set to "yes" to enable this feature
#focus_password      no

# Automatically login the default user (without entering
# the password. Set to "yes" to enable this feature
#auto_login          no


# current theme, use comma separated list to specify a set to 
# randomly choose from
current_theme       default

# Lock file
lockfile            /var/run/slim.pid

# Log file
logfile             /var/log/slim.log
```


----------



## sk8harddiefast (Sep 13, 2013)

And my ~/.xinitrc


```
#!/bin/sh
export LC_CTYPE="el_GR.ISO8859-7"
export LC_COLLATE="el_GR.ISO8859-7"
mixer -f /dev/mixer +100:100 &

# fix broken $UID on some system...
if test "x$UID" = "x"; then
  if test -x /usr/xpg4/bin/id; then
    UID=`/usr/xpg4/bin/id -u`;
  else
    UID=`id -u`;
  fi
fi

# set $XDG_MENU_PREFIX to "xfce-" so that "xfce-applications.menu" is picked
# over "applications.menu" in all Xfce applications.
if test "x$XDG_MENU_PREFIX" = "x"; then
  XDG_MENU_PREFIX="xfce-"
  export XDG_MENU_PREFIX
fi

# set DESKTOP_SESSION so that one can detect easily if an Xfce session is running
if test "x$DESKTOP_SESSION" = "x"; then
  DESKTOP_SESSION="xfce"
  export DESKTOP_SESSION
fi

# $XDG_CONFIG_HOME defines the base directory relative to which user specific
# configuration files should be stored. If $XDG_CONFIG_HOME is either not set
# or empty, a default equal to $HOME/.config should be used.
if test "x$XDG_CONFIG_HOME" = "x" ; then
  XDG_CONFIG_HOME=$HOME/.config
fi
[ -d "$XDG_CONFIG_HOME" ] || mkdir "$XDG_CONFIG_HOME"

# $XDG_CACHE_HOME defines the base directory relative to which user specific
# non-essential data files should be stored. If $XDG_CACHE_HOME is either not
# set or empty, a default equal to $HOME/.cache should be used.
if test "x$XDG_CACHE_HOME" = "x" ; then
  XDG_CACHE_HOME=$HOME/.cache
fi
[ -d "$XDG_CACHE_HOME" ] || mkdir "$XDG_CACHE_HOME"

# set up XDG user directores.  see
# http://freedesktop.org/wiki/Software/xdg-user-dirs
if which xdg-user-dirs-update >/dev/null 2>&1; then
    xdg-user-dirs-update
fi

# Modify libglade and glade environment variables so that
# it will find the files installed by Xfce
GLADE_CATALOG_PATH="$GLADE_CATALOG_PATH:"
GLADE_PIXMAP_PATH="$GLADE_PIXMAP_PATH:"
GLADE_MODULE_PATH="$GLADE_MODULE_PATH:"
export GLADE_CATALOG_PATH
export GLADE_PIXMAP_PATH
export GLADE_MODULE_PATH

# For now, start with an empty list
XRESOURCES=""

# Has to go prior to merging Xft.xrdb, as its the "Defaults" file
test -r "/usr/local/etc/xdg/xfce4/Xft.xrdb" && XRESOURCES="$XRESOURCES /usr/local/etc/xdg/xfce4/Xft.xrdb"
test -r $HOME/.Xdefaults && XRESOURCES="$XRESOURCES $HOME/.Xdefaults"

BASEDIR=$XDG_CONFIG_HOME/xfce4
if test -r "$BASEDIR/Xft.xrdb"; then
  XRESOURCES="$XRESOURCES $BASEDIR/Xft.xrdb"
elif test -r "$XFCE4HOME/Xft.xrdb"; then
  mkdir -p "$BASEDIR"
  cp "$XFCE4HOME/Xft.xrdb" "$BASEDIR"/
  XRESOURCES="$XRESOURCES $BASEDIR/Xft.xrdb"
fi

# merge in X cursor settings
test -r "$BASEDIR/Xcursor.xrdb" && XRESOURCES="$XRESOURCES $BASEDIR/Xcursor.xrdb"

# ~/.Xresources contains overrides to the above
test -r "$HOME/.Xresources" && XRESOURCES="$XRESOURCES $HOME/.Xresources"

# load all X resources (adds /dev/null to avoid an empty list that would hang the process)
cat /dev/null $XRESOURCES | xrdb -nocpp -merge -

# load local modmap
test -r $HOME/.Xmodmap && xmodmap $HOME/.Xmodmap

# run xfce4-session if installed
if which xfce4-session >/dev/null 2>&1; then

  # check if we start xfce4-session with ck-launch-session. this is only
  # required for starting from a console, not a login manager
  if test "x$XFCE4_SESSION_WITH_CK" = "x1"; then
    if which ck-launch-session >/dev/null 2>&1; then
      ck-launch-session xfce4-session
    else
      echo
      echo "You have tried to start Xfce with consolekit support, but"
      echo "ck-launch-session is not installed."
      echo "Aborted startup..."
      echo

      exit 1
    fi
  else
    # start xfce4-session normally
    xfce4-session
  fi

  exit 0
fi

##################
# IMPORTANT NOTE #
##################

# Everything below here ONLY gets executed if you are NOT using xfce4-session
# (Xfce's session manager).  If you are using the session manager, everything
# below is handled by it, and the code below is not executed at all.  If you're
# not sure if you're using the session manager, type 'ps -e|grep xfce4-session'
# in a terminal while Xfce is running.

##################

# Use dbus-launch if installed.
if test x"$DBUS_SESSION_BUS_ADDRESS" = x""; then
  if which dbus-launch >/dev/null 2>&1; then
    eval `dbus-launch --sh-syntax --exit-with-session`
    # some older versions of dbus don't export the var properly
    export DBUS_SESSION_BUS_ADDRESS
  else
    echo "Could not find dbus-launch; Xfce will not work properly" >&2
    fi
fi

# this is only necessary when running w/o xfce4-session
xsetroot -solid black -cursor_name watch

# or use old-fashioned startup script otherwise

xfsettingsd &
xfwm4 --daemon

# start up stuff in $XDG_CONFIG_HOME/autostart/
if test -d "$XDG_CONFIG_HOME/autostart"; then
  for i in ${XDG_CONFIG_HOME}/autostart/*.desktop; do
    grep -q -E "^Hidden=true" "$i" && continue
    if grep -q -E "^OnlyShowIn=" "$i"; then
      # need to test twice, as lack of the line entirely means we still run it
      grep -E "^OnlyShowIn=" "$i" | grep -q 'XFCE;' || continue
    fi
    grep -E "^NotShowIn=" "$i" | grep -q 'XFCE;' && continue

    # check for TryExec
    trycmd=`grep -E "^TryExec=" "$i" | cut -d'=' -f2`
    if test "$trycmd"; then
      which "$trycmd" >/dev/null 2>&1 || continue
    fi

    cmd=`grep -E "^Exec=" "$i" | cut -d'=' -f2`
    if test "$cmd" && which "$cmd" >/dev/null 2>&1; then
      $cmd &
    fi
  done
fi

xfdesktop&
orage &

panel=`which xfce4-panel`
case "x$panel" in
	x|xno*)
		;;
	*)
		$panel
		ret=$?
		while test $ret -ne 0; do
			xmessage -center -file - -timeout 20 -title Error <<EOF
A crash occured in the panel
Please report this to the xfce4-dev@xfce.org list
or on http://bugs.xfce.org
Meanwhile the panel will be restarted
EOF
			cat >&2 <<EOF
A crash occured in the panel
Please report this to the xfce4-dev@xfce.org list
or on http://bugs.xfce.org
Meanwhile the panel will be restarted
EOF
			$panel
			ret=$?
		done
		;;
esac

xsetroot -bg white -fg red  -solid black -cursor_name watch

/usr/local/bin/startxfce4 --with-ck-launch
```


----------



## cpm@ (Sep 13, 2013)

Remove or comment from /etc/rc.conf 

```
slim_enable="YES"
```
then, start SLiM via /etc/ttys using:

```
ttyv8   "/usr/local/bin/slim"   xterm   on secure
```


----------



## sk8harddiefast (Sep 13, 2013)

Slim now worked but it gives me a window with a dbus error and xfce4 comes without a mouse (the mouse was the X of xserver), xfce4-panel and xfwm4.


----------



## cpm@ (Sep 14, 2013)

Probably, you should try to change in ~/.xinitrc

```
#/usr/local/bin/startxfce4 --with-ck-launch
csh -c 'startxfce4'
```

See ports/170381 for more details (previously commented).


----------

