# USB mouse in single user mode?



## sgeos (Dec 25, 2013)

How do I manually enable a USB mouse in single user mode? The plan is to drop this functionality into a script, so I do not mind a somewhat cumbersome solution. If this is in the manual, a pointer to the correct section would be much appreciated.


----------



## DutchDaemon (Dec 25, 2013)

*Re: Mouse in Single User Mode*

Not sure about the single-user mode side of it, but you could try running `service moused forcestart` or calling /usr/sbin/moused directly.


----------



## wblock@ (Dec 25, 2013)

*Re: Mouse in Single User Mode*

Single user mode specifically does not start normal services.  What script to run in that mode needs the mouse?


----------



## sgeos (Dec 26, 2013)

DutchDaemon said:
			
		

> you could try running `service moused forcestart`


Thank you. The following starts the mouse in single user mode on my VM. I do not think the VM sees the mouse as a USB device, so I will see if it also works on my server when I get home.

```
# mount rw filesystem
mount -u /
mount -a

# start mouse
service moused start
```

For completeness, the following stops the mouse.

```
# stop mouse
service moused stop
```



			
				wblock@ said:
			
		

> What script to run in that mode needs the mouse?


I am not aware of any script to run in single user mode that needs the mouse. I was trying to do the reverse- write a script that starts the mouse service in single user mode. Copy-paste is convenient.

I'm also trying to solve another problem. When I boot into single user mode on my Primergy TX100 S3, a logitech usb device keeps disconnecting and reconnecting. The periodic notifications are disruptive and annoying. I think the offending device is the mouse. I'm hoping that capturing and using the mouse will magically solve this problem. If not, I will need to do some real troubleshooting. In theory removing the mouse is a solution if it is the problem. In practice, getting at the rear USB port is very inconvenient. FWIW, that box is tracking 10-STABLE, but I probably want start a new thread if I need to troubleshoot the above problem.


----------



## sgeos (Dec 26, 2013)

Neither `service moused start` nor `service moused forcestart` works for a USB mouse. Both flavors of the command fail with the following error:

```
Starting default mousedmoused: unable to open /dev/psm0: No such file or directory
.
```

moused is indeed printed twice and there is a strange newline. A PS/2 mouse is not plugged into the system, so the error makes sense. /dev/ukbd0 exists, but /dev/ums0 does not. No other USB devices are plugged into the system. Also, the following errors are periodically printed in single user mode:

```
ugen0.3: <Logitech> at usbus0 (disconnected)
ugen0.3: <Logitech> at usbus0
```

I suspect that ugen0.3 is the mouse, but it is not being detected as such. Is there a USB related service that is automatically started in multi user mode but not in single user mode? Also, is there a set of FreeBSD commands to query USB devices?


----------



## ljboiler (Dec 26, 2013)

The devd service is what runs in multi-user mode to watch for things like USB mice getting plugged in and automatically creates a /dev/umsX device for the associated /dev/ugenx.x device. Use usbconfig to poke around to see what your system thinks it has for USB devices.


----------



## sgeos (Dec 27, 2013)

ljboiler said:
			
		

> The devd service is what runs in multi-user mode to watch for things like USB mice getting plugged in and automatically creates a /dev/umsX device for the associated /dev/ugenx.x device. Use usbconfig to poke around to see what your system thinks it has for USB devices.



Thank you.  Starting devd brought up the network, assigned the correct keymap to the keyboard, started the mouse, and stopped the periodic USB disconnection messages.  This is more or less everything I wanted to do.


```
# mount rw filesystem
mount -u /
mount -a

# detect and configure hardware devices (devd does not need to run after configuring the devices)
service devd start
service devd stop
```

Are there any other really handy commands to run or services to start before performing general system maintenance in single user mode?


----------

