From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.sysutils.supervision.general/2470 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Andy Kluger Newsgroups: gmane.comp.sysutils.supervision.general Subject: Essex: A simple command line interface for managing s6 services, using the s6 toolset Date: Sun, 27 Jan 2019 21:43:11 -0500 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="139579"; mail-complaints-to="usenet@blaine.gmane.org" To: supervision@list.skarnet.org Original-X-From: supervision-return-2060-gcsg-supervision=m.gmane.org@list.skarnet.org Mon Jan 28 03:43:34 2019 Return-path: Envelope-to: gcsg-supervision@m.gmane.org Original-Received: from alyss.skarnet.org ([95.142.172.232]) by blaine.gmane.org with smtp (Exim 4.89) (envelope-from ) id 1gnwtZ-000aCr-TS for gcsg-supervision@m.gmane.org; Mon, 28 Jan 2019 03:43:33 +0100 Original-Received: (qmail 17295 invoked by uid 89); 28 Jan 2019 02:43:53 -0000 Mailing-List: contact supervision-help@list.skarnet.org; run by ezmlm Original-Sender: Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Original-Received: (qmail 17288 invoked from network); 28 Jan 2019 02:43:50 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=SMtT06Js4iXyNhV2fz8t0jET8yFzKPnczW4RWHCXYIg=; b=gY4d6uhQIDHyscidBTmK3GbYvwJRvLTQZjc0RpPGhioT8I2SgNDpcRfORfo5e1uN8z 5rLjNFIHiv8QJ5bM5GLUwccow2YYgWdo2i7c2XNTWXvoSVKuWT5aFkg6JYE3XqZucAwt 8dEf/9QSZ+GkP6iGa7AAB71FXdGuI0pkMz7IFl9a6Fm2mLxLwirChPLMGBvOR4VuQvE/ AEaW2lZNObuwJ66r/qMeKHr17XpoBe4UmdjrRSIeE2v1bOlg7URjV2KqrJxt/bGkVGCV +QoQkMLrvl+X0/RoDxIRbNec/PIa7anCirNkp4WRDlZkOkM7rz41ZrGhvM4LglxV/+G4 ZExw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=SMtT06Js4iXyNhV2fz8t0jET8yFzKPnczW4RWHCXYIg=; b=LahxreegdsGoRDjU8yChCx7nhV8pBRkqRnG2NG1clM00TAm8BLRL1xE+q1RFN8N2YM 9VBa+h8UFc8u/AzOf4ymuPC4rjiH9abaCJUbBYEawyb4aoLmmMC0k0LrGRPBnt8fnyNS 0q+7KLm6gWSn1U9kFjGF8+tzqjPams3LyH8ZzJsbrPZS72SNCgsEBgoMc6MHBXyzEwdF UgmzKE8wJX/eR5QD2ftmKaFaca/eehc4rhheSWX/bCQGyn8HGzWh5BnJPGylD/wFdtCl dCVgICZHgz8YPo2vDTJ5Th8iU7Vs3IJhdfmtLN1ZaBbcuFBp9j5w6/0rYXN+jNt6nKFX VBqw== X-Gm-Message-State: AJcUukdU3u7fJSla3VlQOUntsNxadvh/hon8Z6cj5v0e9kuHIBMui1WL Cy5WC3KxGSnBobfdlY8CvYBx5RVYigI/pVuAkYn4ooR7FlA= X-Google-Smtp-Source: ALg8bN70u+/yrPcgMce3gUVQoObDFeBQ1jRbxx78q1zUNp5Or0A+8/aOC/t5RoCEYSuzeYXeYrC5z4tUE8djeGxiLjQ= X-Received: by 2002:a02:7f08:: with SMTP id r8mr9523053jac.20.1548643402683; Sun, 27 Jan 2019 18:43:22 -0800 (PST) Xref: news.gmane.org gmane.comp.sysutils.supervision.general:2470 Archived-At: Hello! s6 is great, but its existing interface can feel a bit unwieldy for me, and I need to re-read the docs frequently. So I've made a command line frontend with helper functions for it, called essex: on GitHub: https://github.com/AndydeCleyre/essex video demo: https://streamable.com/oek3d on PyPI: https://pypi.org/project/essex/ I hope someone else will also find it useful. Here's an example runfile and loggerfile generated by the tool: ``` ==> /home/andy/svcs/memdb/run <== #!/bin/execlineb -P fdmove -c 2 1 # Send stderr to stdout foreground { redirfd -w 1 run.md5 md5sum run } # Generate hashfile, to detect changes since launch s6-setuidgid redis # Run as this user cd /var/lib/redis # Enter working directory redis-server # Do the thing ==> /home/andy/svcs/memdb/log/run <== #!/bin/execlineb -P foreground { redirfd -w 1 run.md5 md5sum run } # Generate hashfile, to detect changes since launch s6-log # Receive process output T # Start each line with an ISO 8601 timestamp s4194304 # Archive log when it gets this big (bytes) S41943040 # Purge oldest archived logs when the archive gets this big (bytes) /home/andy/svcs-logs/memdb # Store logs here ``` It lends itself to aliases like: `alias sussex="sudo essex -d /var/svcs"` Thanks of course to skarnet for the excellent software that does all the work, in a sane way, as well as the frequent immediate support and feedback. Essex does not (at least, not yet) offer any conveniences for interdependence of processes, but for my cases thus far the usual retry behavior is sufficient. I welcome advice on growing or otherwise improving the project, if there's interest. Please let me know if you try it! Feel free to submit issues, or reach me on Telegram: https://t.me/andykluger , as I'm awful at noticing emails from real humans.