centos7 查看启动ntp服务命令

1. 查看ntp服务命令:

systemctl status ntpd

 

 

 可以看到状态为:inactive,也就是没有启动ntp服务

2. 启动ntp服务命令并查看状态:

systemctl start ntpd

  

systemctl status ntpd

  

 

可以看到此时ntp状态为active,也就是成功启动了ntp服务

3. 设置开启自启动ntp服务:

systemctl enable ntpd

  

posted @ 2020-10-22 11:00  散落人间  阅读(2390)  评论(0编辑  收藏  举报
interface food{} class A implements food{} class B implements food{} class C implements food{} public class StaticFactory { private StaticFactory(){} public static food getA(){ return new A(); } public static food getB(){ return new B(); } public static food getC(){ return new C(); } } class Client{ //客户端代码只需要将相应的参数传入即可得到对象 //用户不需要了解工厂类内部的逻辑。 public void get(String name){ food x = null ; if ( name.equals("A")) { x = StaticFactory.getA(); }else if ( name.equals("B")){ x = StaticFactory.getB(); }else { x = StaticFactory.getC(); } } }