2016年1月27日 星期三

CentOS7 安裝 tftp server

yum install tftp-server
systemctl start tftp.socket

相關設定檔:
/etc/xinetd.d/tftp
/usr/lib/systemd/system/tftp.service
/usr/lib/systemd/system/tftp.socket

systemctl 常用參數指令

systemctl start
systemctl stop
systemctl restart
systemctl reload
systemctl status
systemctl enable
systemctl disable
systemctl is-enabled
systemctl list-unit-files
systemctl list-units
systemctl daemon-reload

systemctl --failed

CentOS 7 安裝設定 dnsmasq tftp 功能

yum install dnsmasq

編輯 /etc/dnsmasq.conf
# Enable the TFTP server
enable-tftp

# 設定 tftp 目錄
tftp-root=/var/lib/tftp

建立 tftp 目錄
mkdir /var/lib/tftp

systemctl enable dnsmasq.service
systemctl start dnsmasq.service

systemd 日誌系統

systemd 提供自己日誌系統 log,無須安裝

相關指令 journalctl
journalctl -b
journalctl -b -0 #本次啟動 log
journalctl -b -1 #上次啟動 log
journalctl -b -2 #前兩次啟動 log

journalctl --since="2016-1-1 1:1:1"
journalctl --since "10 min ago"

journalctl -f #最新 log

journalctl /usr/lib/systemd/systemd
journalctl _PID=1
journalctl -u netcfg
journalctl -k
journalctl -f -l SYSLOG_FACILITY=10

相關檔案、設定檔
/var/log/journal
/run/systemd/journal
/etc/systemd/journald.conf

SysV啟動級別與Systemd目標對照表

0  runlevel0.target, poweroff.target  
1, s, single  runlevel1.target, rescue.target  
2, 4  runlevel2.target, runlevel4.target, multi-user.target  
3  runlevel3.target, multi-user.target  
5  runlevel5.target, graphical.target  
6  runlevel6.target, reboot.target  
emergency  emergency.target 

相關指令
systemctl isolate graphical.target #切換啟動級別

systemctl 電源管理指令

systemctl 電源管理指令 
重新啟動 systemctl reboot
關機 systemctl poweroff
待機 systemctl suspend
休眠 systemctl hibernate
休眠儲存至硬碟後待機 systemctl hybrid-sleep  

其他
安裝 polkit 可提供一般帳號使用電源管理