😄

マシンのことはマシンに聞けばいいじゃないか?

に公開

ubuntu の調子があまりよろしくありません。

  • 依存関係が壊れて荒療治をした結果、少しずつ動くようになりました。
  • 直しきれないトコロが・・・gtk3.0の依存が壊れています。
  • 幸い・・ollama は動いています。色々訊ねてみました。
# >>> ollama run deepseek-r1:7b
>>>  >>> What Happen this ?  : 2025-03-30T16:10:48.581607+09:00 mypc kernel: 
... audit: type=1400 audit(1743318648.579:8069): apparmor="DENIED" operation="fi
... le_mmap" class="file" profile="/usr/lib/snapd/snap-confine" name="/usr/lib/x86_64-linux-gnu/libgtk3-nocsd.so.0" 

<think>
Okay, so I'm trying to figure out what's going on here. There's this log 
message that was provided, and it looks like an audit entry from a system 
running the RYZEN 5700 CPU with a kernel. The command seems to be related 
to apparmor being denied when trying to access a specific file. 

First, I need to understand what each part of this log means. Let me break 
it down:

下手にGoogle検索するより良いのでは?

  • 指摘された項目から snap-confine が存在しないことが発覚
1. **Verify Snap Confine Installation:**
   - Check if snap-confine is installed using the command:
     ```bash
     sudo apt install snapd
     ```
   If it isn't installed, proceed with installation.

2. **Review AppArmor Configuration:**
   - Ensure an `apparmor.conf` file exists in your system's `/etc/`. If 
not, create a new one.
   - Configure apparmor to allow necessary operations (like mmap) for 
legitimate applications under appropriate profiles.

3. **Inspect System Logs:**
   - Review logs related to snapd or apparmor to gain insights into why 
this specific access is being denied:
     ```bash
     sudo journalctl --format=JSON | jq -r '.log_file[time][message]'
     ```

4. **Check User/Group Permissions:**
   - Verify that user and group permissions allow the necessary operations 
without compromising security.

5. **Update or Patch Applications:**
   - If an application is using this file, ensure it's up to date to avoid 
permission-related issues.

By following these steps, you can resolve the denied `file_mmap` access 
issue caused by misconfigured apparmor settings and ensure snap-confine is 
properly installed and configured.
  • こういうのを検索で探すと余り出てこないこともあります。モデルが蓄えてる知識が Linuxに偏っているというのもありそうですが、Ubuntuのライトユーザである限り、apparmor方面の知識が欠落しているので示唆されるだけでも非常に助かるわけです。
  • おかげで探索が捗りそうです。今日はココまでで終わり。

Discussion