Bug 276897 - Introducing posixmqcontrol
Summary: Introducing posixmqcontrol
Status: In Progress
Alias: None
Product: Base System
Classification: Unclassified
Component: misc (show other bugs)
Version: CURRENT
Hardware: Any Any
: --- Affects Some People
Assignee: Cy Schubert
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-02-08 21:38 UTC by unitrunker
Modified: 2024-02-12 05:56 UTC (History)
4 users (show)

See Also:


Attachments
sources (8.11 KB, application/x-compressed-tar)
2024-02-08 21:38 UTC, unitrunker
no flags Details
posixmqcontrol as a port (2.32 KB, patch)
2024-02-09 20:22 UTC, unitrunker
no flags Details | Diff
Fixed build errors, ready for commit. (32.79 KB, patch)
2024-02-09 20:34 UTC, Cy Schubert
no flags Details | Diff
posixmqcontrol as a port (2.31 KB, patch)
2024-02-10 04:17 UTC, unitrunker
no flags Details | Diff
posixmqcontrol as a port v0.0.7 (2.26 KB, patch)
2024-02-11 02:19 UTC, unitrunker
no flags Details | Diff
posixmqcontrol as a port v0.0.10 (2.01 KB, patch)
2024-02-12 05:24 UTC, unitrunker
no flags Details | Diff
posixmqcontrol as a port v0.0.11 (2.01 KB, patch)
2024-02-12 05:56 UTC, unitrunker
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description unitrunker 2024-02-08 21:38:24 UTC
Created attachment 248269 [details]
sources

This "bug" introduces a new utility - in the spirit of posixshmcontrol - for managing POSIX message queues.

Included in tarball are - one C source file, one man-page, and several (sh) test scripts from regression.

Summary of features:

1 create one or more new queues with the following in common:
* maximum message size.
* maximum queue depth.
* mode bits (rwx).
* group and user ownership (by ID or name).
* blocking or non-blocking I/O.

2. update all of the above attributes to existing queues.
3. inspect the above attributes on one or more existing queues.
4. send one or more messages to one or more named queues with optional priority.
5. receive a message from a named queue.
6. remove one or more named queues.

This utility requires the mqueuefs kernel module to be loaded. It does NOT require or make use of a mounted mqueuefs.

Justification

* Create all required queues following boot.
* De-couple queue administration from application code.
* Queue depthing monitoring.
* Access control management with or without a mounted mqueuefs file system.

More details can be found in the manual page.

Steps for a convenient way to view the manual page:

gzip -k posixmqcontrol.1
mkdir man1
mv -f posixmqcontrol.1.gz man1/
man -M . posixmqcontrol
Comment 1 Cy Schubert freebsd_committer freebsd_triage 2024-02-08 21:57:39 UTC
Suggest you make a port for this.
Comment 2 Cy Schubert freebsd_committer freebsd_triage 2024-02-08 22:00:32 UTC
I suggest you make a port of this first. Once it's demonstrated it can replace rcorder a decision by the community of developers to move it to src would probably happen. This is how mergemaster, etcupdate, and other utilities managed to make it into base.

How about we do that  first?
Comment 3 unitrunker 2024-02-09 01:49:55 UTC
Will do Cy! Thanks for your input.
Comment 4 Cy Schubert freebsd_committer freebsd_triage 2024-02-09 01:56:43 UTC
I suggest you host the sources in a github repo and use the ports github plumbing to fetch the tarballs for your port.

Once the port is ready, I'll give it a once-over and commit it.
Comment 5 John Baldwin freebsd_committer freebsd_triage 2024-02-09 20:05:08 UTC
This isn't a replacement for rcorder but would be a new tool.  It should probably just go straight into base without being a port.  It is probably easier to do code review for a change like this as a patch against the src repository either on reviews.freebsd.org or as a PR against GitHub.com/freebsd/freebsd-src.
Comment 6 Cy Schubert freebsd_committer freebsd_triage 2024-02-09 20:16:02 UTC
(In reply to John Baldwin from comment #5)

I can put it into /usr/bin then.
Comment 7 unitrunker 2024-02-09 20:22:13 UTC
Created attachment 248292 [details]
posixmqcontrol as a port

Checking back here after creating a GH repo and port style patch.

I'll do another patch for base so you can choose which ever is best.
Comment 8 Cy Schubert freebsd_committer freebsd_triage 2024-02-09 20:34:42 UTC
Created attachment 248293 [details]
Fixed build errors, ready for commit.

Fixed build errors and ready for commit.

Do we want to do a review for this? I think so.
Comment 9 unitrunker 2024-02-09 20:45:52 UTC
Comment on attachment 248293 [details]
Fixed build errors, ready for commit.

Thanks Cy!
Comment 10 Cy Schubert freebsd_committer freebsd_triage 2024-02-09 20:46:25 UTC
Comment on attachment 248292 [details]
posixmqcontrol as a port

I think the port is a good thing too, because prior releases of FreeBSD can install the port.
Comment 11 Cy Schubert freebsd_committer freebsd_triage 2024-02-09 20:49:23 UTC
Port builds clean.

The proposed commit builds clean.
Comment 12 Cy Schubert freebsd_committer freebsd_triage 2024-02-09 21:04:53 UTC
(In reply to unitrunker from comment #9)

Can you please submit the src version I just uploaded for review at https://reviews.freebsd.org/. Add jhb, imp, emaste, and myself as reviewers.

Also take a look at the three changes I made to make it build. I had to rename a couple of variables. You may want to replace the names I picked with other names.

Also review the commit log message in the patch above. I'd rather you use your words than mine.

The port doesn't need a review. I'll review it and commit it as is.
Comment 13 unitrunker 2024-02-10 02:08:33 UTC
Done.

https://reviews.freebsd.org/D43813

This is a slightly tweaked version from the attached (variable rename).

I also updated the GH repo - with the same changes - which is now at version v0.0.5.

The port patch needs a new Makefile and 'make makesum'.
Comment 14 unitrunker 2024-02-10 04:17:11 UTC
Created attachment 248296 [details]
posixmqcontrol as a port

Ports patch file updated to v0.0.5 (variable renamed).
Comment 15 unitrunker 2024-02-10 07:50:24 UTC
So far, GH repo is up to v0.0.6 - mostly from kib's feedback. Need to update both sets of patches.
Comment 16 unitrunker 2024-02-11 02:19:09 UTC
Created attachment 248340 [details]
posixmqcontrol as a port v0.0.7

Mostly applies checkstyle9.pl feedback.
Comment 17 unitrunker 2024-02-12 05:24:40 UTC
Created attachment 248383 [details]
posixmqcontrol as a port v0.0.10

Updated with more feedback from kib.
Comment 18 unitrunker 2024-02-12 05:56:19 UTC
Created attachment 248384 [details]
posixmqcontrol as a port v0.0.11

more style(9) fixes