我有一个用户没有对任何点文件中的 $PATH 进行任何修改:这正是系统默认设置。从登录外壳:
$ ssh example.com
user@example.com:~$ cat /tmp/hello.hs
#!/bin/bash
echo "$SHELL"
echo "$PATH"
user@example.com:~$ /tmp/hello.hs
/bin/bash
/usr/local/bin:/usr/bin:/bin
Run Code Online (Sandbox Code Playgroud)
完全按照 中的规定/etc/profile。我觉得这很出乎意料:
$ ssh example.com '/tmp/hello.sh'
/bin/bash
/usr/local/bin:/usr/bin:/bin:/usr/bin/X11:/usr/games
Run Code Online (Sandbox Code Playgroud)
就像我说的,没有修改 $PATH in ~/.bashrc,也没有修改/etc/bash.bashrc. 也没有~/.ssh/environment。该ssh(1)声明环境变量PATH是
设置为默认 PATH,如编译 ssh 时所指定。
但是来自 StackOverflow 的这个线程和这个邮件列表文章表明,我应该能够通过修改 /etc/profile、shell 启动文件之一等来影响给定命令的 $PATH。
这里发生了什么?
再会。
虽然这篇文章讨论了与我在成功安装后偶尔提供空白页的类似设置,但除了空白页之外,我无法提供任何内容。有没有存在的错误/var/log/nginx/error.log,/var/log/php-fpm.log或/var/log/nginx/us/sharonrhodes/blog/error.log。
php-fpm.conf:
[全球的] pid = 运行/php-fpm/php-fpm.pid error_log = 日志/php-fpm.log log_level = 通知 [万维网] 听 = 127.0.0.1:9000 听.所有者 = www 听.group = www 听.mode = 0660 用户 = www 组 = www pm = 动态 pm.max_children = 50 pm.start_servers = 20 pm.min_spare_servers = 5 pm.max_spare_servers = 35 pm.max_requests = 500
nginx.conf:
用户 www;
worker_processes 1;
error_log /var/log/nginx/error.log 通知;
pid /var/run/nginx.pid;
事件{
worker_connections … 假设我有一个带有files/etc/foo/{conf0, conf1, conf2, conf3, etc}. 当它们的数量很少时,放置这些文件中的每一个都很简单:
file { 'conf0':
path => '/etc/foo/conf0',
ensure => true,
source => 'puppet:///.../etc/foo/conf0',
}
Run Code Online (Sandbox Code Playgroud)
并重复。但是涉及到相当多的重复,如果有多个配置文件,维护起来很乏味。我想确保它files/etc/foo/被镜像到给定的路径上。也就是说,
file { 'etc foo confs':
path => '/etc/foo',
ensure => recursive,
source => 'puppet:///.../etc/foo',
}
Run Code Online (Sandbox Code Playgroud)
会创建/etc/foo/conf0,/etc/foo/conf1等等。这可能吗?
安装 gitolite 时,我发现:
# aptitude install gitolite
The following NEW packages will be installed:
gitolite
0 packages upgraded, 1 newly installed, 0 to remove and 29 not upgraded.
Need to get 114 kB of archives. After unpacking 348 kB will be used.
Get:1 http://security.debian.org/ squeeze/updates/main gitolite all 1.5.4-2+squeeze1 [114 kB]
Fetched 114 kB in 0s (202 kB/s)
Preconfiguring packages ...
Selecting previously deselected package gitolite.
(Reading database ... 30593 files and directories currently installed.)
Unpacking gitolite (from .../gitolite_1.5.4-2+squeeze1_all.deb) ...
Setting …Run Code Online (Sandbox Code Playgroud) 我更喜欢从squeeze-backports安装在nginx中,而不是在主线稳定中安装。我已经启用了 backports 存储库。我有这个首选项文件:
# /etc/apt/preferences.d/nginx
Package: nginx nginx-common
Pin: release a=squeeze-backports
Pin-Priority: 999
Run Code Online (Sandbox Code Playgroud)
设置目标专门按预期工作:
# aptitude install -t squeeze-backports nginx
The following NEW packages will be installed:
libgd2-noxpm{a} libgeoip1{a} libjpeg62{a} libpcre3{a} libxml2{a} libxslt1.1{a} nginx nginx-common{a} nginx-full{a}
The following packages are RECOMMENDED but will NOT be installed:
geoip-database xml-core
0 packages upgraded, 9 newly installed, 0 to remove and 39 not upgraded.
Need to get 828 kB/2,235 kB of archives. After unpacking 4,985 kB will be used.
Do you want to …Run Code Online (Sandbox Code Playgroud) 该supervisord文件指出,
supervisord 在运行子进程时不会执行任何 shell,因此环境变量(如 USER、PATH、HOME、SHELL、LOGNAME 等)不会从其默认值更改或以其他方式重新分配。(...) 如果您需要为特定程序设置环境变量,否则可能会由特定用户的 shell 调用设置,您必须在 environment= program config 选项中显式执行此操作。
包含一个示例,我将其复制到/etc/supervisor/conf.d/apache2.conf:
[program:apache2]
command=/home/chrism/bin/httpd -c "ErrorLog /dev/stdout" -DFOREGROUND
user=chrism
environment=HOME=/home/chrism,USER=chrism
Run Code Online (Sandbox Code Playgroud)
然而,
# supervisorctl reread
ERROR: CANT_REREAD: Unexpected end of key/value pairs
Run Code Online (Sandbox Code Playgroud)
删除 apache2 配置的“环境”行不会导致重新读取的解析错误。这里有什么好玩的?我在 Debian Squeeze 上使用 supervisor 3.0a8-1,注意主线 supervisor 是 3.0a10;我找不到environment自 3.0a8 以来已添加的参考
对于 Debian,我想阻止安装包。例如,我希望 puppet 和超级用户无法安装ruby1.8,即使ruby1.8请求安装其依赖项列表中的包:puppet 运行会失败,也会失败
# apt-get install ruby1.8
Run Code Online (Sandbox Code Playgroud)
我想要的可能吗?如果是这样,我该怎么办?