Systemd 登録

Systemd 登録

サービス起動自動起動を行うためにSystemdに設定する

/etc/systemd/system/[service_name].service

[Unit]
Description=gunicorn
After=network.target

[Service]
WorkingDirectory=[service_program_working_directory]
ExecStart=[service_execute_program_path]

[Install]
WantedBy=multi-user.target

サービス起動

$ systemctl start [service_name]

サービス再起動

$ systemctl restart [service_name]

サービス停止

$ systemctl stop [service_name]

サービス状態表示

$ systemctl status [service_name]

サービス自動起動有効

$ systemctl enable [service_name]

サービス自動起動無効

$ systemctl disable [service_name]

コメントを残す

メールアドレスが公開されることはありません。 が付いている欄は必須項目です