If I start gunicorn with
You can write a server hook, for example
on_starting, which will run in the master process and thus only happen once.
I think these only work if you're using a Python script for configuration, like in their example.
(This is the OP speaking):
What worked for me was to create a config file "my_conf.py" with the content:
def on_starting(server): print(1)
gunicorn [...] -w 2 -c my_conf.py &
prints "1" only once on server start although two workers were specified to be used.