2013-07-09 65 views
1

对于我的Symfony应用程序,我使用ANT构建了一个部署脚本。在installation manual中,您可以看到您需要将权限设置为app/cache/app/logs目录。所以我用命令行下面的办法:ANT设置ACL权限

sudo chmod +a "_www allow delete,write,append,file_inherit,directory_inherit" app/cache app/logs 

setfacl该方法不适合我(Mac OS)并与umask第三个选项,工作是我没有选择。

所以我在想如何与ANT做到这一点,想出了:

<chmod perm="+a '_www allow delete,write,append,file_inherit,directory_inherit'"> 
    <fileset dir="app/cache" /> 
    <fileset dir="app/logs" /> 
</chmod> 

的问题是它什么都不做。我甚至没有收到错误信息,也没有更改权限。对此有何建议?我无法使用类似perm="0775"perm="0777"的解决方法,因为那时我无法使用ANT将其删除(仅适用于sudo ant,但那不是我想要的)。 任何建议如何处理?

回答

0

好,我知道:

<exec executable="chmod" dir="webroot" failonerror="true"> 
    <arg line="+a '_www allow delete,write,append,file_inherit,directory_inherit' app/cache app/logs" /> 
</exec> 
0

我的系统(Debian的喘息)似乎并不支持+a属性,但是这很适合我(在docs秒选项):

<exec executable="/bin/sh" dir="${basedir}/app" failonerror="true"> 
    <arg value="-c"/> 
    <arg value="setfacl -dR -m u:www-data:rwX -m u:`whoami`:rwX cache logs"/> 
</exec> 

使用sh -c似乎是必要的,因为我无法在没有它的情况下使用反向号码whoami

您可能需要将dir="${basedir}/app"更改为您自己的应用路径。