从find手册页:
Run Code Online (Sandbox Code Playgroud)-exec command ; There are unavoidable security problems surrounding use of the -exec action; you should use the -execdir option instead. -execdir command {} + Like -exec, but the specified command is run from the subdirectory containing the matched file, which is not normally the directory in which you started find. This a much more secure method for invoking commands, as it avoids race conditions during resolution of the paths to the matched files.
这是什么意思?为什么从起始目录运行它会出现竞争条件?这些安全风险如何?
我已经安装了 Raspian Jessie Lite 并添加了我可以让浏览器全屏运行的最低限度。我从 IceWeasel 开始:
sudo apt-get install -y x-window-system iceweasel
Run Code Online (Sandbox Code Playgroud)
并将其放入我的.xinitrc:
iceweasel "http://localhost/"
Run Code Online (Sandbox Code Playgroud)
现在,当我运行startx它时会加载 IceWeasel。然而,它只占了一小部分;屏幕的一部分。我能够通过加载 IceWeasel,关闭它,然后修改存储窗口大小的文件并使其为 1920x1080 来解决这个问题。
一切都很好,直到我发现 IceWeasel 并不支持 Chrome 所做的所有新的 ECAMScript 优点。所以,我正在尝试更换 Chromium。我已经成功安装了它,并且我已经将我的更改.xinitrc为:
chromium-browser --start-maximized --kiosk http://localhost/
Run Code Online (Sandbox Code Playgroud)
但是,当它启动时,它只使用大约(可能正好)一半的屏幕!我尝试了各种选择,但无法正常工作。--start-fullscreen更奇怪,渲染正确,但被切成两半!:(
注意:我试图避免安装任何窗口管理器/等,因为当 IceWeasel 已经全部正常工作时,似乎不需要它!?
冰鼬:
铬(--start-maximized和--kiosk):
铬 ( --start-fullscreen):
我正在使用 Raspbian Jessie,但有一些我想要的软件包不可用(但在 Debian Stretch 存储库中)。我想暂时使用 Stretch 存储库来安装它们(以及任何其他不满意的依赖项),但将来不会从那里安装任何其他东西。
我知道事情可能行不通;等等。; 我只是在一次性安装中尝试一些东西:)
我尝试操纵一些文件(基于这个答案),但我得到了这个..不确定 a)如何修复它 b)我是否以正确的方式做事!
W: GPG error: http://ftp.uk.debian.org stretch InRelease: The
following signatures couldn't be verified because the public
key is not available:
NO_PUBKEY 8B48AD6246925553 NO_PUBKEY 7638D0442B90D010
Run Code Online (Sandbox Code Playgroud) 我的系统日志如下所示:
Apr 1 19:05:25 raspberrypi dhcpcd[699]: eth0: Router Advertisement from fe80::c23e:fff:fe63:5170
Apr 1 19:07:35 raspberrypi dhcpcd[699]: eth0: Router Advertisement from fe80::c23e:fff:fe63:5170
Apr 1 19:10:26 raspberrypi dhcpcd[699]: eth0: Router Advertisement from fe80::c23e:fff:fe63:5170
Apr 1 19:13:10 raspberrypi dhcpcd[699]: eth0: Router Advertisement from fe80::c23e:fff:fe63:5170
Apr 1 19:15:13 raspberrypi dhcpcd[699]: eth0: Router Advertisement from fe80::c23e:fff:fe63:5170
Apr 1 19:17:01 raspberrypi CRON[8809]: (root) CMD ( cd / && run-parts --report /etc/cron.hourly)
Apr 1 19:18:05 raspberrypi dhcpcd[699]: eth0: Router Advertisement from fe80::c23e:fff:fe63:5170
Apr 1 19:20:41 raspberrypi dhcpcd[699]: …Run Code Online (Sandbox Code Playgroud) (编辑:这不仅仅适用于 postfix;这只是我注意到/调试它的地方)
我已经安装了 postfix,但是当它启动并创建它的 chroot 时,它会得到一个空副本,/etc/resolv.conf这意味着它无法解析任何域。
我在各种网络脚本中添加了一些日志记录以查看resolve.conf何时被擦除/重新填充以及postfix何时启动......
这是启动时的日志:
Sun Mar 27 19:12:30 UTC 2016
EXECUTE: root + /sbin/resolvconf2 -d eth0 -f
Sun 27 Mar 19:12:31 UTC 2016
Postfix startup script
Sun Mar 27 19:12:37 UTC 2016
EXECUTE: root + /sbin/resolvconf2 -a eth0
Run Code Online (Sandbox Code Playgroud)
请注意,在调用 resolvconf 以擦除配置然后重新填充它之间有 7 秒的时间。在此期间,/etc/resolv.conf 实际上是空的。postfix(和许多其他服务)在这些调用之间启动。
在清除/重新创建 resolvconf 之间的巨大间隙中启动服务似乎很奇怪。
这是 Raspbian 的全新安装,安装了 Postfix,没有其他更改。
编辑:查看系统日志,由于在 dhcpcd 开始和完成之间没有 DNS,实际上有很多事情失败了。其他服务试图同时启动似乎有缺陷?
我最近开始使用tmux. 我发现我可以使用以下方法附加或创建 tmux 会话:
tmux new-session -A -s main
Run Code Online (Sandbox Code Playgroud)
我希望将其放入,.profile以便在通过 SSH 连接时自动放入 tmux。我想在本地登录时跳过这个。
我发现这个问题看起来很有希望,但是我担心如果我从中启动 tmux,.profile那么它会启动我的 shell 并无限地创建另一个 tmux!
那么tmux,.profile如果它已经在 tmux 中运行,那么避免启动的正确方法是什么?