顯示具有 centos 標籤的文章。 顯示所有文章
顯示具有 centos 標籤的文章。 顯示所有文章

2016年2月6日 星期六

2016年2月5日 星期五

yum lock 的問題



1.找出 PackageKit

#ps aux | grep PackageKit

>root 9809 1.8 4.5 944132 177120 ? SN 17:28 0:21 /usr/bin/python /usr/share/PackageKit/helpers/yum/yumBackend.py get-updates none

>root 10723 0.0 0.0 112656 968 pts/2 S+ 17:47 0:00 grep --color=auto PackageKit


#kill -9 9809


假如仍



Existing lock /var/run/yum.pid: another copy is running as pid 9809.
Another app is currently holding the yum lock; waiting for it to exit...
Another app is currently holding the yum lock; waiting for it to exit...
Another app is currently holding the yum lock; waiting for it to exit...

^C

Exiting on user cancel.

一般程序執行時候,lock file 會放在 /var/lock/subsys/ 目錄,但此處沒有 yum 或 python 或 PackageKit

[root@localhost ~]# ls /var/lock/subsys/
abrt-ccpp auditd crond local network rpc.statd
abrtd autofs cups lvm2-monitor NetworkManager rsyslog
acpid blk-availability haldaemon messagebus postfix sshd
atd certmonger ip6tables netfs rpcbind udev-post
[root@localhost ~]#

從剛剛的訊息
Existing lock /var/run/yum.pid: another copy is running as pid 9809.
yum 的 lock file 是 /var/run/yum.pid,用 rm -fr 指令刪除

[root@localhost ~]# rm -fr /var/run/yum.pid

OK

2016年2月1日 星期一

CentOS 7 - firewalld 設定



1.firewalld目錄

/etc/firewalld/:使用者自訂的資料


/usr/lib/firewalld/:firewalld預設的資料,請勿更動。

2.

啟動

# service firewalld start

停止

# service firewalld stop

重新啟動

# service firewalld restart

重讀設定

# firewall-cmd --reload

查看狀態

# service firewalld status



# firewall-cmd --state

3.

查看zone

# firewall-cmd --get-default-zone

(預設)

# firewall-cmd --get-active-zones

(運作中)

查看此zone所開的服務

# firewall-cmd --zone=public --list-all

4.

在public zone新增80TCP的服務

# firewall-cmd --zone=public --add-port=80/tcp

移除在public zone上80埠的所有服務 tcp/udp

# firewall-cmd --zone=public --remove-port=80


# firewall-cmd --zone=public --add-source=163.17.40.0/24(指定來源)

# firewall-cmd --zone=public --remove-source=163.17.40.0/24

close centos7 selinux

# vi /etc/sysconfig/selinux

(find)SELINUX=enforcing

(change into)SELINUX=disabled

# reboot

centos 7 change dns seeting (when Couldn't resolve host 'mirrorlist.centos.org')

1. use   nmcli
2.# nmcli con mod enoXXXXX ipv4.dns “168.95.1.1”
3# nmcli con up enoXXXX

OR


2015年12月22日 星期二

centos6 改port 端口

1.依據服務改config 檔
2.改防火牆 iptables

centos6 inittab level 設定錯誤處理

情況:

改 inittab level時 出錯以致無法開機

解決方式:

1.開機時按任意鍵進入GRUB

2.按「↑」、「↓」鍵:選取要操作的項目。
   按「Enter」鍵:開啟所選擇的作業系統。
   按「e」鍵:在開機前,先行編輯指令。
   按「a」鍵:於開機前修改核心參數。
   按「c」鍵:進入 GRUB 命令列來操作
   選擇按E鍵編輯

3.編輯指令
   按「↑」、「↓」鍵:選取要編輯的指令。
   按「b」鍵:開啟作業系統。
   按「e」鍵:編輯該行指令。
   按「c」鍵:進入 GRUB 命令列來操作。
   按「o」鍵:於所選擇該命令行下方產生新的一行。
   按「O」鍵:於所選擇該命令行上方產生新的一行。
   按「d」鍵:移除該行。
   按「ESC」鍵:回主選單。

  移至 kernel 指令那一行,再按下「e」鍵做編輯。

4.改rhgb quiet 1或rhgb quiet single
    按「b」鍵 進入單人模式
mount 根目錄
mount -a

5.改回正確的inittab level

6.虛擬主機需先設定強制進入BIOS



參考網址:http://www.suse.url.tw/redhat/boot.htm

2014年12月9日 星期二

移除MYSQL 重裝 MYSQL後 SFS3 一片空白

1.重新install sfs3 2.以測試帳號進入試試 3.進入MYSQL 移除 SFS3 資料庫 4.新增SFS3 資料庫 5.執行 mysql -u root -p sfs3 < sfs3sql(備份的SQL)

bash: service: command not found 處理方法

1.,service命令是要用ROOT用户来执行的,而出错的用户是用su root切换到ROOT用户下,这个命令没有也不会把环境带过去!用如下命令就不会出错了: su - root