VitalPBX Update Permission Issues

Hello,

I recently updated a couple of PBXs to the latest version, which reminded me that every time after an update, VitalPBX resets some file/folder permissions during the updates, which requires you to run vitalpbx check-integrity afterwards to set the proper permissions.

Here’s the content of /var/log/secure of the time that the update is running:

May 12 05:43:44 ospbx1 sudo:    root : TTY=pts/0 ; PWD=/usr/share/vitalpbx/www ; USER=root ; COMMAND=/sbin/vpbx-helper
May 12 05:43:44 ospbx1 sudo: pam_unix(sudo:session): session opened for user root by root(uid=0)
May 12 05:43:45 ospbx1 sudo: pam_unix(sudo:session): session closed for user root
May 12 05:43:45 ospbx1 sudo:    root : TTY=pts/0 ; PWD=/usr/share/vitalpbx/www ; USER=root ; COMMAND=/sbin/vpbx-helper
May 12 05:43:45 ospbx1 sudo: pam_unix(sudo:session): session opened for user root by root(uid=0)
May 12 05:43:45 ospbx1 sudo: pam_unix(sudo:session): session closed for user root
May 12 05:44:13 ospbx1 useradd[2388]: failed adding user 'asterisk', exit code: 9
May 12 05:44:15 ospbx1 useradd[2391]: failed adding user 'apache', exit code: 9
May 12 05:44:32 ospbx1 sudo:    root : TTY=pts/0 ; PWD=/usr/share/vitalpbx/www ; USER=root ; COMMAND=/sbin/vpbx-helper
May 12 05:44:32 ospbx1 sudo: pam_unix(sudo:session): session opened for user root by root(uid=0)
May 12 05:44:32 ospbx1 sudo: pam_unix(sudo:session): session closed for user root
May 12 05:44:32 ospbx1 sudo:    root : TTY=pts/0 ; PWD=/usr/share/vitalpbx/www ; USER=root ; COMMAND=/sbin/vpbx-helper
May 12 05:44:32 ospbx1 sudo: pam_unix(sudo:session): session opened for user root by root(uid=0)
May 12 05:44:32 ospbx1 sudo: pam_unix(sudo:session): session closed for user root
May 12 05:44:32 ospbx1 sudo:    root : TTY=pts/0 ; PWD=/usr/share/vitalpbx/www ; USER=root ; COMMAND=/sbin/vpbx-helper
May 12 05:44:32 ospbx1 sudo: pam_unix(sudo:session): session opened for user root by root(uid=0)
May 12 05:44:33 ospbx1 sudo: pam_unix(sudo:session): session closed for user root
May 12 05:44:36 ospbx1 sudo:    root : TTY=pts/0 ; PWD=/usr/share/vitalpbx/www ; USER=root ; COMMAND=/sbin/vpbx-helper
May 12 05:44:36 ospbx1 sudo: pam_unix(sudo:session): session opened for user root by root(uid=0)
May 12 05:44:36 ospbx1 sudo: pam_unix(sudo:session): session closed for user root
May 12 05:44:36 ospbx1 sudo:    root : TTY=pts/0 ; PWD=/usr/share/vitalpbx/www ; USER=root ; COMMAND=/sbin/vpbx-helper
May 12 05:44:36 ospbx1 sudo: pam_unix(sudo:session): session opened for user root by root(uid=0)
May 12 05:44:36 ospbx1 sudo: pam_unix(sudo:session): session closed for user root
May 12 05:44:37 ospbx1 sudo:    root : TTY=pts/0 ; PWD=/usr/share/vitalpbx/www ; USER=root ; COMMAND=/sbin/vpbx-helper
May 12 05:44:37 ospbx1 sudo: pam_unix(sudo:session): session opened for user root by root(uid=0)
May 12 05:44:37 ospbx1 sudo: pam_unix(sudo:session): session closed for user root
May 12 05:44:37 ospbx1 sudo:    root : TTY=pts/0 ; PWD=/usr/share/vitalpbx/www ; USER=root ; COMMAND=/sbin/vpbx-helper
May 12 05:44:38 ospbx1 sudo: pam_unix(sudo:session): session opened for user root by root(uid=0)
May 12 05:44:38 ospbx1 sudo: pam_unix(sudo:session): session closed for user root
May 12 05:44:38 ospbx1 sudo:    root : TTY=pts/0 ; PWD=/usr/share/vitalpbx/www ; USER=root ; COMMAND=/sbin/vpbx-helper
May 12 05:44:38 ospbx1 sudo: pam_unix(sudo:session): session opened for user root by root(uid=0)
May 12 05:44:38 ospbx1 sudo: pam_unix(sudo:session): session closed for user root
May 12 05:44:57 ospbx1 sudo:    root : TTY=pts/0 ; PWD=/usr/share/vitalpbx/www ; USER=root ; COMMAND=/sbin/vpbx-helper
May 12 05:44:57 ospbx1 sudo: pam_unix(sudo:session): session opened for user root by root(uid=0)
May 12 05:44:57 ospbx1 sudo: pam_unix(sudo:session): session closed for user root
May 12 05:45:04 ospbx1 polkitd[434]: Reloading rules
May 12 05:45:04 ospbx1 polkitd[434]: Collecting garbage unconditionally...
May 12 05:45:04 ospbx1 polkitd[434]: Loading rules from directory /etc/polkit-1/rules.d
May 12 05:45:04 ospbx1 polkitd[434]: Loading rules from directory /usr/share/polkit-1/rules.d
May 12 05:45:04 ospbx1 polkitd[434]: Finished loading, compiling and executing 2 rules
May 12 05:45:04 ospbx1 polkitd[434]: Reloading rules
May 12 05:45:04 ospbx1 polkitd[434]: Collecting garbage unconditionally...
May 12 05:45:04 ospbx1 polkitd[434]: Loading rules from directory /etc/polkit-1/rules.d
May 12 05:45:04 ospbx1 polkitd[434]: Loading rules from directory /usr/share/polkit-1/rules.d
May 12 05:45:04 ospbx1 polkitd[434]: Finished loading, compiling and executing 2 rules
May 12 05:45:04 ospbx1 polkitd[9892]: Loading rules from directory /etc/polkit-1/rules.d
May 12 05:45:04 ospbx1 polkitd[9892]: Loading rules from directory /usr/share/polkit-1/rules.d
May 12 05:45:04 ospbx1 polkitd[9892]: Finished loading, compiling and executing 2 rules
May 12 05:45:04 ospbx1 polkitd[9892]: Acquired the name org.freedesktop.PolicyKit1 on the system bus
May 12 05:45:25 ospbx1 sshd[853]: Received signal 15; terminating.
May 12 05:45:25 ospbx1 sshd[24197]: Server listening on 0.0.0.0 port 22.
May 12 05:45:25 ospbx1 sshd[24197]: Server listening on :: port 22.
May 12 05:45:26 ospbx1 polkitd[24232]: Loading rules from directory /etc/polkit-1/rules.d
May 12 05:45:26 ospbx1 polkitd[24232]: Loading rules from directory /usr/share/polkit-1/rules.d
May 12 05:45:26 ospbx1 polkitd[24232]: Finished loading, compiling and executing 2 rules
May 12 05:45:26 ospbx1 polkitd[24232]: Acquired the name org.freedesktop.PolicyKit1 on the system bus

Running the check-integrity command:

[root@ospbx1 ~]# vitalpbx check-integrity

Issues Found:
The folder or file "/var/lib/vitalpbx/static" had the group "none" instead of "apache" (fixed up)
Folder "/var/lib/vitalpbx/static/backup" didn't exist (fixed up)
The folder or file "/var/lib/vitalpbx/static/backup" had the permissions 3325 instead of 2775 (fixed up)
The folder or file "/var/lib/vitalpbx/static/backup" had the owner "root" instead of "apache" (fixed up)

Finally, here’s the content of /var/log/secure while the check-integrity command is running:

May 12 05:54:13 ospbx1 sudo:    root : TTY=pts/0 ; PWD=/usr/share/vitalpbx/www ; USER=root ; COMMAND=/sbin/vpbx-helper
May 12 05:54:13 ospbx1 sudo: pam_unix(sudo:session): session opened for user root by root(uid=0)
May 12 05:54:13 ospbx1 sudo: pam_unix(sudo:session): session closed for user root
May 12 05:54:30 ospbx1 sudo:    root : TTY=pts/0 ; PWD=/usr/share/vitalpbx/www ; USER=root ; COMMAND=/sbin/vpbx-helper
May 12 05:54:30 ospbx1 sudo: pam_unix(sudo:session): session opened for user root by root(uid=0)
May 12 05:54:31 ospbx1 sudo: pam_unix(sudo:session): session closed for user root

Here’s a pastebin for easier read: https://pastebin.com/raw/NWunBR0f

Thanks

2 Likes