2014-04-01 12 views
0

我成功编辑了MUD的源代码,并使用的nohup ./startup和权限被拒绝

nohup ./startup & 

虽然我这样做时,它给我这个错误启动服务器的指示说:

$ nohup: ignoring input and appending output to `nohup.out' 
nohup: failed to run command `./startup': Permission denied 

我已经看遍了互联网找到答案。其中一些人说我把我的cygwin目录放在根文件夹(我使用的是Windows 7),它的目录是C:\ cygwin

所以这不是一个问题..任何人都可以帮助我这个吗?

+1

你确定启动在当前目录吗?而且,这些标签都不合适。 – Deduplicator

+0

是启动文件在当前目录中。 –

回答

0

从“man nohup”:

If the standard output is a terminal, all output written by the named utility to its standard output shall be appended to the end of the file nohup.out in the current directory. If nohup.out cannot be created or opened for appending, the output shall be appended to the end of the file nohup.out in the directory specified by the HOME environment variable. If neither file can be created or opened for appending, utility shall not be invoked. If a file is created, the file's permission bits shall be set to S_IRUSR | S_IWUSR.

我的猜测是,由于‘SH -c’不启动登录shell,它继承调用shell的环境,包括家庭环境变量,并试图在那里打开它。所以我会检查当前目录和$HOME的权限。您可以尝试在当前目录中尝试touch test.txt或尝试$HOME以查看是否可以执行该命令。

+0

好的,有没有办法可以启动启动脚本而不使用终端呢? –

+0

您可以尝试在没有'nohup'的情况下启动它。但是,如果您的终端在长时间不活动后超时,则过程可能会在一段时间后终止。至少这将有助于隔离问题。 – Brian

0

随着staticx写入,检查目录(和用户)的权限 - 和可执行文件。

而不是使用nohup的:

  • 检查是否需要在所有nohup,尝试./startup </dev/null >mud.out 2>mud.err &,然后关闭终端窗口,并检查它是否正在运行
  • 或只是在一个screen会话中运行./startup和分离它(<ctrl>+<a>,<d>
0

尝试chmod +x startup,也许你startup文件不可执行。