1

After installing mod_security and firewall and restarting the server getting the error as

Plesk\Lock\Exception

Lock Manager error: '[LockManagerException] Can't open or create shared memory by shm.name: "/run/lock/lmlib/SharedLockManagerStorage0.2.4"; shm.start_size: "8388608"; error "Permission denied"'.


Type Plesk\Lock\Exception

Message Lock Manager error: '[LockManagerException] Can't open or create shared memory by shm.name: "/run/lock/lmlib/SharedLockManagerStorage0.2.4"; shm.start_size: "8388608"; error "Permission denied"'.

File Hierarchical.php

Line 126

enter image description here

These were the commands that were executed after the server error still no good getting the same error

root@user:~# /etc/init.d/sw-engine status && /etc/init.d/sw-cp-server status && /etc/init.d/psa status
● sw-engine.service - Startup script for Panel sw-engine
   Loaded: loaded (/lib/systemd/system/sw-engine.service; enabled; vendor preset: enabled)
   Active: active (running) since Do 2018-11-15 17:50:16 IST; 5min ago
 Main PID: 28406 (sw-engine-fpm)
   Status: "Processes active: 0, idle: 0, Requests: 0, slow: 0, Traffic: 0req/sec"
   CGroup: /system.slice/sw-engine.service
           ├─  480 sw-engine-kv
           └─28406 sw-engine-fpm: master process (/etc/sw-engine/sw-engine-fpm.conf)
● sw-cp-server.service - Startup script for Plesk control panel server
   Loaded: loaded (/lib/systemd/system/sw-cp-server.service; enabled; vendor preset: enabled)
   Active: inactive (dead) since Do 2018-11-15 17:35:25 IST; 20min ago
 Main PID: 28042 (code=exited, status=0/SUCCESS)
root@user:~# /etc/init.d/sw-engine restart && /etc/init.d/sw-cp-server restart && /etc/init.d/psa restart
[ ok ] Restarting sw-engine (via systemctl): sw-engine.service.
[ ok ] Restarting sw-cp-server (via systemctl): sw-cp-server.service.
root@user:~# /etc/init.d/sw-engine status && /etc/init.d/sw-cp-server status && /etc/init.d/psa status​
● sw-engine.service - Startup script for Panel sw-engine
   Loaded: loaded (/lib/systemd/system/sw-engine.service; enabled; vendor preset: enabled)
   Active: active (running) since Do 2018-11-15 17:58:40 IST; 49s ago
 Main PID: 9041 (sw-engine-fpm)
   Status: "Processes active: 0, idle: 1, Requests: 1, slow: 0, Traffic: 0req/sec"
   CGroup: /system.slice/sw-engine.service
           ├─  480 sw-engine-kv
           ├─ 9041 sw-engine-fpm: master process (/etc/sw-engine/sw-engine-fpm.conf)
           ├─ 9050 sw-engine-fpm: pool plesk
           ├─ 9079 /usr/bin/sw-engine -c /opt/psa/admin/conf/php.ini /opt/psa/admin/plib/scripts/...
           ├─11978 sw-engine-fpm: pool plesk
           └─11979 sw-engine-fpm: pool plesk
● sw-cp-server.service - Startup script for Plesk control panel server
   Loaded: loaded (/lib/systemd/system/sw-cp-server.service; enabled; vendor preset: enabled)
   Active: active (running) since Do 2018-11-15 17:57:06 IST; 2min 23s ago
 Main PID: 1499 (sw-cp-serverd)
   CGroup: /system.slice/sw-cp-server.service
           ├─1499 sw-cp-server: master process /usr/sbin/sw-cp-serverd -c /etc/sw-cp-server/confi...
           └─1500 sw-cp-server: worker process
Usage: /etc/init.d/psa {start|stop|startall|stopall|restart|status}
root@user:~# /etc/init.d/sw-engine restart && /etc/init.d/sw-cp-server restart && /etc/init.d/psa restart
[ ok ] Restarting sw-engine (via systemctl): sw-engine.service.
[ ok ] Restarting sw-cp-server (via systemctl): sw-cp-server.service.
root@user:~# /etc/init.d/sw-engine status && /etc/init.d/sw-cp-server status && /etc/init.d/psa status​
● sw-engine.service - Startup script for Panel sw-engine
   Loaded: loaded (/lib/systemd/system/sw-engine.service; enabled; vendor preset: enabled)
   Active: active (running) since Do 2018-11-15 18:00:00 IST; 59s ago
 Main PID: 13605 (sw-engine-fpm)
   Status: "Processes active: 0, idle: 3, Requests: 5, slow: 0, Traffic: 0req/sec"
   CGroup: /system.slice/sw-engine.service
           ├─  480 sw-engine-kv
           └─13605 sw-engine-fpm: master process (/etc/sw-engine/sw-engine-fpm.conf)
● sw-cp-server.service - Startup script for Plesk control panel server
   Loaded: loaded (/lib/systemd/system/sw-cp-server.service; enabled; vendor preset: enabled)
   Active: active (running) since Do 2018-11-15 17:59:59 IST; 1min 0s ago
 Main PID: 13532 (sw-cp-serverd)
   CGroup: /system.slice/sw-cp-server.service
           ├─13532 sw-cp-server: master process /usr/sbin/sw-cp-serverd -c /etc/sw-cp-server/config
           └─13533 sw-cp-server: worker process
Usage: /etc/init.d/psa {start|stop|startall|stopall|restart|status}
root@user:~#

**************************************************************************************************************************************************
root@user:~# chmod 0700 /usr/local/psa/var/cache/
root@user:~# chown psaadm:root /usr/local/psa/var/cache/
root@user:~# chmod 0755 /usr/local/psa/var/
root@user:~# chown psaadm:psaadm /usr/local/psa/var/
root@user:~# chmod 0755 /usr/local/psa
root@user:~# chown root:root /usr/local/psa
root@user:~# chmod 0755 /usr/local
root@user:~# chown root:root /usr/local
root@user:~# chmod 0755 /usr
root@user:~# chown root:root /usr
root@user:~# chmod 0775 /var/lock
root@user:~# chmod 0555 /
root@user:~# chown root:root /
root@user:~#
root@user:~# plesk repair fs -v -y

Checking Linux system files

  There are incorrect permissions on some items: /run/lock .......... [ERROR]
    - Incorrect permissions on /run/lock. Expected: one of 01777.
      Actual: 0775.
    Repairing incorrect permissions ................................. [FIXED]

  There are incorrect permissions on some items: /etc ............... [ERROR]
    - Incorrect owner of /etc. Expected: root (0). Actual: 5002
      (5002).
      Incorrect group of /etc. Expected: root (0). Actual: 5002
      (5002).
    Repairing incorrect permissions ................................. [FIXED]

Checking virtual hosts' file system

  There is incorrect ownership on some items in the WWW root directory
  of the domain 'somedomain.com' ....................................... [ERROR]
    - Incorrect owner of
      /var/www/vhosts/somedomain.com/httpdocs/proj_ci/application/controllers/chatbar.php:
      expected is techlabz (10000), actual is root (0)
      Incorrect group of
      /var/www/vhosts/somedomain.com/httpdocs/proj_ci/application/controllers/chatbar.php:
      expected is psacln (1003), actual is root (0)
    Repairing incorrect ownership ................................... [FIXED]

Error messages: 3; Warnings: 0; Errors resolved: 3

root@user:~# service sw-engine restart
root@user:~# service sw-cp-server restart
1

I ran the same command but I have the same error, the problem is that ownership changes back to incorrect after server reboot on /run/lock/lmlib so I modified crontab:

# crontab -e

Add the following line

@reboot chown root:lock-manager /run/lock/lmlib && chmod -R 0770 /run/lock/lmlib
1

Analyzing the result

There are incorrect permissions on some items: /run/lock .......... [ERROR]
    - Incorrect permissions on /run/lock. Expected: one of 01777.
      Actual: 0775.
    Repairing incorrect permissions ................................. [FIXED]

W.K.T,

An "Octal Value" of 0177 had been assigned to the directory run/lock. This means it had set with the permission with d--xrwxrwx

/run/lock/lmlib has ownership different from:

# stat /run/lock/lmlib
.....

Access: (0770/drwxrwx---) Uid: ( 0/ root) Gid: ( 0/ lock-manager)

/run/lock is created on boot by /usr/lib/tmpfiles.d/legacy.conf (both on systemd and initscripts). So Ownership changes back to incorrect after the server reboot.

You'll not find any logs for the root cause. All the logs will be generated at the core level.

Cause

Bug in OpenVZ kernel: https://bugs.openvz.org/browse/OVZ-6384

Resolution

So by changing the owner or the group and the permission of the /run/lock/lmlib file structure recursively set to 0770. After the reboot, the problem still persists

As a workaround, create a scheduled task like as follows:

  1. Log in to the server over SSH as user root
  2. Run: # crontab -e
  3. Add the following line

    @reboot chown root:lock-manager /run/lock/lmlib && chmod -R 0770 /run/lock/lmlib

  4. Reboot the server and this solve's the problem permanently

This job will change permissions back to correct right after a server reboot.

Note: If there is no /run/lock/lmlib folder on your Plesk version, use /var/lock/lmlib instead

So this should be

root@user:/run/lock# ls -lr
total 0
drwxr-xr-x 2 root     root          40 Nov 15 22:11 subsys
drwxr-xr-x 2 root     root          40 Nov 16 11:43 plesk
-rw-r--r-- 1 root     root           0 Nov 15 22:11 ntpdate
drwxrwx--- 3 root     lock-manager 200 Nov 15 22:11 lmlib
drwxrwx--- 2 root     root          80 Nov 16 03:04 files
drwxr-xr-x 2 www-data root

root@user:/run/lock/lmlib# ls -lr
total 20
-rw-rw-rw- 1 psaadm psaadm        131072 Nov 15 22:11 TmpSharedLockManagerStorage0.2.4
-rw-rw-rw- 1 psaadm psaadm             0 Nov 16 11:43 sleep_storage.lock
-rw-rw-rw- 1 psaadm psaadm             0 Nov 16 11:43 shared_memory.rlock
-rw-rw-rw- 1 psaadm psaadm             0 Nov 16 11:43 shared_memory.lock
-rw-rw-rw- 1 psaadm psaadm       8388608 Nov 16 11:44 SharedLockManagerStorage0.2.4
drwxrwsr-x 2 psaadm lock-manager      40 Nov 16 11:44 container_locks
-rw-rw-rw- 1 psaadm psaadm             0 Nov 16 11:43 container.lock
-rw-rw-rw- 1 psaadm psaadm             0 Nov 16 11:44 authorizer.lock

Each number (also referred to as an octal because it is base8) in that grouping represents 3 bits. If you turn it into binary it makes it a lot easier.
1 = 0 0 1
3 = 0 1 1
5 = 1 0 1
7 = 1 1 1

So if you did 1777, 3777, 5777, or 7777 you would set the sticky bit because the third column would be a 1. However, with 3777, 5777, and 7777 you are additionally setting other bits (SUID for the first column, and SGID for the second column).

Conversely, any other number in that spot (up to the maximum of 7) would not set the sticky bit because the last column wouldn't be a 1 or "on."
2 = 0 1 0
4 = 1 0 0
6 = 1 1 0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.