<feed xmlns='http://www.w3.org/2005/Atom'>
<title>unit.git/tools, branch wasm</title>
<subtitle>Universal Web Application Server</subtitle>
<link rel='alternate' type='text/html' href='https://git.sigsegv.uk/unit.git/'/>
<entry>
<title>Tools: unitc YAML mode.</title>
<updated>2023-10-10T14:06:36+00:00</updated>
<author>
<name>Liam Crilly</name>
<email>liam.crilly@nginx.com</email>
</author>
<published>2023-10-10T14:06:36+00:00</published>
<link rel='alternate' type='text/html' href='https://git.sigsegv.uk/unit.git/commit/?id=599b035a544ea27e9fe76cb79f7d672ef114c2d2'/>
<id>599b035a544ea27e9fe76cb79f7d672ef114c2d2</id>
<content type='text'>
Added --format option to manage configuration in other formats.
Initially, YAML is the only supported conversion format.
JSON/YAML conversion is performed with yq(1).

Suggested by: Torstein Krause Johansen &lt;https://github.com/skybert&gt;
Closes: #958 &lt;https://github.com/nginx/unit/issues/958&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Added --format option to manage configuration in other formats.
Initially, YAML is the only supported conversion format.
JSON/YAML conversion is performed with yq(1).

Suggested by: Torstein Krause Johansen &lt;https://github.com/skybert&gt;
Closes: #958 &lt;https://github.com/nginx/unit/issues/958&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Tools: unitc quiet mode fix for macOS.</title>
<updated>2023-10-03T13:57:17+00:00</updated>
<author>
<name>Liam Crilly</name>
<email>liam.crilly@nginx.com</email>
</author>
<published>2023-10-03T13:57:17+00:00</published>
<link rel='alternate' type='text/html' href='https://git.sigsegv.uk/unit.git/commit/?id=9ad207057c620f234f01483bd3a39176945ec202'/>
<id>9ad207057c620f234f01483bd3a39176945ec202</id>
<content type='text'>
head -c 0 does not work on macOS (invalid byte count) but tail(1) is happy
to accept zero bytes, and does not have a performance penalty.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
head -c 0 does not work on macOS (invalid byte count) but tail(1) is happy
to accept zero bytes, and does not have a performance penalty.
</pre>
</div>
</content>
</entry>
<entry>
<title>Tools: setup-unit: ctl: added "edit" subcommand.</title>
<updated>2023-06-30T12:35:59+00:00</updated>
<author>
<name>Alejandro Colomar</name>
<email>alx@nginx.com</email>
</author>
<published>2023-06-21T11:39:40+00:00</published>
<link rel='alternate' type='text/html' href='https://git.sigsegv.uk/unit.git/commit/?id=543d478e12364b685aec5a903f6cd97fc75ad667'/>
<id>543d478e12364b685aec5a903f6cd97fc75ad667</id>
<content type='text'>
Almost equivalent to b42f6b1d ("Tools: unitc edit mode for interactive
configuration."), implemented by Liam in tools/unitc.

I chose to give preference to vi(1) over vim(1) because Debian has vi(1)
as part of update-alternatives(1), so that sysadmins can configure it to
be a symlink to their favourite vi(1) implementation or variant.

We're ignoring the errors of the commands due to having the SSH tunnel
open.  I should fix the script to use traps to close the tunnel on any
error, so we don't leak tunnels.  Then, we'll be able to not ignore
curl(1) or editor errors.  That will also probably allow moving the
tunneling code to the ctl command, thus deduplicating code.

Cc: Liam Crilly &lt;liam@nginx.com&gt;
Cc: Andrew Clayton &lt;a.clayton@nginx.com&gt;
Signed-off-by: Alejandro Colomar &lt;alx@nginx.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Almost equivalent to b42f6b1d ("Tools: unitc edit mode for interactive
configuration."), implemented by Liam in tools/unitc.

I chose to give preference to vi(1) over vim(1) because Debian has vi(1)
as part of update-alternatives(1), so that sysadmins can configure it to
be a symlink to their favourite vi(1) implementation or variant.

We're ignoring the errors of the commands due to having the SSH tunnel
open.  I should fix the script to use traps to close the tunnel on any
error, so we don't leak tunnels.  Then, we'll be able to not ignore
curl(1) or editor errors.  That will also probably allow moving the
tunneling code to the ctl command, thus deduplicating code.

Cc: Liam Crilly &lt;liam@nginx.com&gt;
Cc: Andrew Clayton &lt;a.clayton@nginx.com&gt;
Signed-off-by: Alejandro Colomar &lt;alx@nginx.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Tools: setup-unit: restart: added -l and -s flags.</title>
<updated>2023-06-27T15:45:49+00:00</updated>
<author>
<name>Alejandro Colomar</name>
<email>alx@nginx.com</email>
</author>
<published>2023-06-06T14:19:04+00:00</published>
<link rel='alternate' type='text/html' href='https://git.sigsegv.uk/unit.git/commit/?id=d73526d27ca296400fa8f08aa0a23b8ea3ab7a15'/>
<id>d73526d27ca296400fa8f08aa0a23b8ea3ab7a15</id>
<content type='text'>
Add flags for cleaning the log file and state dir.

Reviewed-by: Andrew Clayton &lt;a.clayton@nginx.com&gt;
Signed-off-by: Alejandro Colomar &lt;alx@nginx.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Add flags for cleaning the log file and state dir.

Reviewed-by: Andrew Clayton &lt;a.clayton@nginx.com&gt;
Signed-off-by: Alejandro Colomar &lt;alx@nginx.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Tools: setup-unit: added restart command.</title>
<updated>2023-06-27T15:45:49+00:00</updated>
<author>
<name>Alejandro Colomar</name>
<email>alx@nginx.com</email>
</author>
<published>2023-06-06T12:55:14+00:00</published>
<link rel='alternate' type='text/html' href='https://git.sigsegv.uk/unit.git/commit/?id=2f46870a3f799ebb3a23e23b02a9dbee3a33ff46'/>
<id>2f46870a3f799ebb3a23e23b02a9dbee3a33ff46</id>
<content type='text'>
It restarts all running unitd instances.  This is useful when
recompiling unitd often, so that the latest build is running, without
having to manually kill unitd instances and re-run with the same exact
command line every time.

Reviewed-by: Andrew Clayton &lt;a.clayton@nginx.com&gt;
Signed-off-by: Alejandro Colomar &lt;alx@nginx.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
It restarts all running unitd instances.  This is useful when
recompiling unitd often, so that the latest build is running, without
having to manually kill unitd instances and re-run with the same exact
command line every time.

Reviewed-by: Andrew Clayton &lt;a.clayton@nginx.com&gt;
Signed-off-by: Alejandro Colomar &lt;alx@nginx.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Tools: setup-unit: ps: forcing full lines from ps(1).</title>
<updated>2023-06-27T15:45:43+00:00</updated>
<author>
<name>Alejandro Colomar</name>
<email>alx@nginx.com</email>
</author>
<published>2023-06-06T11:16:07+00:00</published>
<link rel='alternate' type='text/html' href='https://git.sigsegv.uk/unit.git/commit/?id=e165801732defc5726a3c727b83e31bc3369026f'/>
<id>e165801732defc5726a3c727b83e31bc3369026f</id>
<content type='text'>
Some ps(1) implementations trim lines to 80 columns, even if the output
is being piped.  Let's force ps(1) to output full lines with `ww`, which
is not in POSIX, but seems to be portable enough.

On 2023-06-08 13:19, Andrew Clayton wrote:
&gt; Just for posterity...
&gt;
&gt; BusyBox ps(1) knows about a grand total of 2 options!
&gt;
&gt; BusyBox v1.35.0 (2022-11-19 10:13:10 UTC) multi-call binary.
&gt;
&gt; Usage: ps [-o COL1,COL2=HEADER] [-T]
&gt;
&gt; Show list of processes
&gt;
&gt;         -o COL1,COL2=HEADER     Select columns for display
&gt;         -T                      Show threads
&gt;
&gt; But at least it doesn't make it worse.  In fact all of these three do
&gt; exactly the same thing
&gt;
&gt; ps
&gt; ps ax
&gt; ps axww
&gt;
&gt; I.e it ignores any non option argument...
&gt;
&gt; It does however help on OpenIndiana...

Link: &lt;https://github.com/nginx/unit/issues/875&gt;
Link: &lt;https://github.com/nginx/unit/issues/886&gt;
Link: &lt;https://github.com/nginx/unit/pull/885&gt;
Cc: &lt;https://github.com/mattxtaz&gt;
Cc: Liam Crilly &lt;liam@nginx.com&gt;
Reviewed-by: Andrew Clayton &lt;a.clayton@nginx.com&gt;
Signed-off-by: Alejandro Colomar &lt;alx@nginx.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Some ps(1) implementations trim lines to 80 columns, even if the output
is being piped.  Let's force ps(1) to output full lines with `ww`, which
is not in POSIX, but seems to be portable enough.

On 2023-06-08 13:19, Andrew Clayton wrote:
&gt; Just for posterity...
&gt;
&gt; BusyBox ps(1) knows about a grand total of 2 options!
&gt;
&gt; BusyBox v1.35.0 (2022-11-19 10:13:10 UTC) multi-call binary.
&gt;
&gt; Usage: ps [-o COL1,COL2=HEADER] [-T]
&gt;
&gt; Show list of processes
&gt;
&gt;         -o COL1,COL2=HEADER     Select columns for display
&gt;         -T                      Show threads
&gt;
&gt; But at least it doesn't make it worse.  In fact all of these three do
&gt; exactly the same thing
&gt;
&gt; ps
&gt; ps ax
&gt; ps axww
&gt;
&gt; I.e it ignores any non option argument...
&gt;
&gt; It does however help on OpenIndiana...

Link: &lt;https://github.com/nginx/unit/issues/875&gt;
Link: &lt;https://github.com/nginx/unit/issues/886&gt;
Link: &lt;https://github.com/nginx/unit/pull/885&gt;
Cc: &lt;https://github.com/mattxtaz&gt;
Cc: Liam Crilly &lt;liam@nginx.com&gt;
Reviewed-by: Andrew Clayton &lt;a.clayton@nginx.com&gt;
Signed-off-by: Alejandro Colomar &lt;alx@nginx.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Tools: setup-unit: using $0 is simpler.</title>
<updated>2023-06-27T15:42:32+00:00</updated>
<author>
<name>Alejandro Colomar</name>
<email>alx@nginx.com</email>
</author>
<published>2023-05-17T17:24:33+00:00</published>
<link rel='alternate' type='text/html' href='https://git.sigsegv.uk/unit.git/commit/?id=7d6851055b1f0c31a28a74a10f2c74380145fa4c'/>
<id>7d6851055b1f0c31a28a74a10f2c74380145fa4c</id>
<content type='text'>
Reviewed-by: Andrew Clayton &lt;a.clayton@nginx.com&gt;
Signed-off-by: Alejandro Colomar &lt;alx@nginx.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Reviewed-by: Andrew Clayton &lt;a.clayton@nginx.com&gt;
Signed-off-by: Alejandro Colomar &lt;alx@nginx.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Tools: unitc edit mode for interactive configuration.</title>
<updated>2023-06-07T13:45:35+00:00</updated>
<author>
<name>Liam Crilly</name>
<email>liam.crilly@nginx.com</email>
</author>
<published>2023-06-07T13:45:35+00:00</published>
<link rel='alternate' type='text/html' href='https://git.sigsegv.uk/unit.git/commit/?id=b42f6b1dc8186effaeac566518700e80b2415a41'/>
<id>b42f6b1dc8186effaeac566518700e80b2415a41</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Tools: improved ps(1) portability for unitc.</title>
<updated>2023-06-01T16:53:12+00:00</updated>
<author>
<name>Liam Crilly</name>
<email>liam.crilly@nginx.com</email>
</author>
<published>2023-06-01T16:53:12+00:00</published>
<link rel='alternate' type='text/html' href='https://git.sigsegv.uk/unit.git/commit/?id=9ff59e6c4bc09b0252810b709bd5f6aa35f76691'/>
<id>9ff59e6c4bc09b0252810b709bd5f6aa35f76691</id>
<content type='text'>
Improved cross-platform support by trying multiple ps(1) invocations to
obtain the unitd command line parameters. Additional error checking
detects when this process fails.

The first attempt uses `ps -wwo args=COMMAND -p` which has very broad
support and has the additional benefit of simplifying the output for
more reliable parsing of the process info. If that fails then we fall
back to simply `ps`.

The parsing of the process info has also changed. Instead of converting
'[]' into spaces we now convert them into explicit delimiters (using '^').
This is more reliable as it marks the beginning and the end of the info
we care about. Any trailing process information is now ignored (FreeBSD).

Additional error handling improves the robustness when starting unitd with
a different filename or from a relative path. In this case the control
socket and log file detection will fail when running `unitd --help`.
Additional error checking and messages are displayed when the control socket
cannot be determined. A single warning is shown when the log file cannot be
determined.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Improved cross-platform support by trying multiple ps(1) invocations to
obtain the unitd command line parameters. Additional error checking
detects when this process fails.

The first attempt uses `ps -wwo args=COMMAND -p` which has very broad
support and has the additional benefit of simplifying the output for
more reliable parsing of the process info. If that fails then we fall
back to simply `ps`.

The parsing of the process info has also changed. Instead of converting
'[]' into spaces we now convert them into explicit delimiters (using '^').
This is more reliable as it marks the beginning and the end of the info
we care about. Any trailing process information is now ignored (FreeBSD).

Additional error handling improves the robustness when starting unitd with
a different filename or from a relative path. In this case the control
socket and log file detection will fail when running `unitd --help`.
Additional error checking and messages are displayed when the control socket
cannot be determined. A single warning is shown when the log file cannot be
determined.
</pre>
</div>
</content>
</entry>
<entry>
<title>Updated copyright notice.</title>
<updated>2023-05-24T15:27:24+00:00</updated>
<author>
<name>Andrei Zeliankou</name>
<email>zelenkov@nginx.com</email>
</author>
<published>2023-05-24T15:27:24+00:00</published>
<link rel='alternate' type='text/html' href='https://git.sigsegv.uk/unit.git/commit/?id=71f8c58f7f4fc7f65d4ef5b6f8d30686ad9fd765'/>
<id>71f8c58f7f4fc7f65d4ef5b6f8d30686ad9fd765</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
</feed>
