# How to reduce TTY quantity?



## jamesgu_cn (Jul 31, 2013)

I installed FreeBSD for an Internet proxy only. Because of limited server memory, I would like to offer as much as possible system memory for the Squid proxy server.

How can I reduce the system's default eight TTYs to only two? How to disable some system daemon such as moused?

Thanks very much for your help.


----------



## Chris_H (Jul 31, 2013)

As for moused(8)

```
moused_enable="NO"
```
will do the job. See rc.conf(5), and rc(8) for details. As for (p)tty(s). Controlling the amount offered, and how they are initiated, are best described in the FreeBSD documentation -- FreeBSD Handbook; a _must read_. 

--chris


----------



## wblock@ (Jul 31, 2013)

Edit /etc/ttys to reduce the number of ttys.  That will probably not save a lot of RAM.

moused(8) does not work as expected if you have a USB mouse.  It will be started when the USB mouse is detected by devd(8).  To prevent that, add

```
moused_nondefault_enable="NO"
```
to /etc/rc.conf.


----------



## j4ck (Aug 1, 2013)

jamesgu_cn said:
			
		

> How can I reduce the system's default eight TTYs to only two?




```
#!/bin/sh
	sed -i '' -e's|ttyv0.*|ttyv0	"/usr/libexec/getty Pc"		xterm	on  secure|' /etc/ttys
	sed -i '' -e's|ttyv1.*|ttyv1	"/usr/libexec/getty Pc"		xterm	on  secure|' /etc/ttys
	sed -i '' -e's|ttyv2.*|ttyv2	"/usr/libexec/getty Pc"		xterm	off  secure|' /etc/ttys
	sed -i '' -e's|ttyv3.*|ttyv3	"/usr/libexec/getty Pc"		xterm	off  secure|' /etc/ttys
	sed -i '' -e's|ttyv4.*|ttyv4	"/usr/libexec/getty Pc"		xterm	off  secure|' /etc/ttys
	sed -i '' -e's|ttyv5.*|ttyv5	"/usr/libexec/getty Pc"		xterm	off  secure|' /etc/ttys
	sed -i '' -e's|ttyv6.*|ttyv6	"/usr/libexec/getty Pc"		xterm	off  secure|' /etc/ttys
	sed -i '' -e's|ttyv7.*|ttyv7	"/usr/libexec/getty Pc"		xterm	off  secure|' /etc/ttys
```
This is a simple shell script which I use to do so. As you can see, in /etc/ttys file you can turn off any TTYs you don't need.


----------

