11
serviceコマンドは、直接、適切なコマンドを呼び出すに比べて推奨される理由linuxでserviceコマンドを使う理由は?
service apache2 restart
と
/etc/init.d/apache2 restart
の違いはしたがって、基本的には何ですか?
serviceコマンドは、直接、適切なコマンドを呼び出すに比べて推奨される理由linuxでserviceコマンドを使う理由は?
service apache2 restart
と
/etc/init.d/apache2 restart
の違いはしたがって、基本的には何ですか?
service
コマンドは、予測可能な環境でのinitスクリプトを実行します:
サービスは、ほとんどの環境変数を削除し、できるだけ予測可能な環境で、System Vのinitスクリプトを実行し、/に設定された現在の作業ディレクトリで。
それはあなたの実際のLinuxディストリビューションに依存しますが、一部には、両方のと同じ効果を有することができます。 –
これは、プログラミング上の問題ではないので、http://superuser.com/またはhttp://serverfault.com/またはhttp://unix.stackexchange.com/によく似ています。 – Jonik
あなたがUbuntuを使用している場合、質問はここで答えられます:http://askubuntu.com/questions/2075/whats-the-difference-between-service-and-etc-init-dこれもサーバフォールト:http ://serverfault.com/questions/85621/to-restart-a-service-eg-httpd-should-i-use-etc-init-d-httpd-restart-or-sbi – Jonik