ユーザ用ツール

サイト用ツール


systemd

差分

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

この比較画面へのリンク

両方とも前のリビジョン前のリビジョン
次のリビジョン
前のリビジョン
systemd [2020/03/04 02:20] 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可能なサービスのみリストアップされる、ただし少し重い。
行 24: 行 32:
          
          
 +## systemd-resolved  
 + 
 +systemdで提供されるDNSクライアント。詳細は以下のコマンドで確認できる
 +
 +    $ systemd-resolve --status
 +
 +systemd-resolvedは名前解決用のサーバを立ち上げている。/etc/resolv.confを見ると
 +
 +```
 +nameserver 127.0.0.53
 +options edns0 trust-ad
 +search localdomain
 +```
 +
 +のようになっている。systemdで管理されているLinuxサーバ上で各アプリケーションは127.0.0.53をネームサーバとして利用できる。
 +
 +実際に使用される外部ネームサーバは`/run/systemd/resolve/resolv.conf`に書かれている。これを変更したい場合はこのファイルには触らず、[netplan](/netplan)を経由して行うとよい
 +
 ## systemd-timesyncd ## systemd-timesyncd
  
行 33: 行 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.1583288420.txt.gz · 最終更新: 2020/03/04 02:20 by nullpon