straceが動かないエラー
さて、
先日から読んでいる「linuxのしくみ」で、
straceコマンドを動かすところがあったのですが、
自分が実行した時は動きませんでした。
こんなコマンドを実行して
strace -p <pid>
こんなエラー
strace: Could not attach to process. If your uid matches the uid of the target process, check the setting of /proc/sys/kernel/yama/ptrace_scope, or try again as the root user. For more details, see /etc/sysctl.d/10-ptrace.conf ptrace: Operation not permitted.
…
OSはUbuntuで行っていて、
何を血迷ったのかstraceのバージョンがおかしいのか?と思い
sudo apt-get install strace
をやっても、
strace はすでに最新バージョン(4.21-1ubuntu1)です。
と出てダメでした。
そんで、
よくよくエラーメッセージを読んだら最初から読めよ
_人人人人人人人人人人人人人人_
> try again as the root user <
 ̄Y^Y^Y^Y^Y^Y^Y^Y^Y^Y^Y^Y^ ̄
とあったので、rootに移行して実行すると…
通りました。
エラーメッセージはちゃんと読みましょうね。。。