我不知道为什么,但我只能用 sudo 运行 Telegram。我刚刚从 desk.telegram.com 下载了 tar 文件并将其内容提取到 /usr/local/Telegram 中。
我现在可以使用以下命令打开该程序:
sudo /usr/local/Telegram/Telegram
但不是
/usr/local/Telegram/Telegram
如果我执行第二个操作,我会收到错误日志:
[2016.10.31 12:53:39] Launched version: 10019, alpha: [FALSE], beta: 0, debug mode: [FALSE], test dc: [FALSE]
[2016.10.31 12:53:39] Executable dir: , name:
[2016.10.31 12:53:39] Initial working dir: /home/iguarna/
[2016.10.31 12:53:39] Working dir: /home/iguarna/.local/share/TelegramDesktop/
[2016.10.31 12:53:39] Arguments: "Telegram"
[2016.10.31 12:53:39] FATAL: Could not open '/home/iguarna/.local/share/TelegramDesktop/log_startXX.txt' for writing log!
[2016.10.31 12:53:39] Connecting local socket to /tmp/95578c71afe4942c16be0fb6f3bfa82f-{87A94AB0-E370-4cde-98D3-ACC110C5967D}...
[2016.10.31 12:53:39] This is the only instance of Telegram, starting server and app...
可能是什么原因?
答案1
错误消息FATAL: Could not open '/home/iguarna/.local/share/TelegramDesktop/log_startXX.txt' for writing log!
表明您确实telegram
以 身份运行root
,并且创建了日志文件(以 身份root
),现在,普通用户无法写入root
-owned 日志文件。通过以下方式修复此问题:
sudo chown $(id -u):$(id -g) /home/iguarna/.local/share/TelegramDesktop/log_startXX.txt
你在哪里运行程序并不重要,你以谁的身份运行程序才重要。