You are not logged in.

#1 2024-09-16 18:03:22

zoltix
Member
Registered: 2019-09-06
Posts: 17

[UWSGI]Issue with PrivateBin and uwsgi sock file creation after reboot

Hello,

I'm encountering an issue with my PrivateBin configuration. The installation went fine, but I have a problem with uwsgi, which fails to create the sock file in the /run/privatebin directory, with the owner set to privatebin:privatebin.

When I manually create the directory with the following commands:

sudo mkdir -p /run/privatebin
sudo chown privatebin:privatebin /run/privatebin
sudo chmod 755 /run/privatebin
sudo systemctl restart uwsgi@privatebin.service

Everything works perfectly.

However, after a server reboot, the sock file is deleted (as expected), but systemd fails to recreate it despite the configuration I've set up. I tried adding the following lines using:

sudo systemctl edit uwsgi@privatebin.service

And added these lines:

[Service]
ExecStartPre=/bin/mkdir -p /run/privatebin
ExecStartPre=/bin/chown privatebin:privatebin /run/privatebin

But it's still not working.

Does anyone have suggestions on how to fix this issue?

Thank you in advance for your help

file /etc/uwsgi/privatebin.conf

[uwsgi]
procname-master = %n
# change to php to use latest PHP
plugins = php_legacy
master = true                                                           socket = /run/%n/%n.sock
# uncomment for a stats socket, that can be used with uwsgitop
# stats = /run/%n/%n-stats.sock
chmod-socket = 777
uid = privatebin
gid = privatebin
processes = 10
cheaper = 4
cheaper-step = 1
idle = 600
die-on-idle = true

# reload whenever this config file changes
touch-reload = %p

#cloud_writable_apps_dir = /var/lib/nextcloud/apps
# change to /usr/lib/php/modules to use latest PHP
php_modules_dir = /usr/lib/php_legacy/modules
chdir = /var/lib/privatebin/

php-allowed-ext = .php                                                  php-docroot = /usr/share/webapps/%n                                     php-index = index.php                                                   php-set = date.timezone=Europe/Berlin                                   ##php-set = open_basedir=%(cloud_data_dir):%(cloud_writable_apps_dir):/var/lib/%n:/tmp/:/usr/share/webapps/%n:/etc/webapps/%n:/dev/urandom:%(php_modules_dir):/run/redis/redis.sock:/var/log/%n/%n.log:/proc/meminfo    php-set = session.save_path=/tmp
php-set = session.gc_maxlifetime  21600
php-set = session.gc_divisor  500

Last edited by zoltix (2024-09-17 09:12:54)

Offline

Board footer

Powered by FluxBB