On Sun, 23 Nov 2025, at 02:21, JH Foo wrote:
> Row 9: Postgres support resonates a little: iirc one has to make 
> changes to mlock for it to work, and there's no way to do this in 
> podman today. 

hi JH

I'm using this to run postgresql containers already. The basic hook is this 
one, you can refine it to use annotations like the zfs one in 
https://people.freebsd.org/~dch/posts/2025-06-27-oci-zfs/

-- /usr/local/etc/containers/hooks.d/postgresql.json

```
{
  "version": "1.0.0",
  "hook": {
    "path": "/usr/local/etc/containers/hooks.d/postgresql.sh"
  },
  "when": {
    "always": true
  },
  "stages": [
    "createRuntime"
  ]
}
```

- /usr/local/etc/containers/hooks.d/postgresql.sh

```
#!/bin/sh -e
set -o pipefail
INPUT=$(  cat - | tee -a /var/log/postgresql.json)
ID=$(     echo $INPUT | jq -r .id || exit 1)
STATUS=$( echo $INPUT | jq -r .status || exit 1)

# if we are in created state, we can proceed
if [ "$STATUS" == "created" ]; then
  /usr/sbin/jail -vm name=$ID  sysvmsg=1 sysvsem=1 sysvshm=1
  logger -t oci postgresql hook for container $ID
fi
```

A+
Dave

Reply via email to