xref: /freebsd/usr.sbin/ctld/ctld.8 (revision fa9896e082a1046ff4fbc75fcba4d18d1f2efc19)
1009ea47eSEdward Tomasz Napierala.\" Copyright (c) 2012 The FreeBSD Foundation
2009ea47eSEdward Tomasz Napierala.\"
3009ea47eSEdward Tomasz Napierala.\" This software was developed by Edward Tomasz Napierala under sponsorship
4009ea47eSEdward Tomasz Napierala.\" from the FreeBSD Foundation.
5009ea47eSEdward Tomasz Napierala.\"
6009ea47eSEdward Tomasz Napierala.\" Redistribution and use in source and binary forms, with or without
7009ea47eSEdward Tomasz Napierala.\" modification, are permitted provided that the following conditions
8009ea47eSEdward Tomasz Napierala.\" are met:
9009ea47eSEdward Tomasz Napierala.\" 1. Redistributions of source code must retain the above copyright
10009ea47eSEdward Tomasz Napierala.\"    notice, this list of conditions and the following disclaimer.
11009ea47eSEdward Tomasz Napierala.\" 2. Redistributions in binary form must reproduce the above copyright
12009ea47eSEdward Tomasz Napierala.\"    notice, this list of conditions and the following disclaimer in the
13009ea47eSEdward Tomasz Napierala.\"    documentation and/or other materials provided with the distribution.
14009ea47eSEdward Tomasz Napierala.\"
15009ea47eSEdward Tomasz Napierala.\" THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND
16009ea47eSEdward Tomasz Napierala.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17009ea47eSEdward Tomasz Napierala.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18009ea47eSEdward Tomasz Napierala.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE
19009ea47eSEdward Tomasz Napierala.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
20009ea47eSEdward Tomasz Napierala.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
21009ea47eSEdward Tomasz Napierala.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22009ea47eSEdward Tomasz Napierala.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23009ea47eSEdward Tomasz Napierala.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24009ea47eSEdward Tomasz Napierala.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
25009ea47eSEdward Tomasz Napierala.\" SUCH DAMAGE.
26009ea47eSEdward Tomasz Napierala.\"
27*7fcbecd0SEdward Tomasz Napierala.Dd March 31, 2020
28009ea47eSEdward Tomasz Napierala.Dt CTLD 8
29009ea47eSEdward Tomasz Napierala.Os
30009ea47eSEdward Tomasz Napierala.Sh NAME
31009ea47eSEdward Tomasz Napierala.Nm ctld
32009ea47eSEdward Tomasz Napierala.Nd CAM Target Layer / iSCSI target daemon
33009ea47eSEdward Tomasz Napierala.Sh SYNOPSIS
34009ea47eSEdward Tomasz Napierala.Nm
35009ea47eSEdward Tomasz Napierala.Op Fl d
36009ea47eSEdward Tomasz Napierala.Op Fl f Ar config-file
372b30a69dSEdward Tomasz Napierala.Op Fl u
38*7fcbecd0SEdward Tomasz Napierala.Nm
39*7fcbecd0SEdward Tomasz Napierala.Fl t
40*7fcbecd0SEdward Tomasz Napierala.Op Fl f Ar config-file
41*7fcbecd0SEdward Tomasz Napierala.Op Fl u
42009ea47eSEdward Tomasz Napierala.Sh DESCRIPTION
43009ea47eSEdward Tomasz NapieralaThe
44009ea47eSEdward Tomasz Napierala.Nm
45009ea47eSEdward Tomasz Napieraladaemon is responsible for managing the CAM Target Layer configuration,
46009ea47eSEdward Tomasz Napieralaaccepting incoming iSCSI connections, performing authentication and
47009ea47eSEdward Tomasz Napieralapassing connections to the kernel part of the native iSCSI target.
48009ea47eSEdward Tomasz Napierala.Pp
49009ea47eSEdward Tomasz NapieralaUpon startup, the
50009ea47eSEdward Tomasz Napierala.Nm
513762b440SJohn-Mark Gurneydaemon parses the configuration file.
523762b440SJohn-Mark GurneyIf it encounters any errors,
533762b440SJohn-Mark Gurney.Nm
543762b440SJohn-Mark Gurneyexits.
553762b440SJohn-Mark GurneyIt then compares the configuration with the kernel list of LUNs managed
56009ea47eSEdward Tomasz Napieralaby previously running
57009ea47eSEdward Tomasz Napierala.Nm
58009ea47eSEdward Tomasz Napieralainstances, removes LUNs no longer existing in the configuration file,
59a8a5af86SWarren Blockand creates new LUNs as necessary.
60009ea47eSEdward Tomasz NapieralaAfter that it listens for the incoming iSCSI connections, performs
61009ea47eSEdward Tomasz Napieralaauthentication, and, if successful, passes the connections to the kernel part
6233481e53SEdward Tomasz Napieralaof CTL iSCSI target,
6333481e53SEdward Tomasz Napierala.Xr cfiscsi 4 ,
6433481e53SEdward Tomasz Napieralawhich handles it from that point.
65009ea47eSEdward Tomasz Napierala.Pp
66009ea47eSEdward Tomasz NapieralaWhen it receives a SIGHUP signal, the
67009ea47eSEdward Tomasz Napierala.Nm
68009ea47eSEdward Tomasz Napieralareloads its configuration and applies the changes to the kernel.
69a8a5af86SWarren BlockChanges are applied in a way that avoids unnecessary disruptions;
70009ea47eSEdward Tomasz Napieralafor example removing one LUN does not affect other LUNs.
71009ea47eSEdward Tomasz Napierala.Pp
72009ea47eSEdward Tomasz NapieralaWhen exiting gracefully, the
73009ea47eSEdward Tomasz Napierala.Nm
74009ea47eSEdward Tomasz Napieraladaemon removes LUNs it managed and forcibly disconnects all the clients.
75a8a5af86SWarren BlockOtherwise - for example, when killed with SIGKILL - LUNs stay configured
76009ea47eSEdward Tomasz Napieralaand clients remain connected.
77009ea47eSEdward Tomasz Napierala.Pp
78009ea47eSEdward Tomasz NapieralaTo perform administrative actions that apply to already connected
79009ea47eSEdward Tomasz Napieralasessions, such as forcing termination, use
80009ea47eSEdward Tomasz Napierala.Xr ctladm 8 .
81009ea47eSEdward Tomasz Napierala.Pp
82009ea47eSEdward Tomasz NapieralaThe following options are available:
83009ea47eSEdward Tomasz Napierala.Bl -tag -width ".Fl P Ar pidfile"
84009ea47eSEdward Tomasz Napierala.It Fl f Ar config-file
85009ea47eSEdward Tomasz NapieralaSpecifies the name of the configuration file.
86009ea47eSEdward Tomasz NapieralaThe default is
87009ea47eSEdward Tomasz Napierala.Pa /etc/ctl.conf .
88009ea47eSEdward Tomasz Napierala.It Fl d
89009ea47eSEdward Tomasz NapieralaDebug mode.
9023bd2dd4SEdward Tomasz NapieralaThe daemon sends verbose debug output to standard error, and does not
91009ea47eSEdward Tomasz Napieralaput itself in the background.
9223bd2dd4SEdward Tomasz NapieralaThe daemon will also not fork and will exit after processing one connection.
93009ea47eSEdward Tomasz NapieralaThis option is only intended for debugging the target.
94*7fcbecd0SEdward Tomasz Napierala.It Fl t
95*7fcbecd0SEdward Tomasz NapieralaTest the configuration file for validity and exit.
962b30a69dSEdward Tomasz Napierala.It Fl u
972b30a69dSEdward Tomasz NapieralaUse UCL configuration file format instead of the traditional non-UCL format.
98009ea47eSEdward Tomasz Napierala.El
99009ea47eSEdward Tomasz Napierala.Sh FILES
100009ea47eSEdward Tomasz Napierala.Bl -tag -width ".Pa /var/run/ctld.pid" -compact
101009ea47eSEdward Tomasz Napierala.It Pa /etc/ctl.conf
102009ea47eSEdward Tomasz NapieralaThe configuration file for
103009ea47eSEdward Tomasz Napierala.Nm .
104009ea47eSEdward Tomasz NapieralaThe file format and configuration options are described in
105009ea47eSEdward Tomasz Napierala.Xr ctl.conf 5 .
106009ea47eSEdward Tomasz Napierala.It Pa /var/run/ctld.pid
107009ea47eSEdward Tomasz NapieralaThe default location of the
108009ea47eSEdward Tomasz Napierala.Nm
109009ea47eSEdward Tomasz NapieralaPID file.
110009ea47eSEdward Tomasz Napierala.El
111009ea47eSEdward Tomasz Napierala.Sh EXIT STATUS
112009ea47eSEdward Tomasz NapieralaThe
113009ea47eSEdward Tomasz Napierala.Nm
114009ea47eSEdward Tomasz Napieralautility exits 0 on success, and >0 if an error occurs.
115009ea47eSEdward Tomasz Napierala.Sh SEE ALSO
11633481e53SEdward Tomasz Napierala.Xr cfiscsi 4 ,
117009ea47eSEdward Tomasz Napierala.Xr ctl 4 ,
118009ea47eSEdward Tomasz Napierala.Xr ctl.conf 5 ,
119b853c718SEdward Tomasz Napierala.Xr ctladm 8 ,
120b853c718SEdward Tomasz Napierala.Xr ctlstat 8
121d02d7de7SEdward Tomasz Napierala.Sh HISTORY
122d02d7de7SEdward Tomasz NapieralaThe
123d02d7de7SEdward Tomasz Napierala.Nm
124d02d7de7SEdward Tomasz Napieralacommand appeared in
125d02d7de7SEdward Tomasz Napierala.Fx 10.0 .
126009ea47eSEdward Tomasz Napierala.Sh AUTHORS
127009ea47eSEdward Tomasz NapieralaThe
128009ea47eSEdward Tomasz Napierala.Nm
129009ea47eSEdward Tomasz Napieralawas developed by
13001c2b8acSBaptiste Daroussin.An Edward Tomasz Napierala Aq Mt trasz@FreeBSD.org
131009ea47eSEdward Tomasz Napieralaunder sponsorship from the FreeBSD Foundation.
132