ユーザ用ツール

サイト用ツール


systemd

差分

このページの2つのバージョン間の差分を表示します。

この比較画面へのリンク

両方とも前のリビジョン前のリビジョン
次のリビジョン
前のリビジョン
systemd [2022/05/29 10:25] nullponsystemd [2023/03/16 18:01] (現在) nullpon
行 9: 行 9:
  
     $ systemctl list-unit-files --type service     $ systemctl list-unit-files --type service
 +    
 +有効なサービスの一覧を見る
 +
 +    $ systemctl list-unit --type service
          
 サービスの状態を確認 サービスの状態を確認
行 18: 行 22:
     $ systemctl start nginx.service     $ systemctl start nginx.service
     $ systemctl stop nginx.service     $ systemctl stop nginx.service
 +
 +自動起動を有効化する(普通は有効化されているが何らかの原因でdisabledになってしまった場合の修正)
 +
 +    $ systemctl enable nginx.service
          
 一部のサービスにはreload(再起動せずconfigファイルの読み直し)もある。いい感じのbashでは補完機能でreload可能なサービスのみリストアップされる、ただし少し重い。 一部のサービスにはreload(再起動せずconfigファイルの読み直し)もある。いい感じのbashでは補完機能でreload可能なサービスのみリストアップされる、ただし少し重い。
行 38: 行 46:
 ``` ```
  
-のようになっている。systemd管理では127.0.0.53へアクセスして名前解決を行う。実際に使用される外部ネームサーバは`/run/systemd/resolve/resolv.conf`を見ると良い。変更したい場合はこのファイルには触らず、[netplan](/netplan)を経由して行うのが良+のようになっている。systemd管理されているLinuxサーバ上各アプリケーションは127.0.0.53をネームサーバとして利用できる 
 + 
 +実際に使用される外部ネームサーバは`/run/systemd/resolve/resolv.conf`に書かれてこれを変更したい場合はこのファイルには触らず、[netplan](/netplan)を経由して行うとよ
  
 ## systemd-timesyncd ## systemd-timesyncd
行 49: 行 59:
  
     $ sudo timedatectl set-timezone Asia/Tokyo     $ sudo timedatectl set-timezone Asia/Tokyo
 +    
 +現在のTimeZone設定もtimedatectlで確認できる
 +
 +```
 +$ timedatectl
 +               Local time: 土 2023-01-28 01:44:40 JST
 +           Universal time: 金 2023-01-27 16:44:40 UTC
 +                 RTC time: 金 2023-01-27 16:44:40
 +                Time zone: Asia/Tokyo (JST, +0900)
 +System clock synchronized: yes
 +              NTP service: active
 +          RTC in local TZ: no
 +```
  
 NTPサーバの指定などは以下のファイルにある NTPサーバの指定などは以下のファイルにある
systemd.1653819910.txt.gz · 最終更新: 2022/05/29 10:25 by nullpon