{"id":20850409,"url":"https://github.com/noteed/sentry","last_synced_at":"2025-05-12T04:31:23.082Z","repository":{"id":2921298,"uuid":"3931700","full_name":"noteed/sentry","owner":"noteed","description":"Simple process monitoring","archived":false,"fork":false,"pushed_at":"2013-06-03T21:30:07.000Z","size":155,"stargazers_count":8,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-10-28T14:19:47.273Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://noteed.com/sentry/","language":"Haskell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/noteed.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2012-04-04T18:20:37.000Z","updated_at":"2019-10-22T16:23:29.000Z","dependencies_parsed_at":"2022-08-20T23:10:29.543Z","dependency_job_id":null,"html_url":"https://github.com/noteed/sentry","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/noteed%2Fsentry","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/noteed%2Fsentry/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/noteed%2Fsentry/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/noteed%2Fsentry/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/noteed","download_url":"https://codeload.github.com/noteed/sentry/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225120017,"owners_count":17423818,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-18T03:09:18.833Z","updated_at":"2024-11-18T03:09:19.417Z","avatar_url":"https://github.com/noteed.png","language":"Haskell","readme":"# Sentry - Simple process monitoring\n\nThis project is in early stage.\n\nSentry is a process monitoring tool written and configured in Haskell. Its aim\nis to keep running programs. For each configured program (called an entry in\nits configuration) , multiple processes can be started.\n\nCurrently Sentry runs on Linux only.\n\n## Install\n\nThe development version can be installed by cloning the Git repository and\nusing cabal:\n\n    \u003e git clone git://github.com/noteed/sentry.git\n    \u003e cd sentry \u0026\u0026 cabal install\n\n## Usage\n\nSentry is written in Haskell and is also configured in Haskell. The principle\nis to write a short script in `~/.sentry/conf/`. For instance a `sample.hs`\nconfiguration would look like the following:\n\n    import Sentry.Server\n\n    main :: IO ()\n    main = sentry\n      [ entry \"dummy\" \"sleep\" [\"4\"] 1000 1\n      ]\n\n`\"dummy\"` is the entry name, also called the process type. `\"sleep\"` and\n`[\"4\"]` is the command that need to be run (and kept running), together with\nits arguments. The `1000` value specifies how long in milliseconds Sentry has\nto wait before restarting the command when it dies. Finally `1` is the number\nof processes you want to run that particular process type. You can then compile\n`sample.hs` and obtain a `sample` binary like this:\n\n    \u003e ghc --make -threaded sample.hs\n\nStart your Sentry with:\n\n    \u003e ~/.sentry/conf/sample start\n\nSentry will save its PID to `sample.pid` and start running the \"dummy\" entry:\n\n    Sentry started (PID: 1511s aved in /home/thu/.sentry/conf/sample.pid).\n    20:17:51 dummy.1514      Started at 1334081871.\n    20:17:55 dummy.1514      Exited at 1334081875 with ExitSuccess.\n    20:17:56 dummy.1516      Started at 1334081876.\n    20:18:00 dummy.1516      Exited at 1334081880 with ExitSuccess.\n    ^CBye.\n    \u003e\n\nWhenever `sleep` exits, Sentry will run it again, and again.\n\nRecompiling a configuration (i.e. `sample.hs` in the example) can be done while\nSentry is running. A SIGHUP will instruct Sentry to re-exec itself, using the\nnew configuration. The command (while Sentry is already running)\n\n    \u003e ~/.sentry/conf/sample reload\n\nwill just do that:\n\n    \u003e .sentry/conf/sample start\n    Sentry started (PID: 1530saved in /home/thu/.sentry/conf/sample.pid).\n    20:32:01 dummy.1536      Started at 1334082721.\n    20:32:05 dummy.1536      Exited at 1334082725 with ExitSuccess.\n    /home/thu/.sentry/conf/sample.hs successfully compiled.\n    Sentry reexec'd. Initially started at 1334082711 (Previously reexec'd at 1334082711).\n    20:32:08 dummy.1550      Started at 1334082728.\n    20:32:12 dummy.1550      Exited at 1334082732 with ExitSuccess.\n    ^CBye.\n    \u003e\n\n## HTTP interface\n\nSentry has an embedded web server to exposes its state over HTTP. It is also\nused to accept reconfiguration commands (e.g. scale a given process type).\n\n## Documentation\n\nThis `README.md` file should be a good starting point. Additional information\ncan be found in the Haddock pages. Those pages are currently available from\nhttp://hypered.be/haddock/sentry.\n\n## Design\n\nSentry is configured with a list of process specifications. For each\nspecification, multiple processes can be spawn and monitored.\n\nSentry spawns a process by forking itself and then exec'ing the process'\ncommand. Waiting for the process to complete is done in a lightweight thread.\nForking and waiting a child process is a more accurate way to know when the\nprocess dies than polling. (Another good way to do that is to use netlink with\nthe process events connector.)\n\nA main thread reads commands from a concurrent queue (a `Chan` in Haskell).\nCommands are pushed by signal handlers and monitoring threads to instruct the\nmain thread to act on its configuration (and thus change its set of monitored\nprocesses).\n\n## TODO\n\n- Dynamically resize the number of processes for a specific entry.\n- Let Sentry start a configuration instead of manually run it. I.e.\n  `sentryd start -c sample` instead of `~/.sentry/conf/sample`. Default\n  configuration could be `sentry.hs`.\n- Separate data types for save/restore (i.e. with SafeCopy instances) and\n  data types actually used at runtime.\n- Build on 7.0 and 7.4 (was tested only on 7.0.3 so far).\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnoteed%2Fsentry","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnoteed%2Fsentry","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnoteed%2Fsentry/lists"}