���������� ���������� ����

2. ������ ȯ�濡�� �������

�� ��(section)������ ������ ���, ����Ʈť(queue)�� ����, ����Ʈ ť���� (�������) �۾�(job)�� ����, ������ ����ϱ� ���� ������ �������� ��ȯ�ϱ�, ����Ʈ ȯ�漳���� ���ؼ� �����Ѵ�.

2.1 ������ ȯ�濡���� ������� ��õ��(History of Linux Printing)

�������� ������� �ý���---lp(Line Printer) �ý���---�� BSD(Berkeley Software Distribution)������ ���н�(UNIX)�� ���ؼ� �ۼ��� �ҽ��ڵ带 ����(porting)�� ���̴�.

2.2 lpr�� �̿��� ���� ���(Printing a File Using lpr)

������� ���������� ��������ϴ� ���� ������ ����� ������ ����Ʈ ����̽�(print device)�� �ٷ� ������ ��(redirection)�̴�. �̷��� �ϱ� ���ؼ� cat ���ɾ �̿��� �� �ִ�. root ������ ���� ���¿��� ������ ���� �ϸ� �ȴ�.

# cat thesis.txt > /dev/lp

�� ���, /dev/lp�� ������ ����Ʈ �۾��� �����ϴ� ����̽�---��Ʈ ������, ������, Ÿ�Լ���(typesetter) �Ǵ� �÷��� ��---�� ���� �ɺ��� ��ũ(symbolic link)�ϻ��̴�. �ɺ��� ��ũ�� ���ؼ� �ڼ��� ������ ���ϸ� ln(1)�� ���������� �����϶�.

���ȹ��� ������ root�� print ���(daemon)�� ��ϵ� �׷��� ����ڸ��� ������ ����̽��� ���� ���� ���� �����ϴ�. �׷��� ������ �����͸� ����ϱ� ���ؼ��� lpr, lprm, lpq�� ����ؾ� �Ѵ�.

�̷��� ������, ����ڴ� ������ ����ϱ� ���ؼ��� lpr�� �̿��ؾ� �Ѵ�. lpr�� ��������� ���ؼ� �ʿ��� ��� �ʱ�ȭ ������ ������ ���� ������� lpd(line printer daemon)���� �Ѱ� �ش�. lpd�� �����Ϳ��� �� ������ ����ϴ� ����� ���� �����Ѵ�.

lpr�� ����Ǹ鼭 lpd�� ����۾��� ��ĥ �� ���� (����ϵ���) ������ ������ �����ϰ� �ֵ��� Ư���� ���丮(��Ǯ ���丮)�� �ش������� �����Ѵ�. �ϴ� lpd�� ����� ������ �ִٰ� �뺸������ �ڽ� �ڽ��� �����Ѵ�.(���α׷��ӵ��� forking�̶�� �ϴ� ���̴�) ������ �纻�� ������ ������ �䱸�� ��ٸ��� ���� �ش������� ����Ѵ�. �̷��� �����ν� ���ÿ� �������� �۾��� ����ų �� �ִ�.

lpd�� ����(lpd(1)�� �������� ����)�� ���� �����ϴ�.

$ lpr [ options ] [ filename ... ]

���ϸ��� �������� �ʴ� ���, lpr�� ǥ���Է�(standard input) (�밳 Ű���� �Է��̰ų� �ٸ� ���α׷��� ǥ������̴�) ���� �Է¹ޱ⸦ ��ٸ���. �̰��� ����ڰ� �ٸ� ���α׷��� ǥ������� ����(redirect)�Ͽ� ������ ��Ǯ�� (print spooler)���� �����ϴ� ���� ������ ���� ������ �Ѵ�.

$ cat thesis.txt | lpr

�Ǵ�,

$ pr -l60 thesis.txt | lpr

����ڴ� ����� ������ �ɼ��� �̿��Ͽ� lpr�� �۵��� ������ �� �ִ�. ���� �θ� ���̴� �ɼ����δ� ������ ����. -P�������̸� �� ����� �����͸� �����Ѵ�. -h �� burst page�� ������� �ʵ��� �Ѵ�.(����: suppresses printing of the burst page) -s �� ����ϸ� ������ ������ ��Ǯ ���丮�� �����ϴ� ��� ��� �ɺ��� ��ũ(symbolic link)�� �Ѵ�. (ũ�Ⱑ ū ������½� �����ϴ�) -#���� �̿��ؼ� ����� ������ ����� ������ �� �ִ�. lpr���� ��ȣ�ۿ뿡 ���� ������ ������ ����.

$ lpr -#2 -sP dj thesis.txt

���� ������ thesis.txt�� ��Ǯ ���丮�� �ɺ�����ũ�ϸ� dj ��� �̸��� ���� (��������) �����ͷ� ����ϴµ�, �̴� lpd�� ���ؼ� ó���ȴ�. �׷� ���� thesis.txt�� ���徿 ����Ѵ�.

lpr���� ��밡���� ��� �ɼ��� ���� ���ؼ��� lpr(1)�� ���������� �����϶�.

2.3 lpq�� �̿��� ����Ʈť ����(Print Queue with lpq)

����Ʈť(print queue)�� ���θ� ���� ���ؼ� lpq ���ɾ �̿��Ѵ�. �ɼǾ��� �����Ű�� �⺻������(default) ������ť�� ������ �����ش�.

lpq�� �����ִ� ������ ���� ���� ���鿡�� �����ϴ�.

$ lpq
lp is ready and printing
Rank   Owner      Job  Files                            Total Size
active mwf        31   thesis.txt                       682048 bytes

2.4 lprm�� �̿��� ������ �۾� ���(Canceling a Print Job Using lprm)

����Ʈ �ý����� ������ ������� ����Ʈť�� ����ִ� ����Ʈ �۾��� ����� �� �ִ� ��ɵ� �ִ�. �̸� ���ؼ� lprm�� �̿��Ѵ�.

$ lprm -

���� ������ ������ ����ڿ��� ������(owned) ��� ����Ʈ �۾��� ��ҵȴ�. ���� ����Ʈ �۾��� lprm���� lpq�� �˷��ִ� �۾���ȣ�� �����Ͽ� ��ҽ�ų�� �ִ�. ������ ������ �����϶�.

$ lprm 31

�۾���ȣ 31(thesis.txt)�� ��ҽ�Ų��.

2.5 lpc�� �̿��� lpd ����(Controlling the lpd program with lpc)

lpc(8)�� lpd�� ó���ϴ� �����͸� �����ϱ� ���� ���ȴ�. ������ �Ǵ� ����Ʈ ť�� Ȱ��ȭ �Ǵ� ��Ȱ��ȭ��ų �� ������, ����Ʈť ���� �۾������� ���� �迭�� �� ������, �����Ϳ� ����Ʈť�� ��Ȳ�� ���� ������ �޾� �� �� �ִ�. lpc�� �� ���� ������ �ڽ��� �������� �����Ͱ� ����Ǿ� �ִ� ��쿡 ���� ���ȴ�.

$ lpc

���� ������ lpc ���α׷��� ������Ų��. �⺻������(default)�� ���ؼ� ��ȣ ��ȭ���(interactive mode)�� �Ǹ�, ���� ���� ���ɾ ����� �� �ִ�. �� �ۿ� ������ �ɼ����� lpc ���ɾ ����� �� �ִ�.

$ lpc status all

lpd�� ������������ ��밡���� ���ɾ� ����� �� �� ������, �� �ۿ����� �� ����� �� ����� �ٽ� ����� �ִ�. option���� ǥ�õ� �κп��� �������� �̸�(lp, print, ps, ��Ÿ)�̳� ��� �����͸� �ǹ��ϴ� Ű���� all�� �Է��ϸ� �ȴ�.


���������� ���������� ����