github.com/creichlin/pentaconta@v0.1.1-0.20170602155716-6b53e3be0bdb/README.md (about) 1 pentaconta 2 ========== 3 4 A service runner 5 6 config 7 ------ 8 9 Searches for a configfile in working dir and etc named pentaconta.yaml or pentaconta.json 10 The config can be changed by giving a parameter `pentaconta -config custom/main`. This would look 11 in `workingdir/custom/main.json` and `/etc/custom/main.json` as well as the yaml variants. Also 12 an absolute path can be given. 13 14 services: 15 pc_stable_service: 16 executable: /usr/bin/pc_stable 17 arguments: [--foo, bar] 18 19 fs-triggers: 20 pc_stable_bin_trigger: 21 path: /usr/bin/pc_stable 22 services: [pc_stable_service] 23 24 pc_stable_conf_trigger: 25 path: /etc/pc_stable.yaml 26 services: [pc_stable_service] 27 28 This would define one service. The given executable is started and if it crashes ot terminates regularly 29 it will be restarted after a pause of 1 second. 30 31 The two fs-triggers are responsible that the service also gets restarted when the executable itself gets 32 updated or when the config file gets updated. 33 34 logs 35 ---- 36 37 All the output from stdout and er are sent to stdout as well as some logging info from pentaconta itself: 38 39 2017-04-21 23:01 49.012619 OUT pc_stable: Stable main started 40 2017-04-21 23:01 50.012928 OUT pc_stable: I'm doing fine 41 2017-04-21 23:01 51.013093 OUT pc_stable: I'm doing fine 42 2017-04-21 23:02 01.015132 OUT pc_stable: I'm doing fine 43 2017-04-21 23:02 01.310071 PEN pc_stable: Terminated service with signal: interrupt <--- service gets sigint from config file change 44 2017-04-21 23:02 01.610011 PEN pc_stable: Sigint worked 45 2017-04-21 23:02 02.313112 OUT pc_stable: Stable main started 46 2017-04-21 23:02 03.313456 OUT pc_stable: I'm doing fine