cockpit-project / cockpit

Cockpit is a web-based graphical interface for servers.
http://www.cockpit-project.org/
GNU Lesser General Public License v2.1
11.23k stars 1.11k forks source link

does not change the port #17960

Closed maravento closed 1 year ago

maravento commented 1 year ago

Explain what happens

Ubuntu 22.04 install: sudo apt install cockpit

  1. edit socket
nano /usr/lib/systemd/system/cockpit.socket

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

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

[Install]
WantedBy=sockets.target

run command:

sudo systemctl stop cockpit
sudo systemctl start cockpit.socket
sudo systemctl daemon-reload
sudo systemctl start cockpit

status:

sudo systemctl status cockpit
 cockpit.service - Cockpit Web Service
     Loaded: loaded (/lib/systemd/system/cockpit.service; static)
     Active: active (running) since Mon 2022-11-28 18:45:32 -05; 7s ago
TriggeredBy: ● cockpit.socket
       Docs: man:cockpit-ws(8)
    Process: 1551094 ExecStartPre=/usr/lib/cockpit/cockpit-certificate-ensure --for-cockpit-tls (code=exited, status=0/SUCCESS)
   Main PID: 1551095 (cockpit-tls)
      Tasks: 1 (limit: 38218)
     Memory: 744.0K
        CPU: 108ms
     CGroup: /system.slice/cockpit.service
             └─1551095 /usr/lib/cockpit/cockpit-tls

nov 28 18:45:32 mst systemd[1]: Starting Cockpit Web Service...
nov 28 18:45:32 mst systemd[1]: Started Cockpit Web Service.

journalctl:

journalctl -u cockpit
nov 28 18:45:32 mst systemd[1]: Starting Cockpit Web Service...
nov 28 18:45:32 mst systemd[1]: Started Cockpit Web Service.
nov 28 18:46:21 mst cockpit-tls[1551095]: cockpit-tls: gnutls_handshake failed: A TLS fatal alert has been received.
nov 28 18:46:22 mst cockpit-tls[1551095]: cockpit-tls: gnutls_handshake failed: A TLS fatal alert has been received.
nov 28 18:46:22 mst cockpit-tls[1551095]: cockpit-tls: gnutls_handshake failed: A TLS fatal alert has been received.
nov 28 18:48:52 mst systemd[1]: cockpit.service: Deactivated successfully.

curl 9090 (9191 the same result):

curl -k -v https://localhost:9090
*   Trying 127.0.0.1:9090...
* connect to 127.0.0.1 port 9090 failed: Conexión rehusada
*   Trying ::1:9090...
* connect to ::1 port 9090 failed: Conexión rehusada
* Failed to connect to localhost port 9090 after 81 ms: Conexión rehusada
* Closing connection 0
curl: (7) Failed to connect to localhost port 9090 after 81 ms: Conexión rehusada

did not change the port 9191 and remains on the 9090:

Captura de pantalla -2022-11-28 19-00-48

How do i change the cockpit port and not die trying?

Version of Cockpit

no idea

Where is the problem in Cockpit?

Unknown or not applicable

Server operating system

No response

Server operating system version

ubuntu 22.04.1 lts x64

What browsers are you using?

Chrome

System log

No response

maravento commented 1 year ago

sorry, the answer is here: https://cockpit-project.org/guide/latest/listen

but there are still many errors

cockpit-tls: gnutls_handshake failed: A TLS fatal alert has been received and cockpit-certificate-ensure[1425230]: /usr/lib/cockpit/cockpit-certificate-helper: line 32: sscg: command not found

I have reported this here https://github.com/cockpit-project/cockpit/issues/14896#issuecomment-1330674567