実現したいこと
既に起動しているサービスを再び立ち上げようとした場合、どこかのログに記録が行われるのかそれとも行われないかが知りたいのです。
発生している問題・エラーメッセージ
# systemctl start サービス名
のように、なにかしらサービスを立ち上げようとした時に、そのサービスがすでに立ち上がっていた(startしていた)場合、「すでにそのサービスは起動しています」といったようなログがどこかに残るのか知りたくご質問させていただきました。
エラーメッセージが表示されるのかされないのかがわからない状況のため、もし表示されるならどこに表示されるのかが知りたいです。
よろしくお願いいたします。
環境はCentOS7でございます。
【解決、動作確認がとれたため追記】
以下、「journalctl -f」にて初回起動時ともう一度起動しようとしたときのログの比較です。
2つのどちらも「systemctl start httpd」にてApacheを起動しようとしたときに発生したログとなります。
1.Apacheの初回起動のとき
19月 17 18:37:57 localhost.localdomain polkitd[576]: Registered Authentication Agent for unix-process:3406:107318 (system bus name :1.157 [/usr/bin/pkttyagent --notify-fd 5 --fallback], object path /org/freedesktop/PolicyKit1/AuthenticationAgent, locale ja_JP.UTF-8) 2 9月 17 18:37:59 localhost.localdomain polkitd[576]: Operator of unix-process:3406:107318 successfully authenticated as unix-user:hoshino to gain ONE-SHOT authorization for action org.freedesktop.systemd1.manage-units for system-bus-name::1.158 [systemctl start httpd] (owned by unix-user:hoshino) 3 9月 17 18:37:59 localhost.localdomain systemd[1]: Starting The Apache HTTP Server... 4 9月 17 18:37:59 localhost.localdomain httpd[3426]: AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using localhost.localdomain. Set the 'ServerName' directive globally to suppress this message 5 9月 17 18:37:59 localhost.localdomain systemd[1]: Started The Apache HTTP Server. 6 9月 17 18:37:59 localhost.localdomain polkitd[576]: Unregistered Authentication Agent for unix-process:3406:107318 (system bus name :1.157, object path /org/freedesktop/PolicyKit1/AuthenticationAgent, locale ja_JP.UTF-8) (disconnected from bus)
2.Apacheをもう一度起動しようとしたとき
19月 17 18:38:41 localhost.localdomain polkitd[576]: Registered Authentication Agent for unix-process:3449:111806 (system bus name :1.161 [/usr/bin/pkttyagent --notify-fd 5 --fallback], object path /org/freedesktop/PolicyKit1/AuthenticationAgent, locale ja_JP.UTF-8) 2 9月 17 18:38:47 localhost.localdomain polkitd[576]: Operator of unix-process:3449:111806 successfully authenticated as unix-user:hoshino to gain ONE-SHOT authorization for action org.freedesktop.systemd1.manage-units for system-bus-name::1.162 [systemctl start httpd] (owned by unix-user:hoshino) 3 9月 17 18:38:47 localhost.localdomain polkitd[576]: Unregistered Authentication Agent for unix-process:3449:111806 (system bus name :1.161, object path /org/freedesktop/PolicyKit1/AuthenticationAgent, locale ja_JP.UTF-8) (disconnected from bus)
上記の2つのログを比較しますと、差分は以下のようになりました。
1と2の差分
19月 17 18:37:59 localhost.localdomain systemd[1]: Starting The Apache HTTP Server... 29月 17 18:37:59 localhost.localdomain httpd[3426]: AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using localhost.localdomain. Set the 'ServerName' directive globally to suppress this message 39月 17 18:37:59 localhost.localdomain systemd[1]: Started The Apache HTTP Server.
「AH00558」のServerNameを設定してください、といったエラーが出てはおりますが、初回起動時のみ「 Starting The Apache HTTP Server...」と「Started The Apache HTTP Server.」がログに残る様子が確認できました。すでに起動済の場合にもう一度起動しようとした時にはこちらのログが残りませんでしたので、二重起動はしないということが確認できました。
既に起動しているサービスを起動しようとした時にもう一度サービスを起動しようとしても、「そのサービスは既に起動しています」といったエラーが発生することはないようですが、二重起動しようとした場合サービスの開始を示すメッセージが出なくなったとわかっただけで十分です。ありがとうございました!

回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2022/09/16 00:03
2022/09/18 02:12