centos6
sudo service [서비스명] start
centos6, 7
sudo systemctl start [서비스명].service
아래에서 알 수 있듯, service와 systemctl은 다음과 같은점에서 다르다.
service는 서비스 명령을 직접 실행하는 상위 커맨드이다. 하지만 centos7에 있는 systemctl은 service커맨드를 리디렉트 해주는 커맨드이다.
sudo systemctl enable redis
chkconfig on
https://serverfault.com/questions/867322/what-is-the-difference-between-service-and-systemctl
What is the difference between service and systemctl?
aybe this is a trivial question, but it is not totally clear to me. On one of our servers we have some background processes running which were started with
service
and some others which were started withsystemctl
, like this:$ service nginx start $ systemctl start gunicorn
What is the difference between the two commands? Which one is the preferred way to deal with background services? How to configure the preferred command?
service
is an "high-level" command used for starting and stopping services in different unixes and linuxes. Depending on the "lower-level" service manager,service
redirects on different binaries.For example, on CentOS 7 it redirects to
systemctl
, while on CentOS 6 it directly called the relative/etc/init.d
script. On the other hand, in older Ubuntu releases it redirects toupstart
service
is adequate for basic service management, while directly callingsystemctl
give greater control options.
'Server > Linux' 카테고리의 다른 글
bashrc / bash_profile 설정 파일들의 위치는? (0) | 2019.08.13 |
---|---|
centos7에서 nodejs, npm, redis, myslq 인스톨하기, 서비스가동하기, 재부팅후 자동가동하기 (0) | 2019.03.17 |
centos6에서 jenkins인스톨 (0) | 2018.11.30 |
IP명과 호스트 명을 이어주는 /etc/hosts 파일 (0) | 2018.11.20 |
rhef,fedora,centos구분하기,centos과 redhat관련성 (0) | 2018.11.08 |