sproc
Sproc is a simplified process manager that uses a composable configuration file to manage multiple services.
Config
Services are defined in Sproc using a simple services.toml file (passed into Sproc using the pin command).
[]
= "example --a b" # required
= "/home/example" # required
[] # optional
= "42"
You can inherit the services defined in other files using the inherit field. Inherited service files cannot expose an inherit field.
= ["/path/to/other/services.toml", "/path/to/other/other/services.toml"]
[]
# ...
Because these files are not loaded when the main file is pinned, they can be updated and will take effect with services active. When updating the main service file, you'll have to stop all active services and pin again.
You can configure the server key and port in the server field:
[]
= 6374
= "abcd"
# ...
The server is needed to start services that use the restart field. You can make services automatically restart (when spawned from the server) by setting restart to true:
[]
= "node index.js"
= "/home/example"
= true # this service will ONLY restart when started from the server
It is not recommended that you manually update the pinned services.toml file ($HOME/.config/sproc/services.toml). This file is regularly updated by the CLI and server, and manual changes should ONLY be done through sproc pin.
Usage
Load config file:
Start service(s):
Start service(s) in a new task (HTTP server required):
Start all services:
Stop service(s):
Stop all services:
Get running service info:
Get info about all running services:
Start observation server:
View pinned configuration:
Merge external services into the source configuration file (source file from pin):
Pull external services into the stored configuration file (after pin):
Install a service from a remote registry:
Uninstall a service from the pinned config file: