Page 1 of 1

The command on CentOS 7

Posted: 2019/06/20 01:03:16
by truyencuoi
Can I use CentOS 6 commands on CentOS 7?
For example:

Code: Select all

service nginx restart

Re: The command on CentOS 7

Posted: 2019/06/20 06:24:08
by jlehtone
Some of the "old commands" are mere wrappers for "new commands", but I would not rely on that.

Code: Select all

# service nginx status
Redirecting to /bin/systemctl status nginx.service
...
Your example, nginx, is in EPEL repository and the version for el7 has been configured to be a systemd service. Therefore, the "native" command is:

Code: Select all

# systemctl restart nginx
The upstream (RHEL-7) has extensive documentation. Use it. If you are not in a hurry, then focus on RHEL-8 for CentOS 8 is within feasible(*) future.

(*) Assessment ignores likelihood of global warming killing all humans.