18 releases (7 breaking)

0.7.0 Oct 17, 2024
0.6.0 Sep 13, 2024
0.5.0 May 20, 2024
0.4.0 Mar 22, 2024
0.0.6 Nov 10, 2023

#176 in Operating systems

Download history 7/week @ 2024-07-30 169/week @ 2024-09-10 22/week @ 2024-09-17 47/week @ 2024-09-24 157/week @ 2024-10-01 22/week @ 2024-10-08 297/week @ 2024-10-15 11/week @ 2024-10-22 4/week @ 2024-10-29 16/week @ 2024-11-05

330 downloads per month
Used in staticrocket

0BSD license

155KB
3K SLoC

qsu

The qsu ("kazoo") crate offers portable service utilities with an opinionated service wrapper runtime.

qsu's primary objective is to allow a service developer to focus on the actual service application code, without having to bother with service subsystem-specific integrations -- while at the same time allowing the service application to run as a regular foreground process, without the code needing to diverge between the two.


lib.rs:

qsu is a set of tools for integrating a server application against a service subsystem (such as Windows Services, systemd, or launchd).

It offers a thin runtime wrapper layer with the purpose of abstracting away differences between service subsystems (and also provides the same interface when running the server application as a foreground process). More information about the wrapper runtime can be found in the [rt] module documentation.

In addition qsu offers helper functions to register/deregister an executable with the system's service subsystem. These are documented [installer] module.

And finally it offers an argument parser to offer basic service registration/deregistration and running using a consistent command line interface. These are documented in the [argp] module.

Features

Feature Function
clap Enable clap (argument parser) integration.
installer Tools for registering/deregistering services.
rt Service wrapper (enabled by default).
systemd systemd integration support.
tokio Tokio server application type support.
rocket Rocket server application type support.

In addition there's a special wait-for-debugger feature that is only used on Windows. It will make the service runtime halt and wait for a debugger to attach just before starting the Windows Service runtime. Once a debugger has attached, it will voluntarily trigger a breakpoint.

Dependencies

~10–45MB
~709K SLoC