cockpit 设置端口;设置多端口监听;

最近需要更改cockpit 服务端口,具体步骤如下:

mkdir -p /etc/systemd/system/cockpit.socket.d/
touch 
/etc/systemd/system/cockpit.socket.d/listen.conf 
vim /etc/systemd/system/cockpit.socket.d/listen.conf

在listen.conf 文件中,输入:

[Socket]
ListenStream=9090
ListenStream=7777

重启服务,生效配置:

sudo systemctl daemon-reload
sudo systemctl restart cockpit.socket
sudo systemctl restart cockpit.service

防火墙自行配置;

SELinux自行配置;

参考链接:

https://cockpit-project.org/guide/133/listen.html 

更新-2020年6月19日:/usr/lib/systemd/system/cockpit.socket; 文件中也有端口信息,我们需要根据需求进行修改:

[Unit]
Description=Cockpit Web Service Socket
Documentation=man:cockpit-ws(8)
Wants=cockpit-motd.service

[Socket]
ListenStream=9000
ExecStartPost=-/usr/share/cockpit/motd/update-motd '' localhost
ExecStartPost=-/bin/ln -snf active.motd /run/cockpit/motd
ExecStopPost=-/bin/ln -snf /usr/share/cockpit/motd/inactive.motd /run/cockpit/motd

[Install]
WantedBy=sockets.target

保持更新,转载请注明出处;更多内容请关注cnblogs.com/xuyaowen;

posted @ 2020-04-26 15:52  "Michael_Xu"  阅读(2671)  评论(0编辑  收藏  举报