[Socket] # ListenStream 写要生成的 sock 文件路径,要写完整路径。我是放到项目根目录下的。 ListenStream=/run/gunicorn.sock # Our service won't need permissions for the socket, since it # inherits the file descriptor by socket activation # only the nginx daemon will need access to the socket User=www-data # Optionally restrict the socket permissions even more. # Mode=600
[Service] Type=notify # the specific user that our service will run as User=someuser Group=someuser # another option for an even more restricted service is # DynamicUser=yes # see http://0pointer.net/blog/dynamic-users-with-systemd.html RuntimeDirectory=gunicorn