执行tcl命令时“couldn't create error file for command: permission denied”错误的解决

在某台Solaris服务器上, 执行如下命令会报错:

coolap13>1> tcl

tcl>execksh "whence $argv0"

Error: couldn't create error file for command: permission denied

一开始我先去查/var/log/syslog,结果发现/var/log下面为空,于是以为这就是上面报错的原因,就创建了一个authlog在/var/log下面。重新执行以上命令,错误继续。

Google了一下“tclcouldn't create error file for command: permission denied”,发现了这篇文章, 才恍然大悟:原来Tcl在执行时会在临时会检查临时文件夹是否可写,该临时文件夹在UNIX下面一般是/var/tmp。 我查了一下那台机器的/var/tmp,发现普通用户没有写权限。于是将它对的属性改为777,就OK了!

------------------------------

附上那篇文章的原文:

If exec returns an error message of "couldn`t create error file for command: Error 0", the following may help: 

This problem exists under Unix and Windows NT. I have conclusive proof that under Unix it was being caused by the temporary
directory not being world writable, which explains why superusers were able to "exec" something but not a regular user. The
"gotcha!" is that /tmp is not necessarily the temporary directory that is used, so people were not seeing an obvious problem. Tcl
uses the tmpnam() system call, which on many systems actually uses /var/tmp, and on some systems that directory was not world
writable. I would like to call this a problem with one`s site administration.

Here`s a simple program to determine your temporary directory:

main()
{
   char name[100];
   tmpnam(name);
   puts(name);
} 

which prints out the full pathname for a potential new temporary file. If the specified directory is not world writable, you can`t
create temp files. 

Now, the question turns to Windows. This I have not yet resolved. Under NT, which has users and directory permissions, it may be
the same problem as under Unix. However, since this problem is also occurring under Windows 3.1 it may be another problem or
combination of the two. 

-Colin Stevens

On Windows, you will need to set both the TMP and TEMP environment variables, for example: 

SET TMP=C:TEMP
SET TEMP=C:TEMP

-Richard Ross-Langley

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值