Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
違いは何ですか
service apache2 restart
と
/etc/init.d/apache2 restart
では、基本的に、適切なコマンドを直接呼び出すのと比較して、サービス コマンドが推奨されるのはなぜですか?
このserviceコマンドは、予測可能な環境で init スクリプトを実行します。
service
service は、ほとんどの環境変数を削除し、現在の作業ディレクトリを / に設定して、可能な限り予測可能な環境で System V init スクリプトを実行します。
から: http://linux.die.net/man/8/service