{"id":18586023,"url":"https://github.com/cloud66-oss/morta","last_synced_at":"2026-04-20T19:02:46.013Z","repository":{"id":83705786,"uuid":"252706875","full_name":"cloud66-oss/morta","owner":"cloud66-oss","description":"Kills Processes with Grace","archived":false,"fork":false,"pushed_at":"2025-01-22T11:00:46.000Z","size":3184,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-06-08T16:02:47.761Z","etag":null,"topics":["kubernetes","linux","shutdown","signal","workers"],"latest_commit_sha":null,"homepage":"https://www.cloud66.com","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cloud66-oss.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-04-03T10:59:29.000Z","updated_at":"2025-01-22T10:59:15.000Z","dependencies_parsed_at":null,"dependency_job_id":"62cbca8e-a5e6-498d-98b9-650a61cf21ef","html_url":"https://github.com/cloud66-oss/morta","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/cloud66-oss/morta","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloud66-oss%2Fmorta","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloud66-oss%2Fmorta/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloud66-oss%2Fmorta/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloud66-oss%2Fmorta/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cloud66-oss","download_url":"https://codeload.github.com/cloud66-oss/morta/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloud66-oss%2Fmorta/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32061251,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-20T11:35:06.609Z","status":"ssl_error","status_checked_at":"2026-04-20T11:34:48.899Z","response_time":94,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["kubernetes","linux","shutdown","signal","workers"],"created_at":"2024-11-07T00:36:24.738Z","updated_at":"2026-04-20T19:02:45.994Z","avatar_url":"https://github.com/cloud66-oss.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cimg src=\"http://cdn2-cloud66-com.s3.amazonaws.com/images/oss-sponsorship.png\" width=150/\u003e\n\n# morta\nGiven a process PID and a sequence of alternating signals and sleep durations, morta will perform the sequence against the PID until either the process is dead, or the sequence has completed.\n\n# Installation\nHead to the morta [releases](https://github.com/cloud66-oss/morta/releases/latest) and download the latest version for your platform.\n\nYou can then copy the file to /usr/local/bin and make sure it is renamed to morta, and that it is executable via `chmod +x /usr/local/bin/morta`. From this point on, you can run `morta update` to update it automatically.\n\n# Usage\nLet's use [unicorn](https://github.com/defunkt/unicorn) as an example, which is an HTTP server for Rack applications. Looking at its [help page for signals](https://github.com/defunkt/unicorn/blob/master/SIGNALS), we can see the following signals defined for the master process:\n\nSignal | Result\n--- | ---\nQUIT | graceful shutdown, waits for workers to finish their current request before finishing\nINT/TERM | quick shutdown, kills all workers immediately\nKILL | terminate process immediately, uncatchable\n\nFrom this, a reasonable sequence of signals might be the following:\n- send SIGQUIT to the master process if it exists\n- wait 30 seconds or until master is dead, whichever comes first\n- send SIGTERM to the master process if it exists\n- wait 10 seconds or until master is dead, whichever comes first\n- send SIGKILL to the master process if it exists\n\nAssuming that the master unicorn process has a PID of 1234, you can then run the following to perform the above sequence:\n```\n$ morta -p 1234 -s \"quit:30:term:10:kill\"\n```\n\nYou can then use this in your process manager to terminate the process as cleanly as possible. For example, if you're using [systemd](https://www.freedesktop.org/wiki/Software/systemd/), you can add the following to your service definition:\n```\nExecStop=-/usr/local/bin/morta -p $MAINPID -s \"quit:30:term:10:kill\"\n```\n\n## Update\nManually checks for updates. It can also switch the current release channel.\n```\n$ morta update [--channel name]\n```\n\n## Version\nShows the channel and the version\n```\n$ morta version\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcloud66-oss%2Fmorta","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcloud66-oss%2Fmorta","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcloud66-oss%2Fmorta/lists"}