Show HN: Servicer, pm2 alternative built on rust and systemd Servicer is a CLI to create and manage services on systemd. I have used pm2 in production and find it easy to use. However a lot of its functionality is specific to node.js, and I would prefer not to run my rust server as a fork of a node process. Systemd on the other hand has most of the things I need, but I found it cumbersome to use. There are a bunch of different commands and configurations- the .service file, systemctl to view status, journald to view logs which make systemd more complex to setup. I had to google for the a template and commands every time. Servicer abstracts this setup behind an easy to use CLI, for instance you can use `ser create index.js --interpreter node --enable --start` to create a `.service` file, enable it on boot and start it. Servicer will also help if you wish to write your own custom `.service` files. Run `ser edit foo --editor vi` to create a service file in Vim. Servicer will provide a starting template so you don't need to google it. There are additional utilities like `ser which index.js` to view the path of the service and unit file. ``` Paths for index.js.ser.service: +--------------+-----------------------------------------------------------+ | name | path | +--------------+-----------------------------------------------------------+ | Service file | /etc/systemd/system/index.js.ser.service | +--------------+-----------------------------------------------------------+ | Unit file | /org/freedesktop/systemd1/unit/index_2ejs_2eser_2eservice | +--------------+-----------------------------------------------------------+ ``` Servicer is daemonless and does not run in the background. It simply sets up systemd and gets out of the way. There are no forked services, everything is natively set up on systemd. You don't need to worry about resource consumption or servicer going down which will cause your app to stop. Do give it a spin and review the codebase. The code is open source and MIT licensed- https://ift.tt/KzAb9lG https://servicer.dev August 15, 2023 at 02:34PM
0 Comments