]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - usr.sbin/ctld/ctld.8
zfs: merge openzfs/zfs@043c6ee3b
[FreeBSD/FreeBSD.git] / usr.sbin / ctld / ctld.8
1 .\" Copyright (c) 2012 The FreeBSD Foundation
2 .\"
3 .\" This software was developed by Edward Tomasz Napierala under sponsorship
4 .\" from the FreeBSD Foundation.
5 .\"
6 .\" Redistribution and use in source and binary forms, with or without
7 .\" modification, are permitted provided that the following conditions
8 .\" are met:
9 .\" 1. Redistributions of source code must retain the above copyright
10 .\"    notice, this list of conditions and the following disclaimer.
11 .\" 2. Redistributions in binary form must reproduce the above copyright
12 .\"    notice, this list of conditions and the following disclaimer in the
13 .\"    documentation and/or other materials provided with the distribution.
14 .\"
15 .\" THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND
16 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18 .\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE
19 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
20 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
21 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
25 .\" SUCH DAMAGE.
26 .\"
27 .Dd March 31, 2020
28 .Dt CTLD 8
29 .Os
30 .Sh NAME
31 .Nm ctld
32 .Nd CAM Target Layer / iSCSI target daemon
33 .Sh SYNOPSIS
34 .Nm
35 .Op Fl d
36 .Op Fl f Ar config-file
37 .Op Fl u
38 .Nm
39 .Fl t
40 .Op Fl f Ar config-file
41 .Op Fl u
42 .Sh DESCRIPTION
43 The
44 .Nm
45 daemon is responsible for managing the CAM Target Layer configuration,
46 accepting incoming iSCSI connections, performing authentication and
47 passing connections to the kernel part of the native iSCSI target.
48 .Pp
49 Upon startup, the
50 .Nm
51 daemon parses the configuration file.
52 If it encounters any errors,
53 .Nm
54 exits.
55 It then compares the configuration with the kernel list of LUNs managed
56 by previously running
57 .Nm
58 instances, removes LUNs no longer existing in the configuration file,
59 and creates new LUNs as necessary.
60 After that it listens for the incoming iSCSI connections, performs
61 authentication, and, if successful, passes the connections to the kernel part
62 of CTL iSCSI target,
63 .Xr cfiscsi 4 ,
64 which handles it from that point.
65 .Pp
66 When it receives a SIGHUP signal, the
67 .Nm
68 reloads its configuration and applies the changes to the kernel.
69 Changes are applied in a way that avoids unnecessary disruptions;
70 for example removing one LUN does not affect other LUNs.
71 .Pp
72 When exiting gracefully, the
73 .Nm
74 daemon removes LUNs it managed and forcibly disconnects all the clients.
75 Otherwise - for example, when killed with SIGKILL - LUNs stay configured
76 and clients remain connected.
77 .Pp
78 To perform administrative actions that apply to already connected
79 sessions, such as forcing termination, use
80 .Xr ctladm 8 .
81 .Pp
82 The following options are available:
83 .Bl -tag -width ".Fl P Ar pidfile"
84 .It Fl f Ar config-file
85 Specifies the name of the configuration file.
86 The default is
87 .Pa /etc/ctl.conf .
88 .It Fl d
89 Debug mode.
90 The daemon sends verbose debug output to standard error, and does not
91 put itself in the background.
92 The daemon will also not fork and will exit after processing one connection.
93 This option is only intended for debugging the target.
94 .It Fl t
95 Test the configuration file for validity and exit.
96 .It Fl u
97 Use UCL configuration file format instead of the traditional non-UCL format.
98 .El
99 .Sh FILES
100 .Bl -tag -width ".Pa /var/run/ctld.pid" -compact
101 .It Pa /etc/ctl.conf
102 The configuration file for
103 .Nm .
104 The file format and configuration options are described in
105 .Xr ctl.conf 5 .
106 .It Pa /var/run/ctld.pid
107 The default location of the
108 .Nm
109 PID file.
110 .El
111 .Sh EXIT STATUS
112 The
113 .Nm
114 utility exits 0 on success, and >0 if an error occurs.
115 .Sh SEE ALSO
116 .Xr cfiscsi 4 ,
117 .Xr ctl 4 ,
118 .Xr ctl.conf 5 ,
119 .Xr ctladm 8 ,
120 .Xr ctlstat 8
121 .Sh HISTORY
122 The
123 .Nm
124 command appeared in
125 .Fx 10.0 .
126 .Sh AUTHORS
127 The
128 .Nm
129 was developed by
130 .An Edward Tomasz Napierala Aq Mt trasz@FreeBSD.org
131 under sponsorship from the FreeBSD Foundation.