2016年6月7日 星期二

2016年6月6日 星期一

修改學務系統 姓名欄位

UPDATE `sfs3`.`teacher_post_view` SET `name` = '馬大大' WHERE CONVERT(`teacher_post_view`.`teach_id` USING utf8) = 'yspXXX' LIMIT 1;

2016年2月19日 星期五

CentOS 7 修改主機名稱



修改主機名稱

1.hostnamectl set-hostname [NAME]

查看目前的主機名稱

2.hostnamectl

下個指令之後,就不用再去修改 network 設定了

3.sudo hostnamectl set-hostname [NAME]

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