linux c语言排错,Linux排错记录(一)

Linux排错记录

#==========================RSYNC====================================#

故障:

svn201@192.168.11.40::svnbak /opt/svnbak

@ERROR: auth failed on module svnbak

rsync error: error starting client-server protocol (code 5) at main.c(1296) [receiver=2.6.8]

原因:

在服务端的配置文件中secrets file = /etc/server.pas与客户端的密码不符。

解决方法:

修改客户端的密码。

注意:

secrets file:该选项指定一个包含定义用户名:密码对的文件。只有在"auth users"被定义时,该文件才有作用。文件每行包含一个username:passwd对。一般来说密码最好不要超过8个字符。没有默认的secures file名,需要限式指定一个。

auth users:该选项指定由空格或逗号分隔的用户名列表,只有这些用户才允许连接该模块。这里的用户和系统用户没有任何关系。如果"auth users"被设置,那么客户端发出对该模块的连接请求以后会被rsync请求challenged进行验证身份这里使用的challenge/response认证协议。用户的名和密码以明文方式存放在"secrets file"选项指定的文件中。默认情况下无需密码就可以连接模块(也就是匿名方式)。

故障:

rsync: failed to connect to 10.12.58.78: Connection refused (111)

rsync error: error in socket IO (code 10) at clientserver.c(107) [receiver=2.6.8]

解决办法:

重启服务器端的rsync服务。

故障:

rsync @ERROR: chdir failed

解决办法:

setsebool -P rsync_disable_trans on

看服务端目录是否存在

故障:@ERROR: auth failed on module *** ---客户端

解决办法:

将服务端的密码文件的权限用chmod命令修改为600

#========================LNMP========================================#

PHP

故障:

在安装PHP扩展memcache-2.2.5报错

Cannot find config.m4.

Make sure that you run '/usr/local/php/bin/phpize' in the top level source directory of the module

解决方法:

进入memcache-2.2.5的解压后的源码包,进入其中的ext目录(cd ext),执行 ./ext_skel --extname=sdomain,显示如下:

Creating directory sdomain

Creating basic files: config.m4 config.w32 .cvsignore sdomain.c php_sdomain.h CREDITS EXPERIMENTAL tests/001.phpt sdomain.php [done].

To use your new extension, you will have to execute the following steps:

1.  $ cd ..

2.  $ vi ext/sdomain/config.m4

3.  $ ./buildconf

4.  $ ./configure --[with|enable]-sdomain

5.  $ make

6.  $ ./php -f ext/sdomain/sdomain.php

7.  $ vi ext/sdomain/sdomain.c

8.  $ make

Repeat steps 3-6 until you are satisfied with ext/sdomain/config.m4 and

step 6 confirms that your module is compiled into PHP. Then, start writing

code and repeat the last two steps as often as necessary.

进入 cd sddomain。文件如下:

config.m4   CREDITS       php_sdomain.h  sdomain.php

config.w32  EXPERIMENTAL  sdomain.c      tests

修改config.m4文件

dnl PHP_ARG_WITH(my_module, for my_module support,

dnl Make sure that the comment is aligned:

dnl [ --with-my_module       Include my_module support])

修改成

PHP_ARG_WITH(my_module, for my_module support,

dnl Make sure that the comment is aligned:

[ --with-my_module       Include my_module support])

或者将

dnl PHP_ARG_ENABLE(my_module, whether to enable my_module support,

dnl Make sure that the comment is aligned:

dnl [ --enable-my_module      Enable my_module support])

修改成

PHP_ARG_ENABLE(my_module, whether to enable my_module support,

dnl Make sure that the comment is aligned:

[ --enable-my_module      Enable my_module support])  ---其实就是将这部分的dnl去掉,在这个文件里dnl就是注释的意思,相当于我们PHP里面的#或// 另外把他中间的一句描术也去掉

修改sdomain.c文件

修改其中的代码如下:

function_entry my_module_functions[] = {

PHP_FE(say_hello,    NULL) /* 添加这一行代码 */

PHP_FE(confirm_my_module_compiled,   NULL) /* For testing, remove later. */

{NULL, NULL, NULL}   /* Must be the last line in my_module_functions[] */

};

在文件最后在添加以下代码:

PHP_FUNCTION(say_hello)

{

zend_printf("hello sdomain!");

}

修改php_sdomain.h文件

在PHP_FUNCTION(confirm_my_module_compiled ); /* For testing, remove later. */ 这行的下面添加一行:

PHP_FUNCTION(say_hello); /* For testing, remove later. */

在次进入memcache-2.2.5的源码包执行

[root@test memcache-2.2.5]# /usr/local/php/bin/phpize

Configuring for:

PHP Api Version:         20041225

Zend Module Api No:      20060613

Zend Extension Api No:   220060519

进行安装:

[root@test memcache-2.2.5]# ./configure --with-php-config=/usr/local/php/bin/php-config

[root@test memcache-2.2.5]# make

[root@test memcache-2.2.5]# make install

#===========================Tomcat=================================#

故障:

[root@test245 bin]# ./startup.sh

Cannot find ./catalina.sh

This file is needed to run this program

[root@test245 bin]# sh catalina.sh

The BASEDIR environment variable is not defined correctly

This environment variable is needed to run this program

解决方法:

[root@test245 bin]# chmod +x *.sh

[root@test245 bin]# ./startup.sh

Using CATALINA_BASE:   /opt/tomcat/pab

Using CATALINA_HOME:   /opt/tomcat/pab

Using CATALINA_TMPDIR: /opt/tomcat/pabb/temp

Using JRE_HOME:        /opt/jdk1.6.0_26

Using CLASSPATH:       /opt/tomcat/pabb/bin/bootstrap.jar

#=========================================SVN=========================#

错误:

/opt/subversion-1.6.7/bin/svnadmin: error while loading shared libraries: libsvn_fs_util-1.so.0: cannot open shared object file: No such file or directory

/opt/subversion-1.6.7/bin/svn: error while loading shared libraries: libsvn_fs_util-1.so.0: cannot open shared object file: No such file or directory

解决方法:

1.给用户登录的权限,修改/etc/passwd 改成/bin/bash。

2.给库目录及其下面的文件可执行的权限。

错误:

post-commit FS processing had error 'attempt to write a readonly database'.

post-commit FS processing had error sqlite: attempt to write a readonly database

解决方法:

chown -R apache.apache rep-cache.db

#====================================Crontab(一)=========================#

错误:

"/tmp/crontab.XXXXmVT8rF":1: bad minute

errors in crontab file, can't install.

Do you want to retry the same edit?

解决方法:

编辑crontab的时候,时间格式设置错误,每分钟的格式:*/1

#===================================NFS==============================#

报错:exportfs: No options、exportfs: No host name given with、exportfs: No options for、exportfs: No host name given with

解决方法:/etc/exports格式错误

/home/abc 192.168.1.33(rw,sync)

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

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值