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

2015年1月9日 星期五

Systemd

傳統 init script 位置
$ ls /etc/init.d/*

systemd service 描述檔位置
$ ls /etc/systemd/system/*

令 systemd 重新載入設定檔,若有 service 描述檔,則會取代 init script
# systemctl daemon-reload

查看 service 資訊,可看到目前載入爲 service 描述檔
$ systemctl status crond
● cron.service - Regular background program processing daemon
   Loaded: loaded (/lib/systemd/system/cron.service; enabled)
   Active: active (running) since 五 2015-01-09 12:49:34 CST; 10h ago
     Docs: man:cron(8)
 Main PID: 536 (cron)
   CGroup: /system.slice/cron.service
           └─536 /usr/sbin/cron -f

Systemd 採用 System State 的方式,取代以往的 runlevel,當令一個 service 在開機後執行,則會在 /etc/systemd/system/multi-user.target.wants/ 下建立一個軟連結
$ systemctl [enable|disable] foo
$ ls /etc/systemd/system/multi-user.target.wants/

取得目前的 System-State (get current state)
$ systemctl get-default




References :
Systemd - FedoraProject

2014年10月22日 星期三

允許 systemd 將 acpi 事件轉交給其他程式處理


# vi /etc/systemd/logind.conf
# 讓 systemd 不處理 acpi 事件
HandlePowerKey=ignore
HandleSuspendKey=ignore
HandleHibernateKey=ignore
HandleLidSwitch=ignore
# 允許 acpi 事件轉交給其他程式處理
PowerKeyIgnoreInhibited=no
SuspendKeyIgnoreInhibited=no
HibernateKeyIgnoreInhibited=no
LidSwitchIgnoreInhibited=no
# vi /etc/rc.local
exec systemd-inhibit acpid
# reboot




References :
Arch Linux:使用systemd管理系統與服務 | 二三事
混乱的笔记本电源管理 (页 1) / 笔记本及其他便携设备 / Arch Linux 中文论坛