Fix mod_posix error if prosody user ID was altered
This fixes the following mod_posix error: Couldn't write pidfile at /var/run/prosody/prosody.pid; /var/run/prosody/prosody.pid: Permission denied
This commit is contained in:
parent
3a21cd2c21
commit
0555dc16c9
1 changed files with 7 additions and 1 deletions
|
@ -1,7 +1,13 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
usermod -u "$(stat -c %u /var/lib/prosody/.)" prosody
|
data_dir_owner="$(stat -c %u "/var/lib/prosody/")"
|
||||||
|
if [[ "$(id -u prosody)" != "$data_dir_owner" ]]; then
|
||||||
|
usermod -u "$data_dir_owner" prosody
|
||||||
|
fi
|
||||||
|
if [[ "$(stat -c %u /var/run/prosody/)" != "$data_dir_owner" ]]; then
|
||||||
|
chown "$data_dir_owner" /var/run/prosody/
|
||||||
|
fi
|
||||||
|
|
||||||
if [[ "$1" != "prosody" ]]; then
|
if [[ "$1" != "prosody" ]]; then
|
||||||
exec prosodyctl "$@"
|
exec prosodyctl "$@"
|
||||||
|
|
Loading…
Reference in a new issue