| 然而,从 --- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=11679, si_uid=1000, si_status=0, si_utime=1, si_stime=1} ---rt_sigreturn({mask=[]})                 = -1 EINTR (被中断的系统调用)read(8, 
 可以看出,实际上子进程已经退出了(父进程收到 SIGCHLD 信号),父进程确依然在尝试从管道中读取内容,导致的阻塞。 而且从 read(8, "setterm: 347273210347253257 xterm-256color 344"..., 16384) = 51read(8, "Couldn't get a file descriptor r"..., 16333) = 56read(8, "/home/lujun9972/.bash_profile: 347"..., 16277) = 72read(8, "Your display number is 0nTest wh"..., 16205) = 78read(8, "Fcitx is running correctly.nn==="..., 16127) = 104read(8, "stdin isn't a tty!n", 16023)  = 19read(8, "__RESULT b269cd09e7ec4e8a115188c"..., 16004) = 298read(8, 0x7ffd1d39cba6, 15706)          = ? ERESTARTSYS (To be restarted if SA_RESTART is set)
 看到,子进程的输出似乎是我的交互式登录 bash 启动时的输出(加载了 .bash_profile) 在往前翻发现这么一段信息: readlinkat(AT_FDCWD, "/home", 0x7ffd1d3abb50, 1024) = -1 EINVAL (无效的参数)readlinkat(AT_FDCWD, "/home/lujun9972", 0x7ffd1d3abf00, 1024) = -1 EINVAL (无效的参数)readlinkat(AT_FDCWD, "/home/lujun9972/.emacs.d", 0x7ffd1d3ac2b0, 1024) = -1 EINVAL (无效的参数)readlinkat(AT_FDCWD, "/home/lujun9972/.emacs.d/elpa", 0x7ffd1d3ac660, 1024) = -1 EINVAL (无效的参数)readlinkat(AT_FDCWD, "/home/lujun9972/.emacs.d/elpa/exec-path-from-shell-20180323.1904", 0x7ffd1d3aca10, 1024) = -1 EINVAL (无效的参数)readlinkat(AT_FDCWD, "/home/lujun9972/.emacs.d/elpa/exec-path-from-shell-20180323.1904/exec-path-from-shell.elc", 0x7ffd1d3acdc0, 1024) = -1 EINVAL (无效的参数)lseek(7, -2655, SEEK_CUR)               = 1441read(7, "n(defvar exec-path-from-shell-de"..., 4096) = 4096
 这很明显是跟 exec-path-from-shell有关啊。 通过查看 exec-path-from-shell的实现,发现exec-path-from-shell的实现原理是通过实际调启一个 shell,然后输出PATH和MANPATH的值的。 而且对于bash来说,默认的启动参数为-i -l(可以通过exec-path-from-shell-arguments来设置)。也就是说bash会作为交互式的登录shell来启动的,因此会加载.bash_profile和.bashrc。 既然发现跟 exec-path-from-shell这个包有关,而且据说这个包对 Linux 其实意义不大,那不如直接禁用掉好了。 dotspacemacs-excluded-packages '(exec-path-from-shell) 
 再次重启Emacs,发现这次启动速度明显快了许多了。 【编辑推荐】 
    【责任编辑:庞桂玉 TEL:(010)68476606】用于测量磁盘活动的Linux命令如何在Linux中删除文本中的回车字符教程:使用U盘将Linux Mint安装到Windows笔记本上如何在Linux/Windows/MacOS上使用.NET进行开发摸鱼也要有技巧 3个Linux命令行工具让你假装很忙 点赞 0
 (编辑:南平站长网) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |