12 releases (4 breaking)

0.4.0 Mar 22, 2024
0.3.0 Jan 30, 2024
0.2.1 Jan 16, 2024
0.1.0 Jan 10, 2024
0.0.4 Oct 29, 2023

#360 in Asynchronous

Download history 16/week @ 2024-01-08 26/week @ 2024-01-15 6/week @ 2024-01-29 16/week @ 2024-02-19 15/week @ 2024-02-26 21/week @ 2024-03-11 125/week @ 2024-03-18 1/week @ 2024-03-25 17/week @ 2024-04-01

164 downloads per month
Used in staticrocket

0BSD license

125KB
2.5K SLoC

qsu

The qsu ("kazoo") crate is a:

  • service runtime that acts as a layer betwen the server application code and an operating system service subsystem (launchd, systemd, Windows Services)
  • set of utility functions for working with services.

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

~11–49MB
~737K SLoC