| Crates.io | ceviche |
| lib.rs | ceviche |
| version | 0.7.0 |
| created_at | 2018-08-15 13:43:23.329131+00 |
| updated_at | 2025-10-31 15:25:31.088749+00 |
| description | Rust daemon/service wrapper |
| homepage | https://github.com/devolutions/ceviche-rs |
| repository | https://github.com/devolutions/ceviche-rs |
| max_upload_size | |
| id | 79572 |
| size | 81,754 |
Service/daemon wrapper. Supports Windows, Linux (systemd) and macOS.
Different Linux distributions place systemd unit files in different locations:
/usr/lib/systemd/system//lib/systemd/system//etc/systemd/system/This library detects the correct systemd unit directory at runtime using the following strategy:
Environment variable override (CEVICHE_SYSTEMD_UNITDIR): If set, this takes precedence over everything else. Use this when you need explicit control over where units are installed.
pkg-config detection: We query pkg-config --variable=systemdsystemunitdir systemd to get the distribution's preferred location. This works on most modern systems that have systemd development packages installed.
Fallback probing: If pkg-config is unavailable or doesn't return a result, we probe common directories in order:
/usr/lib/systemd/system/lib/systemd/system⚠️ This isn't the ideal approach for packaged software.
If you're creating distribution packages (.deb, .rpm, etc.), you should:
dh_installsystemd or manually install to ${prefix}/lib/systemd/system/%{_unitdir} macro in your spec fileThis runtime detection is a pragmatic compromise for applications that need to self-register as services without relying on package manager scripts. It works well for:
By default, ceviche will detect and use the system unit directory. To override:
# Specify a custom location
export CEVICHE_SYSTEMD_UNITDIR=/etc/systemd/system
./your-application service register
We default to system units (/usr/lib/systemd/system/ or /lib/systemd/system/) rather than user units (/usr/lib/systemd/user/, ~/.config/systemd/user/, etc) because:
CEVICHE_SYSTEMD_UNITDIR if you need user units