본문 바로가기
리눅스

파일시스템 에러였음 = crond: can't open or create /var/run/crond.pid: 읽기전용 파일 시스템

by 혜룐 2015. 11. 10.
결론부터 말하면.. 파일시스템 문제였다. 
cron defunct되어 데몬 재구동하려고 했는데.. 아래와 같이 메시지가 나왔다.
* 읽기전용파일시스템 이라 /var/run/crond pid 에 쓸수가 없어서 재구동이 안되었던거다.
[root@com~]# /etc/init.d/crond start
crond (을)를 시작합니다: crond: can't open or create /var/run/crond.pid: 읽기전용 파일 시스템
[실패]
[root@com ~]# cd /var/run/
[root@comrun]# ll
합계 144
drwxr-xr-x 2 root root 4096 8월 29 2005 console
-rw-r--r-- 1 root root 5 9월 29 13:41 crond.pid 
drwxr-xr-x 2 root root 4096 3월 16 2006 dbus
drwxr-xr-x 3 htt htt 4096 3월 16 2006 iiim
-rw-r--r-- 1 root root 5 9월 29 13:41 irqbalance.pid
-rw------- 1 root root 5 9월 29 13:41 klogd.pid
drwx------ 2 root root 4096 10월 5 2004 mdadm
drwx------ 2 root root 4096 10월 5 2004 mdmpd
drwxrwxr-x 2 root root 4096 8월 5 2005 netreport
drwxr-xr-x 2 root root 4096 8월 20 2005 nscd
drwxr-xr-x 2 root root 4096 11월 3 2004 ppp
-rw-r--r-- 1 rpcuser rpcuser 5 9월 29 13:41 rpc.statd.pid
drwxr-xr-x 2 root root 4096 12월 2 2004 saslauthd
-rw-r--r-- 1 root root 5 9월 29 13:41 sshd.pid
drwx------ 2 root root 4096 7월 21 2005 sudo
-rw------- 1 root root 5 9월 29 13:41 syslogd.pid
dr-xr-xr-t 2 root root 4096 9월 21 2005 tog-pegasus
drwx------ 2 root root 4096 7월 19 2005 usb
-rw-rw-r-- 1 root utmp 4224 9월 29 13:41 utmp
drwxr-xr-x 2 root root 4096 7월 20 2005 winbindd
drwxr-xr-x 2 root root 4096 3월 16 2006 xauth
-rw-r--r-- 1 root root 5 9월 29 13:41 xinetd.pid
[root@com-stage run]# rm -rf crond.pid
rm: cannot remove `crond.pid': 읽기전용 파일 시스템
* 파일시스템 type은 아래와 같았고
[root@com ~]# df -Th
Filesystem Type Size Used Avail Use% Mounted on
/dev/sda2 ext3 30G 15G 14G 53% /
/dev/sda1 ext3 289M 16M 259M 6% /boot
none tmpfs 1014M 0 1014M 0% /dev/shm
[root@com~]# bl
blkid blockdev bluefw bluepin bluez-pin 
[root@com ~]# blkid 
/dev/sda1: LABEL="/boot" UUID="8cf9b47a-6a0c-4f3e-902b-940e6f805488" SEC_TYPE="ext3" TYPE="ext2" 
/dev/sda2: LABEL="/" UUID="35dabec1-031f-4b40-ab8c-681d32112793" SEC_TYPE="ext3" TYPE="ext2" 
/dev/sda3: TYPE="swap" 
* 마운트 해제 후 다시 마운트를 하려고 시도했으나 바로 abort 되었다. 
mount -o remount,rw /dev/sda2 /
* abort 되었을때 로그를 보면.. 
EXT3-fs error (device sda2): ext3_remount: Abort forced by user ext3_abort called. ->이 부분
divert: allocating divert_blk for eth1
e1000: eth1: e1000_probe: Intel(R) PRO/1000 Network Connection
ohci_hcd: 2004 Feb 02 USB 1.1 'Open' Host Controller (OHCI) Driver (PCI)
PCI->APIC IRQ transform: (B0,I15,P0) ->0
ohci_hcd 0000:00:0f.2: Found HC with no IRQ. Check BIOS/PCI 0000:00:0f.2 setup!
md: Autodetecting RAID arrays.
md: autorun ...
md: ... autorun DONE.
EXT3 FS on sda2, internal journal
device-mapper: 4.4.0-ioctl (2005-01-12) initialised: dm-devel@redhat.com
cdrom: open failed.
kjournald starting. Commit interval 5 seconds
EXT3 FS on sda1, internal journal
EXT3-fs: mounted filesystem with ordered data mode.
Adding 4200988k swap on /dev/sda3. Priority:-1 extents:1
ip_tables: (C) 2000-2002 Netfilter core team
ip_tables: (C) 2000-2002 Netfilter core team
e1000: eth0: e1000_watchdog: NIC Link is Up 100 Mbps Full Duplex
bonding: bond0: making interface eth0 the new active one.
bonding: bond0: enslaving eth0 as an active interface with an up link.
e1000: eth1: e1000_watchdog: NIC Link is Up 100 Mbps Full Duplex
bonding: bond0: enslaving eth1 as a backup interface with an up link.
NET: Registered protocol family 10
Disabled Privacy Extensions on device c033ff00(lo)
IPv6 over IPv4 tunneling driver
divert: not allocating divert_blk for non-ethernet device sit0
eth1: no IPv6 routers present
bond0: no IPv6 routers present
eth0: no IPv6 routers present
EXT3-fs error (device sda2): ext3_free_blocks_sb: bit already cleared for block 4872192
Aborting journal on device sda2.
ext3_abort called.
EXT3-fs error (device sda2): ext3_journal_start_sb: Detected aborted journal
Remounting filesystem read-only
EXT3-fs error (device sda2) in start_transaction: Journal has aborted
EXT3-fs error (device sda2): ext3_free_blocks_sb: bit already cleared for block 4872193
EXT3-fs error (device sda2): ext3_free_blocks_sb: bit already cleared for block 4872194
EXT3-fs error (device sda2): ext3_free_blocks_sb: bit already cleared for block 4872195
EXT3-fs error (device sda2) in ext3_reserve_inode_write: Journal has aborted
EXT3-fs error (device sda2) in ext3_reserve_inode_write: Journal has aborted
EXT3-fs error (device sda2) in ext3_orphan_del: Journal has aborted
EXT3-fs error (device sda2) in ext3_truncate: Journal has aborted
EXT3-fs error (device sda2) in start_transaction: Journal has aborted
EXT3-fs error (device sda2) in start_transaction: Journal has aborted
EXT3-fs error (device sda2) in start_transaction: Journal has aborted
EXT3-fs error (device sda2) in start_transaction: Journal has aborte
EXT3-fs error (device sda2) in start_transaction: Journal has aborted
EXT3-fs error (device sda2) in start_transaction: Journal has aborted
ext3_abort called.
EXT3-fs error (device sda2): ext3_remount: Abort forced by user
ext3_abort called.
EXT3-fs error (device sda2): ext3_remount: Abort forced by user
ext3_abort called.
EXT3-fs error (device sda2): ext3_remount: Abort forced by user
ext3_abort called.
EXT3-fs error (device sda2): ext3_remount: Abort forced by user
ext3_abort called.
EXT3-fs error (device sda2): ext3_remount: Abort forced by user
ext3_abort called.
EXT3-fs error (device sda2): ext3_remount: Abort forced by user
ext3_abort called.
EXT3-fs error (device sda2): ext3_remount: Abort forced by user
ext3_abort called.
EXT3-fs error (device sda2): ext3_remount: Abort forced by user
* 방법은 파일시스템 체크.. 콘솔에서 보면 device sda2 부분의 / 에 파일시스템 체크 하는걸 볼 수 있었다. 기존에 booting 시 콘솔 log랑 내용이 달랐다. 
* 부팅 후 mount 확인을 해서 rw 상태 인지 보자. 마무리 단계..
[root@com ~]# cat /proc/mounts 
rootfs / rootfs rw 0 0
/proc /proc proc rw,nodiratime 0 0
none /dev tmpfs rw 0 0
/dev/root / ext3 rw 0 0
none /dev tmpfs rw 0 0
/proc /proc proc rw,nodiratime 0 0
/proc/bus/usb /proc/bus/usb usbfs rw 0 0
/sys /sys sysfs rw 0 0
none /dev/pts devpts rw 0 0
/dev/sda1 /boot ext3 rw 0 0
none /dev/shm tmpfs rw 0 0
none /proc/sys/fs/binfmt_misc binfmt_misc rw 0 0
* 결론..
파일시스템이 read상태이면 당연 데몬도 뜨지 않는다.
데몬이 뜰때 pid를 create 하게 되어있는데. read only 상태이니 데몬이 뜨지 않는건 너무나 당연하다.
[root@com ~]# cat /var/run/crond.pid 
2093
[root@co ~]# /etc/init.d/crond stop
crond 를 정지함: [ 확인 ]
[root@com ~]# /etc/init.d/crond start
crond (을)를 시작합니다: [ 확인 ]
[root@com ~]# 
[root@com ~]# cat /var/run/crond.pid 
2958 ---------------->create pid
[root@com ~]# ps afxu | grep crond
root 2965 0.0 0.0 5724 704 pts/0 S+ 12:04 0:00 | \_ grep crond
root 2958 0.0 0.0 5908 1116 ? Ss 12:02 0:00 crond


'리눅스' 카테고리의 다른 글

RFC 793 문서에 있는 TCP 기본 연결, 종료  (0) 2015.11.10
리눅스 OS 덤프  (0) 2015.11.10
'c queue max run limit reached  (0) 2015.11.10
rsync errord 들  (0) 2015.11.10
LSOF는 'List Open File'  (0) 2015.11.10