Chinaunix首页 | 论坛 | 博客
  • 博客访问: 803210
  • 博文数量: 274
  • 博客积分: 0
  • 博客等级: 民兵
  • 技术积分: 862
  • 用 户 组: 普通用户
  • 注册时间: 2015-10-24 15:31
个人简介

不合格的程序猿

文章分类

全部博文(274)

文章存档

2019年(3)

2018年(1)

2017年(4)

2016年(160)

2015年(106)

我的朋友

分类: LINUX

2016-01-15 10:56:41

Linux下sshd启动失败及Squid启动失败问题解决一例

(SSH启动失败)
休假回来,登录服务器时,提示“network refuse",怎么会?
检查/etc/hosts.allow , /etc/hosts.deny 都没有问题
本机和服务器IP在同一网段!
#service sshd restart    正常
#ps -aux|grep sshd    没有此进程
#nmap -sT localhost
如下,没有sshd进程,看来真的没有启动起来!
Starting nmap V. 3.00 ( www.insecure.org/nmap/ )
Interesting ports on localhost.localdomain (127.0.0.1):
(The 1593 ports scanned but not shown below are in state: closed)
Port       State       Service
21/tcp     open        ftp
80/tcp     open        http
111/tcp    open        sunrpc
443/tcp    open        https
1024/tcp   open        kdm
1025/tcp   open        NFS-or-IIS
10000/tcp  open        snet-sensor-mgmt

#tail -20 /var/log/secure
发现有如下错误

sshd[3266]: error: Bind to port 22 on 172.16.X.X failed: Cannot assign requested address.
sshd[3266]: fatal: Cannot bind any address.
sshd[2234]: error: Bind to port 22 on 172.16.X.X failed: Cannot assign requested address.
sshd[2234]: fatal: Cannot bind any address.

没有办法,google一下,发现没有合适的解决办法,大多建议重新安装程序,没有办法,开装
#rpm -e openssh*
#mount -t iso9660 /dev/cdrom /mnt/cdrom
#cd /mnt/cdrom
#rpm -ivh openssh*
#service sshd start
试用SSH登录,正常

(Squid启动失败)
上班有一会了,有人反映没有办法上网?晕死,怎么一上班这么多事。
进入机房查看服务器,屏幕上面写着呢?
Running: squid -sY >;>; /usr/local/squid/var/squid.out 2>&1
/usr/local/squid/bin/RunCache[22]: 20830 Abort(coredump)
Running: squid -sY >;>; /usr/local/squid/var/squid.out 2>&1
#ll /usr/local/squid/var/squid.out 正常
#adsl-restart    以前出现这种问题,好象从启一下ADSL拨号就好了,但是此次不行。
接下来查看其它日志
#tail /usr/local/squid/var/squid.out
2007/07/22 00:56:10| WARNING: Closing open FD    2
2007/07/22 00:56:10| Starting Squid Cache version 2.5.STABLE9 for i686-pc-linux-gnu...
2007/07/22 00:56:10| Process ID 3365
2007/07/22 00:56:10| With 1024 file descriptors available
2007/07/22 00:56:10| Performing DNS Tests...
FATAL: ipcache_init: DNS name lookup tests failed.
Squid Cache (Version 2.5.STABLE9): Terminated abnormally.
CPU Usage: 0.010 seconds = 0.000 user + 0.010 sys
Maximum Resident Size: 0 KB
Page faults with physical i/o: 276
Startup: Sun Jul 22 00:59:01 CST 2007
WARNING: Cannot write log file: /usr/local/squid/var/logs/cache.log
/usr/local/squid/var/logs/cache.log: Permission denied
         messages will be sent to 'stderr'.

#tail /var/log/messages
Oct 29 01:39:37 adslserver squid[12521]: Starting Squid Cache version 2.5.STABLE9 for i686-pc-linux-gnu...
Oct 29 01:39:37 adslserver squid[12521]: Process ID 12521
Oct 29 01:39:37 adslserver squid[12521]: With 1024 file descriptors available
Oct 29 01:39:37 adslserver squid[12521]: Performing DNS Tests...
Oct 29 01:39:42 adslserver squid[12521]: Successful DNS name lookup tests...
Oct 29 01:39:42 adslserver squid[12521]: DNS Socket created at 0.0.0.0, port 3455, FD 5
Oct 29 01:39:42 adslserver squid[12521]: Adding nameserver 202.96.134.133 from squid.conf
Oct 29 01:39:42 adslserver squid[12521]: Adding nameserver 202.96.128.68 from squid.conf
Oct 29 01:39:43 adslserver squid[12521]: Unlinkd pipe opened on FD 10
Oct 29 01:39:43 adslserver squid[12521]: Swap maxSize 8192000 KB, estimated 630153 objects
Oct 29 01:39:43 adslserver squid[12521]: Target number of buckets: 31507
Oct 29 01:39:43 adslserver squid[12521]: Using 32768 Store buckets
Oct 29 01:39:43 adslserver squid[12521]: Max Mem  size: 32768 KB
Oct 29 01:39:43 adslserver squid[12521]: Max Swap size: 8192000 KB
Oct 29 01:39:43 adslserver squid[12521]: Local cache digest enabled; rebuild/rewrite every 3600/3600 sec
Oct 29 01:39:43 adslserver squid[12521]: Rebuilding storage in /usr/local/squid/var/cache1 (DIRTY)
Oct 29 01:39:43 adslserver squid[12521]: Rebuilding storage in /usr/local/squid/var/cache2 (DIRTY)
Oct 29 01:39:43 adslserver squid[12521]: Using Least Load store dir selection
Oct 29 01:39:43 adslserver squid[12521]: Current Directory is /
Oct 29 01:39:43 adslserver squid[12521]: Loaded Icons.
Oct 29 01:39:43 adslserver squid[12521]: Accepting HTTP connections at 172.16.X.X, port 3128, FD 14.
Oct 29 01:39:43 adslserver squid[12521]: Accepting ICP messages at 0.0.0.0, port 3130, FD 15.
Oct 29 01:39:43 adslserver squid[12521]: Accepting SNMP messages on port 3401, FD 16.
Oct 29 01:39:43 adslserver squid[12521]: WCCP Disabled.
Oct 29 01:39:43 adslserver squid[12521]: Pinger socket opened on FD 18
Oct 29 01:39:43 adslserver squid[12521]: Ready to serve requests.
Oct 29 01:39:43 adslserver squid[12521]: diskHandleWrite: FD 9: disk write error: (28) No space left on device
Oct 29 01:39:43 adslserver squid[12521]: Write failure -- check your disk space and cache.log

#df -m
DISK 100%被使用了,阿门,问题出在这里了,但是奇怪的是我有设置cache_swap_log and cache_swap_high呀,cache应该会自动清的呀,不管了,先手动清了再了

#rm -rf /usr/local/squid/var/cache1
#rm -rf /usr/local/squid/var/cache2
#mkdir /usr/local/squid/var/cache1
#mkdir /usr/local/squid/var/cache2
#chown -R nobody.nobody /usr/local/squid/var
#su nobody -c "/usr/local/squid/sbin/squid -z"
#su nobody -c "/usr/local/squid/bin/RunCache &"
搞定!!!

阅读(1392) | 评论(0) | 转发(0) |
0

上一篇:LDAP常用命令解析

下一篇:ldd命令浅析

给主人留下些什么吧!~~