报错如下:

3月 12 00:32:02 10.0.0.3 setroubleshoot[2461]: SELinux 正在阻止 /usr/lib/systemd/systemd 对 execute 文件 进行 ollama 访问。 如需要完整的 SELinux 信息,请运行 sealert -l 4d755f71-9779-42df-970c-b64342e477c5
3月 12 00:32:02 10.0.0.3 setroubleshoot[2461]: SELinux 正在阻止 /usr/lib/systemd/systemd 对 execute 文件 进行 ollama 访问。
                                                
                                                *****  插件 catchall_labels (83.8 置信度) 建议   ************************************
                                                
                                                如果你想允许 systemd 对 ollama file 拥有 execute 访问权限
                                                然后 必须更改 ollama 中的标签
                                                做
                                                # semanage fcontext -a -t FILE_TYPE 'ollama'
                                                其中 FILE_TYPE 为以下内容之一:NetworkManager_dispatcher_exec_t, NetworkManager_exec_t, NetworkManager_initrc_exec_t, NetworkManager_priv_helper_exec_t, abrt_dum>
                                                然后执行:
                                                restorecon -v 'ollama'
                                                
                                                
                                                *****  插件 catchall (17.1 置信度) 建议   *******************************************
                                                
                                                如果你相信 (ollama)应该允许_BASE_PATH execute 访问 ollama file默认情况下。
                                                然后 应该将这个情况作为 bug 报告。
                                                可以生成本地策略模块以允许此访问。
                                                做
                                                暂时允许此访问权限执行:
                                                # ausearch -c '(ollama)' --raw | audit2allow -M my-ollama
                                                # semodule -X 300 -i my-ollama.pp
                                                

如图:

解决方案:

semanage fcontext -a -t bin_t "/app/ollama/bin/ollama?"
restorecon -v /app/ollama/bin/ollama
systemctl start ollama
systemctl status ollama

查看: