xref: /netbsd-src/sbin/luactl/luactl.8 (revision 88e7faeafa2e556ebe81b66e57d4a616f0b39ac8)
1.\" $NetBSD: luactl.8,v 1.7 2017/04/10 19:49:39 sevan Exp $
2.\"
3.\" Copyright (c) 2011, 2013 Marc Balmer <marc@msys.ch>
4.\"
5.\" Permission to use, copy, modify, and distribute this software for any
6.\" purpose with or without fee is hereby granted, provided that the above
7.\" copyright notice and this permission notice appear in all copies.
8.\"
9.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16.\"
17.Dd April 10, 2017
18.Dt LUACTL 8
19.Os
20.Sh NAME
21.Nm luactl
22.Nd control kernel Lua states
23.Sh SYNOPSIS
24.Nm
25.Op Fl cq
26.Nm
27.Op Fl cq
28.Cm create
29.Ar name
30.Op desc
31.Nm
32.Op Fl cq
33.Cm destroy
34.Ar name
35.Nm
36.Op Fl cq
37.Cm load
38.Ar name path
39.Nm
40.Op Fl cq
41.Cm require
42.Ar name module
43.Sh DESCRIPTION
44The
45.Nm
46program allows the manipulation of Lua states in the kernel.
47Lua states are created using the
48.Dq Cm create
49command (see below),
50Lua bindings are provided as modules.
51To make a Lua binding available to a state, it must be
52.Dq Em required .
53Once a module has been
54.Dq Em required
55by a state, it can not be unloaded from memory using the
56.Xr modunload 8
57command until the state using it has been destroyed.
58.Pp
59Lua code can be loaded from the file system into a state at anytime, please
60note that code loaded into a state is immediately executed.
61.Pp
62When executed without a command,
63.Nm
64reads information about the
65.Tn Lua
66states and displays it.
67.Pp
68The options are as follows:
69.Bl -tag -width Ds
70.It Fl c
71Create a Lua state before executing the command.
72This flag is used for the
73.Cm require
74and
75.Cm load
76commands only, it
77is ignored for all other commands.
78.It Fl q
79Operate quietly i.e. nothing is printed to stdout.
80.El
81.Sh COMMANDS
82.Bl -tag -width Ds
83.It Cm create Ar name Op Ar desc
84Create a Lua state with name
85.Ar name
86and optional description
87.Ar desc .
88.It Cm destroy Ar name
89Destroy the Lua state
90.Ar name .
91.It Cm load Ar name Pa path
92Load Lua code in file
93.Pa path
94into the Lua state
95.Ar name .
96Note that the path name must contain at least one path separation character
97.Pq Sq / .
98.It Cm require Ar name module
99Let the Lua state
100.Ar name
101use the bindings provided in module
102.Ar module .
103This is the equivalent of userland Lua code calling the
104.Sq require
105function.
106.El
107.Sh FILES
108.Bl -tag -width "/dev/lua" -compact
109.It /dev/lua
110Lua device file.
111.El
112.Sh SEE ALSO
113.Xr lua 4 ,
114.Xr module 7 ,
115.Xr modload 8 ,
116.Xr modunload 8 ,
117.Xr intro 9lua
118.Sh HISTORY
119The
120.Nm
121command first appeared in
122.Nx 7.0 .
123.Sh AUTHORS
124The
125.Nm
126program was written by
127.An Marc Balmer Aq Mt marc@msys.ch .
128