Skip to content

Instantly share code, notes, and snippets.

View FooBarWidget's full-sized avatar

Hongli Lai FooBarWidget

View GitHub Profile
  • request_sockets -- an array objects describing the sockets on which the application listens for requests. The format is as follows:

    [
      {
        "address": "tcp://127.0.0.1:1234" | "unix:/path-to-unix-socket",
        "protocol": "http" | "session",
        "tags": {
          "": true | false,
          "custom tag 1": "value 1",
    

"custom tag 2": "value 2"

Upon starting the preloader, the preloader listens for commands on a Unix domain socket. SpawningKit tells the preloader to spawn a worker process by:

  1. Setting up a work directory (see "The preparation and the HandshakePrepare class").

  2. Sending a command over the socket. The command is a JSON document on a single line:

    { "command": "spawn", "work_dir": "" }

libcurl Keychain Problem, Solution, and Code

This is a writeup by Camden Narzt, the Passenger engineer mainly responsible for making TLS client certificates work on macOS. He has experience with using the cryptographic libraries in macOS, such as KeyChain.

This writeup is related to the following commit: https://github.com/phusion/passenger/commit/900928e531bd98d60a2bb819efc6201160b47703

Overview of the general Problem

The original problem is that on macOS libcurl doesn’t load the client certificate in such a way that it has permission to use it without asking the user first. This causes a popup which we want to prevent.

@paulbecotte @kellabyte Note that baseimage-docker is not about running multiple services in the same container. We encourage running multiple processes in one container if it makes sense, e.g. if a single service naturally consists of multiple processes. We're not necessarily advocating that you should run all your services in the same container (although we made it possible for you to do that, if you wish to do so or if you have a legit use case for it). Processes != services.

For example, Nginx consists of multiple processes: it consists of a master process that delegates work to a number of worker processes. Or PostgreSQL, which has a process for the query planner, a process for buffer management, etc. In both cases it wouldn't make sense to run each process in its own container because all of these processes are designed to work together as a whole.

As an extension of this idea, consider some app, one which is outside your control, that natively logs to syslog. You don't want its logs to be be redire

The challenges of packaging Passenger for Debian and Ubuntu

Phusion provides Debian and Ubuntu packages for the Passenger application server. Debian and Ubuntu already package Passenger, but unfortunately their packages are constantly out of date. So we publish our own packages and we keep them up-to-date with our source releases.

Debian/Ubuntu packages -- we'll just call them "Debian packages" from now on, even if you're on Ubuntu -- are easy to install and a pleasure to use. But making and maintaining them is hard work. We strive to release new packages every time a new Debian or Ubuntu version comes out. But sometimes it is harder than expected, resulting in delays.

Why is maintaining Debian packages so hard? In this article we will explain how we maintain our Debian packages for Passenger. This article may also be valuable to you if you have ever thought about making your own Debian packages for your own software.

You can expect the following content

Overview of Debian packages

Anatomy

So you are a Debian/Ubuntu user. You search for a package with apt-cache search. You install a package with apt-get install. You already intuitively know these:

  • Packages contain basic metadata such as names and descriptions.
  • Packages may have dependencies.
  • Packages contain files.
- Reduce complexity
- One tool to manage them all
- Many apps
- Manage web server
- OS package manager, Puppet/Chef/Ansible, Docker integration
- Video: Decreasing complexity in production setups
- Show how you can consolidate multiple tools and reduce number of moving parts
- End with OS integration information
- Performance and scale
- Scaling CPU core utilization
@FooBarWidget
FooBarWidget / gist:fdfeea7470a96927688a
Created March 7, 2016 12:18
Hongli Lai GPG public key
-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
Comment: GPGTools - http://gpgtools.org
mQINBFMx5EEBEACyYpPkST8yFuG0gdK9P5A/HPKEH9QOu8mpkm5i5X0mAYRyugFq
6j0C610FMvDi3ybKyDdKf3+v8SDHAgAdeCzkF/sqt5hYZfuuw/Gm/JSHozMZn25f
7u1SuIHH3GWORm9+F7UWT3R7Bg2faMP9M1Yj+PHk/u5udAvbwgoOT68ISuWLGl7Q
z8H58VysIZgGnuaisM/++fbF+py5LUjGZffBSLFc1ys0s6TiEaw8MKu8GuNWbHV9
z/2tlAY46ROUrCAQT2lO415qdOJTqVzOiY3IJMlT2mMJRVc6HP68/HN/EfkHmM6S
yjD0R84nVTA7aQOBDW0eWyrAPKaDJA07dL1wyww5DtpB2Z1HKAB4lykIWooc4kf1
PIDS='1234 5678'
for PID in $PIDS; do
echo "----- PID $PID -----"
cat /proc/$PID/limits
lsof -a -d 1-999999 -p $PID
done