几个月前我从SDDM切换到PLM,同样设置了plasmalogin.service的LANG环境变量
[Service]
Environment=LANG=zh_CN.UTF-8
我有两个电脑装了Arch,一台生效,另外一台却不行,
想请问各位大佬什么问题会导致这种情况?
几个月前我从SDDM切换到PLM,同样设置了plasmalogin.service的LANG环境变量
[Service]
Environment=LANG=zh_CN.UTF-8
我有两个电脑装了Arch,一台生效,另外一台却不行,
想请问各位大佬什么问题会导致这种情况?
看看LANGUAGE变量呢?
不了解这个进程是干什么的,不过怎么乱码了?
打开就是这样 有什么办法确认乱码是什么吗?
我也不知道。不过我会考虑用strace检查execve时的参数。
我该strace哪一个程序?plasmalogin吗?
ExecStart=里写的那个,用-f一路跟下来(大概会非常慢就是了)。
sudo strace -f -s 1024 -e trace=execve plasmalogin
execve("/usr/bin/plasmalogin", ["plasmalogin"], 0x7fffac915488 /* 27 vars */) = 0
[17:39:38.880] (II) DAEMON: Initializing...
strace: Process 709001 attached
[17:39:38.881] (II) DAEMON: Starting...
[17:39:38.882] (II) DAEMON: Logind interface found
[17:39:38.883] (II) DAEMON: Adding new display...
[17:39:38.886] (II) DAEMON: Using VT 1
[17:39:38.886] (II) DAEMON: Display server started.
[17:39:38.886] (II) DAEMON: Socket server starting...
[17:39:38.887] (II) DAEMON: Socket server started.
[17:39:38.887] (II) DAEMON: Greeter starting...
strace: Process 709002 attached
[pid 709002] execve("/usr/lib/plasmalogin-helper", ["/usr/lib/plasmalogin-helper", "--socket", "/tmp/plasmalogin-auth-4e809c5c-e3c7-4b5c-8cac-0a0c6ec39252", "--id", "2", "--sta
rt", "/usr/bin/startplasma-login-wayland", "--user", "plasmalogin", "--greeter"], 0x55ef6be35ac0 /* 1 var */) = 0
[17:39:38.911] (II) HELPER: [PAM] Starting...
[17:39:38.911] (II) HELPER: [PAM] Authenticating...
[17:39:38.912] (II) HELPER: [PAM] returning.
[17:39:39.155] (II) HELPER: Starting Wayland user session: "/usr/share/plasmalogin/scripts/wayland-session" "/usr/bin/startplasma-login-wayland"
strace: Process 709064 attached
[pid 709064] --- SIGRT_31 {si_signo=SIGRT_31, si_code=SI_KERNEL} ---
[pid 709064] execve("/usr/share/plasmalogin/scripts/wayland-session", ["/usr/share/plasmalogin/scripts/wayland-session", "/usr/bin/startplasma-login-wayland"], 0x55f635b788f0 /
* 26 vars */) = 0
[17:39:39.166] (II) DAEMON: Greeter session started successfully
strace: Process 709086 attached
strace: Process 709087 attached
strace: Process 709088 attached
strace: Process 709089 attached
[pid 709087] execve("/usr/bin/find", ["find", "/etc/debuginfod", "-name", "*.urls", "-print0"], 0x562696b5a130 /* 28 vars */ <unfinished ...>
[pid 709088] execve("/usr/bin/xargs", ["xargs", "-0", "cat"], 0x562696b5a130 /* 28 vars */ <unfinished ...>
[pid 709087] <... execve resumed>) = 0
[pid 709088] <... execve resumed>) = 0
[pid 709089] execve("/usr/bin/tr", ["tr", "\\n", " "], 0x562696b5a130 /* 28 vars */) = 0
strace: Process 709094 attached
[pid 709087] +++ exited with 0 +++
[pid 709094] execve("/usr/local/bin/cat", ["cat", "/etc/debuginfod/archlinux.urls"], 0x7ffd9d9e4b68 /* 28 vars */) = -1 ENOENT (没有那个文件或目录)
[pid 709094] execve("/usr/bin/cat", ["cat", "/etc/debuginfod/archlinux.urls"], 0x7ffd9d9e4b68 /* 28 vars */) = 0
[pid 709094] +++ exited with 0 +++
[pid 709088] --- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=709094, si_uid=956, si_status=0, si_utime=0, si_stime=0} ---
[pid 709088] +++ exited with 0 +++
[pid 709089] +++ exited with 0 +++
[pid 709086] --- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=709087, si_uid=956, si_status=0, si_utime=0, si_stime=0} ---
[pid 709086] +++ exited with 0 +++
[pid 709064] --- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=709086, si_uid=956, si_status=0, si_utime=0, si_stime=0} ---
strace: Process 709105 attached
strace: Process 709108 attached
strace: Process 709110 attached
strace: Process 709112 attached
[pid 709108] execve("/usr/bin/find", ["find", "/etc/debuginfod", "-name", "*.certpath", "-print0"], 0x562696b5a130 /* 29 vars */) = 0
[pid 709110] execve("/usr/bin/xargs", ["xargs", "-0", "cat"], 0x562696b5a130 /* 29 vars */) = 0
[pid 709112] execve("/usr/bin/tr", ["tr", "\\n", ":"], 0x562696b5a130 /* 29 vars */) = 0
strace: Process 709121 attached
[pid 709108] +++ exited with 0 +++
[pid 709121] execve("/usr/local/bin/cat", ["cat"], 0x7ffde7906be8 /* 29 vars */) = -1 ENOENT (没有那个文件或目录)
[pid 709121] execve("/usr/bin/cat", ["cat"], 0x7ffde7906be8 /* 29 vars */) = 0
[pid 709121] +++ exited with 0 +++
[pid 709110] --- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=709121, si_uid=956, si_status=0, si_utime=0, si_stime=0} ---
[pid 709110] +++ exited with 0 +++
[pid 709112] +++ exited with 0 +++
[pid 709105] --- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=709108, si_uid=956, si_status=0, si_utime=0, si_stime=0} ---
[pid 709105] +++ exited with 0 +++
[pid 709064] --- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=709105, si_uid=956, si_status=0, si_utime=0, si_stime=0} ---
strace: Process 709131 attached
strace: Process 709134 attached
strace: Process 709135 attached
[pid 709134] execve("/usr/bin/flatpak", ["flatpak", "--installations"], 0x562696b5a130 /* 30 vars */) = 0
[pid 709134] +++ exited with 0 +++
[pid 709135] +++ exited with 0 +++
[pid 709131] --- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=709134, si_uid=956, si_status=0, si_utime=0, si_stime=0} ---
[pid 709131] +++ exited with 0 +++
[pid 709064] --- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=709131, si_uid=956, si_status=0, si_utime=0, si_stime=0} ---
strace: Process 709138 attached
[pid 709138] execve("/usr/bin/tty", ["/usr/bin/tty"], 0x562696b5f530 /* 30 vars */) = 0
[pid 709138] +++ exited with 0 +++
[pid 709064] --- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=709138, si_uid=956, si_status=0, si_utime=0, si_stime=0} ---
strace: Process 709139 attached
[pid 709139] execve("/usr/bin/pidof", ["pidof", "-s", "gpm"], 0x562696b5f530 /* 30 vars */) = 0
[pid 709139] +++ exited with 1 +++
[pid 709064] --- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=709139, si_uid=956, si_status=1, si_utime=0, si_stime=1 /* 0.01 s */} ---
[pid 709064] execve("/usr/bin/startplasma-login-wayland", ["/usr/bin/startplasma-login-wayland"], 0x562696b5f530 /* 30 vars */) = 0
strace: Process 709145 attached
[17:39:39.931] (II) DAEMON: Message received from greeter: Connect
^Cstrace: Process 708997 detached
strace: Process 709001 detached
strace: Process 709002 detached
strace: Process 709064 detached
strace: Process 709145 detached
[17:39:43.744] (WW) DAEMON: Signal received: SIGINT
[17:39:43.744] (WW) HELPER: Signal received: SIGINT
[17:39:43.744] (II) DAEMON: Greeter stopping...
[17:39:43.744] (WW) HELPER: Signal received: SIGTERM
我strace了一下,结果手动启动的PLM就是中文的。。。
当然是去strace有问题的那个——把strace塞进服务里边。
另外环境变量没显示出来。好像是要加-v选项?
好,我加进去重启一下看看
说明这个环境变量中途被改掉了。可能是某个配置文件里写着。
那应该是systemd相关的配置文件吧,毕竟手动启动是正常的?
不好说。手动启动的环境和systemd启动时太不一样了,可能会影响程序的行为。
这个服务有自己的home目录吗?可以去/var/lib下翻一下看看。
有,存的是一些KDE的设置,我翻一下
看来就是这个的问题了。https://wiki.archlinuxcn.org/wiki/Locale#我的系统的语言还是不对
解决办法如图,删除/var/lib/plasmalogin/.config/plasma-localerc让程序重新生成即可(确保plasmalogin.service的LANG已经设置为中文!)