- 论坛徽章:
- 0
|
大家好,我在配置LAM Quota功能时遇到点问题,麻烦大家帮忙看看。
主机环境:
CentOS5.1+OpenLDAP-2.4.13+LAM-2.4.0
情况:lamdaemon脚本创建目录功能正常,但是Quota功能不能用,Lamdaemon Test过程错误如下:
Warning: ssh2_exec() [function.ssh2-exec]: Unable to request a channel from remote host in /opt/openldap/ldap-account-manager-2.4.0/templates/tests/lamdaemonTest.php on line 139
Warning: ssh2_fetch_stream() expects parameter 1 to be resource, boolean given in /opt/openldap/ldap-account-manager-2.4.0/templates/tests/lamdaemonTest.php on line 140
Warning: fwrite(): supplied argument is not a valid stream resource in /opt/openldap/ldap-account-manager-2.4.0/templates/tests/lamdaemonTest.php on line 141
Warning: fread(): supplied argument is not a valid stream resource in /opt/openldap/ldap-account-manager-2.4.0/templates/tests/lamdaemonTest.php on line 151
Warning: fread(): supplied argument is not a valid stream resource in /opt/openldap/ldap-account-manager-2.4.0/templates/tests/lamdaemonTest.php on line 151
后面都是一样的line 151告警
我查了下lamdaemonTest.php内容为:
139 $shell = ssh2_exec($handle, "sudo " . $_SESSION['config']->get_scriptPath());
140 $stderr = ssh2_fetch_stream($shell, SSH2_STREAM_STDERR);
141 fwrite($shell, $command);
151 $read = split("\n", trim(fread($shell, 100000)));
目录能创建相关主机环境设置应该没错吧,最大可能是不是Perl相关环境没设置好呢?
我刚开始按照README里安装:
# perl -MCPAN -e shell
cpan> install Quota
后来改用RPM版本还是一样的报错,相关RPM包:
perl-5.8.8-15.el5_2.1
perl-Net-SSH-Perl-1.30-2.el5.rf
perl-Quota-1.6.2-1.el5.rf
LDAP Manager属性如下:
# Manager, company.com
dn: cn=Manager,dc=company,dc=com
cn: Manager
gidNumber: 10001
homeDirectory: /home/Manager
sn: Manager
uid: Manager
uidNumber: 10001
objectClass: organizationalPerson
objectClass: posixAccount
objectClass: top
loginShell: /bin/bash
userPassword:: e1NTSEF9bUtVRGpU6yZ4RHhCdGNURUvHRzBJVUxUUtw5cWVQZjg=
Sudoer相关设置:
Manager ALL= NOPASSWD: /opt/openldap/ldap-account-manager-2.4.0/lib/lamdaemon.pl
lam.conf配置:
scriptPath: /opt/openldap/ldap-account-manager-2.4.0/lib/lamdaemon.pl
scriptServer: 127.0.0.1
scriptRights: 750
主机Quota功能测试:
# repquota -a
*** Report for user quotas on device /dev/mapper/VolGroup00-LogVol01
Block grace time: 7days; Inode grace time: 7days
Block limits File limits
User used soft hard grace used soft hard grace
----------------------------------------------------------------------
root -- 7055952 0 0 122629 0 0
www -- 77892 0 0 5797 0 0
postfix -- 14748 0 0 3693 0 0
zimbra -- 1308196 0 0 93186 0 0
guest -- 24 0 0 6 0 0
Manager -- 24 0 0 6 0 0
test -- 24 0 0 7 0 0
谢谢大家! |
|