# HOWTO: Prevent moused from starting at boot on FreeBSD 9



## miggyb89 (May 27, 2012)

Decided to put up a guide since it's a simple process but there wasn't a lot of info on this out there. From what I can tell, running a moused free computer has no negative effects, while running it (at least on my system) did create a couple of weird glitches (system would ignore keyboard input until I moved the mouse, cursor would be stuck if I logged in using xdm, strange things like that).

I am using a Logitech MX 518 mouse with a USB connection on an amd64 install of Vanilla FreeBSD 9 

1) Edit /etc/devd.conf and comment out the section that tells the system to launch moused. On my system it was 2 or 3 screens down, without any useful comment header.


```
# attach 100 {
#       device-name "ums[0-9]+";
#       action "/etc/rc.d/moused quietstart $device-name";
# };
#
# detach 100 {
#         device-name "ums[0-9]+";
#         action "/etc/rc.d/moused stop $device-name";
# };
```

2) Comment out the Mouse0 references in /etc/X11/xorg.conf. Also, I have the "AllowEmptyInput" flag set to "false" right now, but I'm not sure if that's needed anymore. Let me know in a comment if that still seems to do anything.

The relevant sections of my xorg.conf now look like this:


```
Section "ServerLayout"
    Identifier     "X.org Configured"
    Screen      0  "Screen0" 0 0
#   InputDevice    "Mouse0" "CorePointer"
    InputDevice    "Keyboard0" "CoreKeyboard"
    Option         "AllowEmptyInput" "false"
EndSection
```

...snip...


```
# Section "InputDevice"
#     Identifier     "Mouse0"
#     Driver         "mouse"
#     Option         "Protocol" "auto"
#     Option         "Device" "/dev/ums0"
#     Option         "Buttons" "10"
#     Option         "ZAxisMapping" "4 5"
#     Option         "Button Mapping" "1 2 3 6 7 8 9 10 4 5"
#     Option         "Emulate3Buttons" "false"
# EndSection
```

Reboot the computer and moused shouldn't be launched anymore, hopefully. Then do a startx if you aren't launched into a graphical login manager automatically, and your mouse should hopefully work perfectly.


----------



## wblock@ (May 27, 2012)

AllowEmptyInput, FreeBSD, and Xorg Input

Do not set AllowEmptyInput.  Forget about it.  What it does is not what people think it does.

If you want to disable HAL for xorg input device detection, use

```
Option "AutoAddDevices" "Off"
```

Or just turn off the HAL option in x11-servers/xorg-server.

As far as moused(8), it seems to make switching from console to X and back faster.  A possibly better reason to run it is that it allows mouse cut and paste on the console.  Finally, there seems to be some interaction with the latest xorg that might make it only work if moused(8) is running.

PS: xorg.conf doesn't require the keyboard input device, either.


----------



## miggyb89 (May 27, 2012)

Fair enough, thanks for the info. It kept popping up as one of the things to try and unfortunately nobody linked to your paper as a caveat.

I'm using a pretty vanilla configuration and don't need to switch in/out of X or cut/paste in the console. And again, from what I can tell, there doesn't seem to be any downside to it. If an update breaks something or if I realize in the future that it doesn't work with multiple monitors or anything like that, I'll make sure to look at this guide again to undo my changes


----------

