Nginx unit lib permission 0750 problem

zEitEr

Super Moderator
Joined
Apr 11, 2005
Messages
15,370
Location
www.poralix.com
Hello,

Investigating an issue with NGINX Unit occurred after the DA update:

Code:
Subject: *** An error has occurred while rewriting the Nginx Unit config ***

Do you probably have similar reports already?

Found wrong permissions:

Bash:
[root@~]# ls -la /usr/lib/unit/modules/*.so
-rwxr-xr-x 1 root root 665856 Mar  3 23:02 /usr/lib/unit/modules/java17.unit.so
-rwxr-xr-x 1 root root 549144 Mar  3 23:02 /usr/lib/unit/modules/perl5.unit.so
-rwxr-x--- 1 root root 800736 Mar  3 23:02 /usr/lib/unit/modules/python3.6.unit.so
-rwxr-x--- 1 root root 480896 Mar  3 23:02 /usr/lib/unit/modules/ruby2.5.unit.so
[root@~]#

Should be fixed with:

Bash:
[root@~]# chmod 755  /usr/lib/unit/modules/*.so
[root@~]# systemctl restart unit.service

Control check:

Bash:
[root@~]# ls -la /usr/lib/unit/modules/*.so
-rwxr-xr-x 1 root root 665856 Mar  3 23:02 /usr/lib/unit/modules/java17.unit.so
-rwxr-xr-x 1 root root 549144 Mar  3 23:02 /usr/lib/unit/modules/perl5.unit.so
-rwxr-xr-x 1 root root 800736 Mar  3 23:02 /usr/lib/unit/modules/python3.6.unit.so
-rwxr-xr-x 1 root root 480896 Mar  3 23:02 /usr/lib/unit/modules/ruby2.5.unit.so
[root@~]#
 

Attachments

  • 2025-03-03_231500.png
    2025-03-03_231500.png
    32.9 KB · Views: 24
Last edited:
Hello,

Investigating an issue with NGINX Unit occurred after the DA update:

Code:
Subject: *** An error has occurred while rewriting the Nginx Unit config ***

Do you probably have similar reports already?

Found wrong permissions:

Bash:
[root@~]# ls -la /usr/lib/unit/modules/*.so
-rwxr-xr-x 1 root root 665856 Mar  3 23:02 /usr/lib/unit/modules/java17.unit.so
-rwxr-xr-x 1 root root 549144 Mar  3 23:02 /usr/lib/unit/modules/perl5.unit.so
-rwxr-x--- 1 root root 800736 Mar  3 23:02 /usr/lib/unit/modules/python3.6.unit.so
-rwxr-x--- 1 root root 480896 Mar  3 23:02 /usr/lib/unit/modules/ruby2.5.unit.so
[root@~]#

Should be fixed with:

Bash:
[root@~]# chmod 755  /usr/lib/unit/modules/*.so
[root@~]# systemctl restart unit.service

Control check:

Bash:
[root@~]# ls -la /usr/lib/unit/modules/*.so
-rwxr-xr-x 1 root root 665856 Mar  3 23:02 /usr/lib/unit/modules/java17.unit.so
-rwxr-xr-x 1 root root 549144 Mar  3 23:02 /usr/lib/unit/modules/perl5.unit.so
-rwxr-xr-x 1 root root 800736 Mar  3 23:02 /usr/lib/unit/modules/python3.6.unit.so
-rwxr-xr-x 1 root root 480896 Mar  3 23:02 /usr/lib/unit/modules/ruby2.5.unit.so
[root@~]#
I would say your problem with permissions was before that update, because I did not mention that problem on my AL 9.5 server after DA update from 1.673 to 1.674. So, the permissions were like these:
Code:
[root@server2 ~]# ls -la /usr/lib/unit/modules/*.so
-rwxr-xr-x 1 root root 545280 Jan 21 13:10 /usr/lib/unit/modules/java17.unit.so
-rwxr-xr-x 1 root root 424568 Jan 21 13:10 /usr/lib/unit/modules/perl5.unit.so
-rwxr-xr-x 1 root root 570080 Jan 21 13:10 /usr/lib/unit/modules/python3.9.unit.so
-rwxr-xr-x 1 root root 406296 Jan 21 13:10 /usr/lib/unit/modules/ruby3.0.unit.so
[root@server2 ~]#
I ran update of UNIT tool again:
Code:
[root@server2 ~]# da build unit
download_cached: using cached '/usr/local/directadmin/custombuild/cache/unit-1.34.1.tar.gz' file
Patching Nginx Unit...
...
npm notice
Nginx Unit 1.34.1 installed
[root@server2 ~]#
and it finished OK and the permissions look OK too.
Code:
[root@server2 ~]# ls -la /usr/lib/unit/modules/*.so
-rwxr-xr-x 1 root root 545280 Mar  3 19:20 /usr/lib/unit/modules/java17.unit.so
-rwxr-xr-x 1 root root 424584 Mar  3 19:20 /usr/lib/unit/modules/perl5.unit.so
-rwxr-xr-x 1 root root 570080 Mar  3 19:20 /usr/lib/unit/modules/python3.9.unit.so
-rwxr-xr-x 1 root root 406296 Mar  3 19:20 /usr/lib/unit/modules/ruby3.0.unit.so
[root@server2 ~]#
If you have any more details or some specific condition or it is related only to specific OS - please let us know. Then we will able to check it closer.
 
I would say your problem with permissions was before that update

That might be so. And still DirectAdmin might check and correct permissions of *.so files, in case they're wrong as in mine case. At least it would be nice)
 
That might be so. And still DirectAdmin might check and correct permissions of *.so files, in case they're wrong as in mine case. At least it would be nice)
I did one more test:
Code:
[root@server2 ~]# chmod 750 /usr/lib/unit/modules/python3.9.unit.so /usr/lib/unit/modules/ruby3.0.unit.so
[root@server2 ~]#
[root@server2 ~]# ls -la /usr/lib/unit/modules/*.so
-rwxr-xr-x 1 root root 545280 Mar  3 19:28 /usr/lib/unit/modules/java17.unit.so
-rwxr-xr-x 1 root root 424584 Mar  3 19:28 /usr/lib/unit/modules/perl5.unit.so
-rwxr-x--- 1 root root 570080 Mar  3 19:28 /usr/lib/unit/modules/python3.9.unit.so
-rwxr-x--- 1 root root 406296 Mar  3 19:28 /usr/lib/unit/modules/ruby3.0.unit.so
[root@server2 ~]#
[root@server2 ~]# da build unit
download_cached: using cached '/usr/local/directadmin/custombuild/cache/unit-1.34.1.tar.gz' file
Patching Nginx Unit...
changed 1 package, and audited 2 packages in 3s
...
found 0 vulnerabilities
Nginx Unit 1.34.1 installed
[root@server2 ~]#
[root@server2 ~]# ls -la /usr/lib/unit/modules/*.so
-rwxr-xr-x 1 root root 545280 Mar  4 06:25 /usr/lib/unit/modules/java17.unit.so
-rwxr-xr-x 1 root root 424584 Mar  4 06:25 /usr/lib/unit/modules/perl5.unit.so
-rwxr-xr-x 1 root root 570080 Mar  4 06:25 /usr/lib/unit/modules/python3.9.unit.so
-rwxr-xr-x 1 root root 406296 Mar  4 06:25 /usr/lib/unit/modules/ruby3.0.unit.so
[root@server2 ~]#
And as you can see the permissions were reset properly.
I even manually removed those 4 .SO files and they were re-added back during UNIT build process.

In this case I can only ask the same: If you have any more details or some specific condition or it is related only to specific OS - please let us know. Then we will able to check it closer.
 
In this case I can only ask the same: If you have any more details or some specific condition or it is related only to specific OS - please let us know. Then we will able to check it closer.

Thank you for your efforts. I don't have steps to reproduce the issue. In my case I had a previous installation of Nginx Unit installed by older DirectAdmin, and even can't I say what were the file permissions before the upgrade.

If I have another similar case, I will for sure investigate it more thoroughly.
 
Back
Top