Cobblerd start failure due to incorrect ownership of /var/lib/cobbler/web.ss · Issue #3446 · cobbler/cobbler · GitHub
More Web Proxy on the site http://driver.im/
You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As has been noted for some time, cobblerd will fail to start after a restart, giving an error about /var/lib/cobbler/web.ss. This was reported in #2183, and discussed elsewhere. When successfully starting, the permission began as:
-rw-r--r--. 1 root root system_u:object_r:cobbler_var_lib_t:s0 1024 Jun 7 09:46 /var/lib/cobbler/web.ss
but after starting, the permission becomes:
-rw-r--r--. 1 apache root system_u:object_r:cobbler_var_lib_t:s0 1024 Jun 7 09:47 /var/lib/cobbler/web.ss
And while the ownership remains as apache, the cobblerd server will fail to start.
The problem is that in cobblerd.py:regen_ss_file(), after this file is created by cobblerd for use in authorizing the CLI and web, the routine changes the ownership to 'apache', and then when the process is restarted, the routine once again tries to open it for writing the random 1024 byte auth token, the open fails. Changing the ownership back to root fixes the issue.
Steps to reproduce
Start the server for the first time... it starts.
Restart the server, It will fail with an error opening /var/lib/cobbler/web.ss
Changing the ownership of the file back to root.root and restarting will succeed.
Expected behavior
The cobblerd service would restart each and every time.
[Daemon] 2023-06-07T22:11:08 - INFO | running: ['/usr/sbin/selinuxenabled']
[Daemon] 2023-06-07T22:11:08 - INFO | received on stdout:
[Daemon] 2023-06-07T22:11:08 - DEBUG | received on stderr:
[Daemon] 2023-06-07T22:11:08 - INFO | Automigration NOT executed
[Daemon] 2023-06-07T22:11:09 - INFO | python3-hivex not found. If you need Automatic Windows Installation support, please install.
[Daemon] 2023-06-07T22:11:09 - INFO | 11 breeds and 131 OS versions read from the signature file
[Daemon] 2023-06-07T22:11:09 - DEBUG | API handle initialized
[Daemon] 2023-06-07T22:11:09 - ERROR | [Errno 13] Permission denied: '/var/lib/cobbler/web.ss'
Screenshots
Additional information
The fix is to remove the call to os.lchown() from cobblerd.py:regen_ss_file()
The text was updated successfully, but these errors were encountered:
@cinnion This file is just used for the CLI authentication since the WebUI was removed in 3.3.0. With the next version of Cobbler, this file will be removed as the new CLI will use the standard XML-RPC API for authentication. As such you are welcome to open a PR against the release33 branch but the allocated time and priorities at work don't allow me to take care of this atm.
As has been noted for some time, cobblerd will fail to start after a restart, giving an error about /var/lib/cobbler/web.ss. This was reported in #2183, and discussed elsewhere. When successfully starting, the permission began as:
-rw-r--r--. 1 root root system_u:object_r:cobbler_var_lib_t:s0 1024 Jun 7 09:46 /var/lib/cobbler/web.ss
but after starting, the permission becomes:
-rw-r--r--. 1 apache root system_u:object_r:cobbler_var_lib_t:s0 1024 Jun 7 09:47 /var/lib/cobbler/web.ss
And while the ownership remains as apache, the cobblerd server will fail to start.
The problem is that in cobblerd.py:regen_ss_file(), after this file is created by cobblerd for use in authorizing the CLI and web, the routine changes the ownership to 'apache', and then when the process is restarted, the routine once again tries to open it for writing the random 1024 byte auth token, the open fails. Changing the ownership back to root fixes the issue.
Steps to reproduce
Expected behavior
The cobblerd service would restart each and every time.
Cobbler version
(From EPEL 9 repository)
Operating system
Rocky Linux release 9.2 (Blue Onyx)
Cobbler log
Screenshots
Additional information
The fix is to remove the call to os.lchown() from cobblerd.py:regen_ss_file()
The text was updated successfully, but these errors were encountered: