English 中文(简体)
“单角”一开始,马斯克人忽视
原标题:Upstart `unicorn` with umask ignored

I m 采用startup v1.4,以启动我的应用服务器,称为uni明星/code>

The upstart configuration file looks like this:

description "Unicorn Application Server"

start on network
stop on runlevel [!2345]

umask 0003
setuid unicorn
setgid myproject
chdir /opt/myproject/

respawn

exec /opt/myproject/bin/unicorn --config-file /opt/myproject/config/unicorn.rb --env production

这一过程必须有<条码>0774<>,即<条码>+rwxo+r,至少是用于名录。 用户和办公室; 共享小组,如原始服务器、上载、工作人员伐木等。

我注意到,这些名录是在错误许可的情况下创建的:

drw-rw-r-- 2 unicorn       myproject        4096 2012-01-13 06:58 20120113-0658-7704-4676

我知道,我的申请中没有造成这种情况。

根据将<条码>gdb附在程序上,并打电话<条码> 呼唤 umask(0),有效载荷为<条码>75,或<条码>0o113。

页: 1 会议:

root@1:/opt/myproject# cat ./tmp/pids/unicorn.pid 
7600

root@1:/opt/myproject# gdb
GNU gdb (GDB) 7.1-ubuntu

(gdb) attach 7600
Attaching to process 7600

(gdb) call umask(0)
$1 = 75

(gdb) call umask(75)
$2 = 0

(gdb) q
Quit anyway? (y or n) y
Detaching from program: /usr/local/bin/ruby, process 7600

root@1:/opt/myproject# ruby -e  printf("%o
", 75) 
113

<代码>113的空白处将说明对<代码>664<>/code>的许可,这似乎是我所看到的。

我在这里做了什么错误,统法协会是否错失? 是否开始无视我的 st? 我是否应当将斜体定义为003,而不是0003? 我的<代码>gdb session work and %o/code> syntax那正确?

最佳回答

“单角”如何在启动环境之外行事? 我会这样作,但请加以核对(尽可能简单地处理所有问题)。

认为uma的价值不是绝对的:正如名称所示,它是一种面罩——它从许可的轨道上“分号”<>,具体是指在开启档案或创建名录时。 当马斯克人从我所能看到的情况开始时,你的问题必须放在这个单角的申请书上,具体说明在你打开书面档案和制作名录时,哪是一套奇怪的许可。

Try stracing unicorn to see what it is actually doing:

  strace -o /tmp/strace.log -fFv -s 1024 /opt/myproject/bin/unicorn --config-file ...

等到每个角落才建立一些档案和(或)目录,停下来/用,并查看文件/tmp/strace.log.,在FLE是其中一种文件的名称的情况下,“开放(FILE)”是指它所创建的,并且看到第3条论点是公开系统所要求的。 如果你具有这种模式价值,就应当能够建造一个木舟,使你希望获得档案许可。 请注意,这确实假定:

  • is consistent with the mode it specifies.
  • does not call umask(2) itself (which would override the Upstart umask stanza).
  • does not call chmod(2)/fchmod(2).

如果——在遵循上述程序之后——你仍然认为存在一个问题,请提供简单的测试案例(不需要单角),并在此提一个 b子:

问题回答

如果你不把玉米从前班扎中挑出一个只叫“mask >> /tmp/somefile”的文字,那么它在那里怎么办? 如果能够作出预期的反应,你的问题就在单角。





相关问题
Add a changing icon to Ubuntu Panel

What would be the most simple way of adding and changing an icon in the Ubuntu (Gnome) Panel? I m looking for something as simple as shell scripting, but I m not restricted to that. Will write a ...

Configuring kernel

After create a new system call, how to update the kernel? I tried these lines, make-kpkg clean fakeroot make-kpkg -initrd -append-to-version=-custom kernel_image kernel_headers But Ubuntu asked me ...

save Exceptions to file in python

I want to save all following Exceptions in a file. The reason why I need this is because the IDLE for python 3.1.1 in Ubuntu raises an Exception at calltipps, but close to fast, that it isn t readble. ...

How can i monitor system statistics in kubuntu using Java?

i am doing a project related to configuration and memory analyzer for kubuntu. i want to display the system statistics information like CPU usage, RAM usage and proceses etc. graphically using an ...

How to pass "--external-locking" for mysqld in Ubuntu

I would like to start my mysql server with the --external-locking option. As mysqld is run by the /etc/init.d/mysql script ubuntu (karmic), I guess that s where I should set this "--external-locking" ...

"g++" and "c++" compiler

I just found on my Ubuntu, there are two different C++ compilers: /usr/bin/g++ and /usr/bin/c++. I am not familiar with the latter, but man c++ just jumps to the manpage of gcc. I wonder what is their ...

热门标签