2014年9月16日 星期二

DRBL/Clonezila for systemd 開發備忘


=== systemd 常用除錯指令 ====

  • systemctl status -l servic-name.service :
  • journalctl [-b |-a | -u [service name] :
    • journalctl -o verbose _PID=11026
  • systemctl  查詢和控制系統狀態和系統服務
  • systemd-cgls  用樹狀結構的方式秀出相關的服務
  • systemadm   systemd圖形化的前端介面,可用來檢查和控制systemd。
===  FC21 目前問題 ====

  • Issue 1: systemd-remount-fs.service  [Ful]/[SSI]
[   49.667014] systemd[1]: systemd-remount-fs.service: main process exited, code=exited, status=1/FAILURE
[FAILED] Failed to start Remount Root and Kernel File Systems.
See "systemctl status systemd-remount-fs.service" for details.

    • systemctl status -l servic-name.service : (-l)察看長列表,以 systemd-remount-fs.service 為例,可以看到

$ systemctl status -l systemd-remount-fs.service
...
Process: 628 ExecStart=/usr/lib/systemd/systemd-remount-fs (code=exited, status=1/FAILURE)
 Main PID: 628 (code=exited, status=1/FAILURE)
 1月 22 15:42:46 fc21_amd64-192-168-13-1 systemd-remount-fs[628]: mount.nfs: an incorrect mount option was specified
實際執行:

# /usr/lib/systemd/systemd-remount-fs
mount.nfs: an incorrect mount option was specified
mount.nfs: an incorrect mount option was specified
/bin/mount for /usr exited with exit status 32.
/bin/mount for / exited with exit status 32.
  • Issue 2: systemd-journald.service  [Ful]/[SSI] : [[SOLVED]]
[   ***] A start job is running for Journal Service (1min 10s / 1min 40s)[  113.702328] systemd[1]: systemd-journald.service watchdog timeout (limit
 1min)!
[***   ] A start job is running for Journal Service (1min 21s / 2min 41s)[  124.200585] systemd-journald[496]: Received SIGTERM from PID 1 (systemd)
.
[**    ] A start job is running for Journal Service (1min 21s / 2min 41s)[  124.518193] systemd[1]: Failed to start Journal Service.
[FAIL[  124.826271] systemd[1]: Dependency failed for Flush Journal to Persistent Storage.
ED] Failed t[  125.232760] systemd[1]: Unit systemd-journald.service entered failed state.
o start Journal [  125.589701] systemd[1]: systemd-journald.service failed.
Service.
See "[  125.902105] systemd[1]: systemd-journald.service has no holdoff time, scheduling restart.
systemctl status systemd-journal[  126.368627] systemd[1]: Stopping Journal Service...
d.service" for d[  126.595878] systemd[1]: Starting Journal Service...
etails.

    • Solution:
 refer: http://forums.gentoo.org/viewtopic-t-806432-view-previous.html?sid=206e0c04aa942972883135971a18c6ae
Add into clients~/etc/systemd/journald.conf
Storage=volatile
SystemMaxUse=20M
SystemMaxFileSize=20M



===  使用systemd分析啟動過程  ====
•systemd-analyze – 顯示kernel 和 user space 上一次啟動所花費之時間
•systemd-analyze blame – 顯示每個服務啟動用了多長時間
•systemd-analyze critical-chain – 顯示對時間要求嚴格的單元鏈的樹結構
•systemd-analyze dot | dot -Tsvg > systemd.svg – 列出啟動過程的向量圖(需安裝graphviz)
•systemd-analyze plot > bootplot.svg – 產生啟過程的時間圖

  • systemctl  查詢和控制系統狀態和系統服務
  • systemd-cgls  用樹狀結構的方式秀出相關的服務
  • systemadm   systemd圖形化的前端介面,可用來檢查和控制systemd。
Reference:

  • Systemd Man Page
    • http://0pointer.de/public/systemd-man/
    • http://chakraos.org/wiki/index.php?title=Systemd/zh-hant
  • systemd.unit 寫法
    • http://0pointer.de/public/systemd-man/systemd.unit.html
  • Sysemd service 管理:
    • https://wiki.archlinux.org/index.php/Systemd
    • http://fedoraproject.org/wiki/Systemd
  • How to debug Systemd problems
    • http://fedoraproject.org/wiki/How_to_debug_Systemd_problems
    • https://www.suse.com/zh-tw/documentation/sles-12/book_sle_admin/data/book_sle_admin.html
  • Fedora 17 Boot Optimization (察看那些 service 不需要)
    • http://www.harald-hoyer.de/personal/blog/fedora-17-boot-optimization-from-15-to-3-seconds
  •  使用systemd分析引導過程 
    • http://os.51cto.com/art/201407/445309.htm
  •  systemd 服務設定說明
    •  https://zh.opensuse.org/openSUSE:How_to_write_a_systemd_service
  • Systemd
    • http://0pointer.de/blog/projects/systemd.html
  • Firewall in Fedora 18
    • https://fedoraproject.org/wiki/FirewallD
    • http://fedoraproject.org/wiki/Features/firewalld-default

沒有留言:

張貼留言

Ceasar's Photo

www.flickr.com