79 GitHub stars and counting — jlevy/procdog is a Python project TopGit is tracking across repositories on the platform. Lightweight command-line process control
Snapshot summary built from the project's own GitHub metadata — there's no written TopGit review yet. The page will update automatically when a full review is published.
WHY NO REVIEW YET
TopGit writes full reviews for the most-starred, most-requested repositories. This page is a snapshot until then — see the READ ME tab for the original README in full.
Procdog (as in "process watchdog"... get it?)
is a simple command-line tool to start, stop, and check the health of
processes. It works with any kind of process you can invoke from the command
line (be it native, Java, Node, Python, or anything) on MacOS or Linux.
Why would you want another tool for this?
For basic interactive situations, you can just run a process in a terminal
or use job management in your shell (jobs, kill, etc.).
But you rapidly realize this won't work well once you have longer-lived processes
or are sshing to remote servers. Then you could use nohup and manually
checking with ps, or using screen.
But these don't script easily.
You also might want to script starting and stopping.
With a little effort you might write a custom Bash script (writing a PID file,
using pgrep and pkill, etc.), but it's a hassle and gets messy quickly.
Of course, you can just "do it right." Traditionally, in the Unix world, the way to
control services are
System V service scripts,
start-stop-daemon,
Upstart, or
systemd.
Using these is essential for production deployment, but they tend to be a bit arcane
and highly OS-dependent, so aren't as convenient for casual use, and you can't easily
develop and test on both MacOS and Linux (as many of us try to do).
Procdog is an alternative for developers that attempts to be easy to install,
simple and obvious to use, and cross-platform. Processes are independent of the
shell used to invoke them (i.e., detatched as with nohup) and you can also check
status or kill them at any time (as with a Unix service).
Probably the most simlar tool to Procdog is Supervisor.
Although it has similar goals, Supervisor is a more complex, production-oriented tool with a
long-lived, centrailized XML-RPC server that monitors processes. Procdog is intended
to be a single, simple, easy-to-use command that needn't be set up and managed itself
or run as root. Each use of Procdog is independent and monitors just one process. It
does not require a configuration file unless you want to save typing. You can even
check the Procdog script into your own project so developers can immediately use it
locally, since it has no dependencies (besides Python 2.7).
You'll find it useful if you have servers, databases, or other processes you want
to manage on your personal machine when developing, in build systems and test
harnesses, test deployments, etc. Currently, it doesn't have restart
logic, log file rotation, or some other features you may want for a production
environments; for this consider Supervisor, Upstart, systemd, & co. Procdog is
also way less mature than these alternatives.
Installation
No dependencies except Python 2.7+. It's easiest to install with pip:
sudo pip install procdog
Or, since it's just one file, you can copy the single
procdog
script somewhere (perhaps within your own project) and make it executable.
Quick start
Now you can start and monitor any process (here let's pick "sleep" -- not all that
useful, but you already have it):
Note you have to give your process an arbitrary name (myprocess here), like a Unix
service name, so you can refer to it. Once the process is done, the monitor daemon
also exits.
Usage
Run procdog -h for help on all options.
A better example
Now, with a real server we'd like to know if it's actually up and doing something,
like listening on a port. Procdog supports an arbitrary command to test health
(e.g. running curl to see if it returns a result) and can wait until a server
is running and tell you.
We can specify where to write stdout and stderr. They can be the same or different.
Existing log files are appended to if you use --append.
The health command simply calls a shell command to see if the server is healthy.
The return code of the health check command must be 0 for the server to be considered
healthy. In this case, we're callin curl on a known health-check URL, which will have
return code 0 on an HTTP 200
The --ensure-healthy option means the command will block until the process is healthy,
or until the daemon gives up and kills the process (if necessary). In this example,
it will try 10 times, sleeping 2 seconds each time, before giving up.
The --dir option means process will run from that directory.
We ask the client to be --strict, so that it returns non-zero status code when we try to
start a process that's already running or or stop one that is already stopped.
Configuration files
It's possible to avoid typing by putting most options in a configuration file:
# Procdog config file. Each section is a process name.
[backend]
command=java -classpath my-backend.jar com.example.BackendServer server config.yml
health_command=curl http://localhost:8080/ping
health_count=10
health_delay=2.
dir=$HOME/backend
stdout=backend.log
stderr=backend.log
append=False
ensure_healthy=True
strict=True
You have any number of sections, one section per process. Procdog reads options
from ~/.procdog.cfg or procdog.cfg (in the same directory the procdog
script resides). Any options given on the command line override those in the
configuration file. Note that environment variables (like $HOME) are
allowed and expanded. Once you have the above section in your config file,
you can run:
Procdog starts a small daemon that popen()s and monitors the process.
The daemon listens and accepts commands on a local
Unix domain socket,
making it possible to check the process is running or terminate it, and to do simple
health checks. You can see these sockets at /var/tmp/procdog.*.sock (where the * is the
id of the process). For simplicity, there is a single Procdog daemon for each monitored
process, so each process is handled compeltely separately.
We use Unix domain sockets so that we don't have the headaches of pid files or
choosing and binding to TCP ports. They're also available on most platforms.
Daemon logs are sent to /var/tmp/procdog.*.log. Usually you'll want to redirect your
process stdout and stderr using the --stdout and --stderr options.
Procdog is quite new so probably not stable. Bug reports and contributions are welcome!
Tests
All basic features are covered with a simple Bash-based regression test.
To run it, clone this repo, invoke tests/run.sh then follow the directions to diff
the output using git.
No homepage URL was recorded for jlevy/procdog in TopGit's last sync. The README tab above frequently contains screenshots and demo links, or check the repository description on GitHub.
Does jlevy/procdog have any tags?
TopGit's last sync did not record any GitHub topics for jlevy/procdog. GitHub topics appear in the right sidebar of a repository page; that's the authoritative place to check.
How active is development on jlevy/procdog?
The most recent commit recorded on jlevy/procdog was 8.0 years ago, based on the GitHub push timestamp. The repository has 7 forks — one of the better signals of community interest.
How many stars does jlevy/procdog have?
jlevy/procdog has 79 GitHub stars — refresh the page for the live number, or check github.com/jlevy/procdog. TopGit mirrors GitHub's count but does not claim minute-by-minute accuracy.
What language is jlevy/procdog written in?
jlevy/procdog is written primarily in Python. GitHub's language field is based on the largest share of bytes in the default branch.
What license does jlevy/procdog use?
jlevy/procdog is released under the Apache-2.0 license. Always verify the LICENSE file directly on GitHub for the authoritative terms — license strings can be edited out of sync with a project's actual stance.
Where do I read more about jlevy/procdog?
This TopGit page is a snapshot — the READ ME tab shows the project's own README content (links stripped, images preserved). The GitHub repository at github.com/jlevy/procdog is the definitive source.
Read full README in the tab above.
Want a second opinion on procdog?
Ask an AI that can read this page — one click and you get its take on procdog.