Linux系统管理
![image.png](http://www.icode9.com/i/li/?n=2&i=images/20210702/1625236639785506.png?,size_14,text_QDUxQ1RP5Y2a5a6i,color_FFFFFF,t_100,g_se,x_10,y_10,shadow_20,type_ZmFuZ3poZW5naGVpdGk=)
#### 1.Linux下的系统进程
##### 1.1 init进程的职责
![image.png](http://www.icode9.com/i/li/?n=2&i=images/20210702/1625236649931355.png?,size_14,text_QDUxQ1RP5Y2a5a6i,color_FFFFFF,t_100,g_se,x_10,y_10,shadow_20,type_ZmFuZ3poZW5naGVpdGk=)
![image.png](http://www.icode9.com/i/li/?n=2&i=images/20210702/1625236658928970.png?,size_14,text_QDUxQ1RP5Y2a5a6i,color_FFFFFF,t_100,g_se,x_10,y_10,shadow_20,type_ZmFuZ3poZW5naGVpdGk=)
Systemd命令比较常用
##### 2.Systemd
![image.png](http://www.icode9.com/i/li/?n=2&i=images/20210702/1625236701198618.png?,size_14,text_QDUxQ1RP5Y2a5a6i,color_FFFFFF,t_100,g_se,x_10,y_10,shadow_20,type_ZmFuZ3poZW5naGVpdGk=)
systemctl status 服务名 查看服务的当前状态
![image.png](http://www.icode9.com/i/li/?n=2&i=images/20210702/1625236725761146.png?,size_14,text_QDUxQ1RP5Y2a5a6i,color_FFFFFF,t_100,g_se,x_10,y_10,shadow_20,type_ZmFuZ3poZW5naGVpdGk=)
![image.png](http://www.icode9.com/i/li/?n=2&i=images/20210702/1625236739103406.png?,size_14,text_QDUxQ1RP5Y2a5a6i,color_FFFFFF,t_100,g_se,x_10,y_10,shadow_20,type_ZmFuZ3poZW5naGVpdGk=)
![image.png](http://www.icode9.com/i/li/?n=2&i=images/20210702/1625236754495161.png?,size_14,text_QDUxQ1RP5Y2a5a6i,color_FFFFFF,t_100,g_se,x_10,y_10,shadow_20,type_ZmFuZ3poZW5naGVpdGk=)
1.查看sshd.service里的内容
![image.png](http://www.icode9.com/i/li/?n=2&i=images/20210702/1625236769893851.png?,size_14,text_QDUxQ1RP5Y2a5a6i,color_FFFFFF,t_100,g_se,x_10,y_10,shadow_20,type_ZmFuZ3poZW5naGVpdGk=)
2.写一个alibaba.service
[Unit]
Description=Write Something
Wants=network-online.target
After=network.target
[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=touch /tmp/testfile
ExecStop=rm -f /tmp/testfile
[Install]
WantedBy=multi-user.target
![image.png](http://www.icode9.com/i/li/?n=2&i=images/20210702/1625236784905408.png?,size_14,text_QDUxQ1RP5Y2a5a6i,color_FFFFFF,t_100,g_se,x_10,y_10,shadow_20,type_ZmFuZ3poZW5naGVpdGk=)
3.crontab定时任务
![image.png](http://www.icode9.com/i/li/?n=2&i=images/20210702/1625236802776066.png?,size_14,text_QDUxQ1RP5Y2a5a6i,color_FFFFFF,t_100,g_se,x_10,y_10,shadow_20,type_ZmFuZ3poZW5naGVpdGk=)
1.查看当前日程表
![image.png](http://www.icode9.com/i/li/?n=2&i=images/20210702/1625236813785350.png?,size_14,text_QDUxQ1RP5Y2a5a6i,color_FFFFFF,t_100,g_se,x_10,y_10,shadow_20,type_ZmFuZ3poZW5naGVpdGk=)
2.编辑一个日程表
![image.png](http://www.icode9.com/i/li/?n=2&i=images/20210702/1625236826538388.png?,size_14,text_QDUxQ1RP5Y2a5a6i,color_FFFFFF,t_100,g_se,x_10,y_10,shadow_20,type_ZmFuZ3poZW5naGVpdGk=)
![image.png](http://www.icode9.com/i/li/?n=2&i=images/20210702/1625236835994908.png?,size_14,text_QDUxQ1RP5Y2a5a6i,color_FFFFFF,t_100,g_se,x_10,y_10,shadow_20,type_ZmFuZ3poZW5naGVpdGk=)
4.Supervisor
![image.png](http://www.icode9.com/i/li/?n=2&i=images/20210702/1625236852734904.png?,size_14,text_QDUxQ1RP5Y2a5a6i,color_FFFFFF,t_100,g_se,x_10,y_10,shadow_20,type_ZmFuZ3poZW5naGVpdGk=)
![image.png](http://www.icode9.com/i/li/?n=2&i=images/20210702/1625236865573994.png?,size_14,text_QDUxQ1RP5Y2a5a6i,color_FFFFFF,t_100,g_se,x_10,y_10,shadow_20,type_ZmFuZ3poZW5naGVpdGk=)