Wrapper for linux daemon/windows service for Rust
bozaro / daemon-rs Goto Github PK
View Code? Open in Web Editor NEWWrapper for linux demon/windows service for Rust
License: MIT License
Wrapper for linux demon/windows service for Rust
License: MIT License
Wrapper for linux daemon/windows service for Rust
I've been looking for a library to handle daemonization and creating PIDfiles for my small rust project: https://github.com/maurizi/retag.rs
Do you have any examples of projects this library has been used on, or some documentation written up somewhere?
Able to get a service installed and started with your example but does not react to stop or restart. I'm wondering if something like StartServiceCtrlDispatcherW is failing, and we're falling through to daemon_console from daemon_service? Any ideas, or anyone solved this?
I first realized the daemon.name has to match the service name exactly for the lookup to work, but fixing that did not fix this.
After testing determined what is failing when trying to run example; the DaemonWrapper executes daemon.holder.exec().unwrap(); in service_main, which calls Receiver.iter in a blocking loop. service_main thus never returns and service_handler can never receive invocation by system to handle stop or shutdown control signals.
To get this working, executing the daemon.holder.exec function in a new thread. When service_handler receives SERVICE_STOP_PENDING control message it gives the receiver some time to clean up and stop, and then sets the status to SERVICE_STOPPED. Is there a better way to do this?
@bozaro have you built a windows service complete with an installer?
How would you go around doing that?
This is the first crate that popped up when I searched 'daemon' on crates.io. After pulling up the docs, I have no idea of how to use this crate. Considering that this is a desireable crate name, please, please, add documentation or transfer ownership of the crate to someone else who has more time to spend on it.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.