Page 1 of 2

cockpit install

Posted: 2020/02/13 21:32:03
by lightman47
On my CentOS 8 machines, cockpit is installed by default and works. Liking the quick overview it provides, I've installed it on a couple CentOS 7 machines having found it in the repos. Despite ENABLEing both cockpit and cockpit-motd services on, and rebooting these machines, I have no access until I SSH into the machine and manually START one of those services. Then I am good to go.

What have I missed with the setup?

Thank you.

Re: cockpit install

Posted: 2020/02/14 18:07:05
by aks
So the service(s) don't start at boot? Why not? Perhaps status and/or journalctl will give you a hint.

Re: cockpit install

Posted: 2020/02/14 18:52:10
by lightman47
despite multiple ENABLEs, and even subsequent STARTs, the next reboot:

Code: Select all

# systemctl status -l cockpit
● cockpit.service - Cockpit Web Service
   Loaded: loaded (/usr/lib/systemd/system/cockpit.service; static; vendor preset: disabled)
   Active: inactive (dead)
     Docs: man:cockpit-ws(8)

Code: Select all

# journalctl _SYSTEMD_UNIT=cockpit.service
-- No entries --

Code: Select all

 
# man:cockpit-ws(8)
-bash: syntax error near unexpected token `8'

Code: Select all

man cockpit-ws(8)
-bash: syntax error near unexpected token `('

Re: cockpit install

Posted: 2020/02/15 16:36:57
by lightman47
More investigation reveals there is no cockpit.target.wants (or anything like that) in /etc/systemd/system. Indeed, when I systemctl enable cockpit, I never got the normal message about the link being copied. Instead, nothing!


Hmmm

Re: cockpit install

Posted: 2020/02/15 17:22:33
by MartinR
I do see

Code: Select all

ls /etc/systemd/system/sockets.target.wants
avahi-daemon.socket  cups.socket      iscsid.socket    multipathd.socket  spice-vdagentd.socket  virtlockd.socket
cockpit.socket       dm-event.socket  iscsiuio.socket  rpcbind.socket     sssd-kcm.socket        virtlogd.socket
However cockpit is only started on demand:

Code: Select all

# systemctl status cockpit
● cockpit.service - Cockpit Web Service
   Loaded: loaded (/usr/lib/systemd/system/cockpit.service; static; vendor preset: disabled)
   Active: inactive (dead)
     Docs: man:cockpit-ws(8)
Point my browser at cockpit

Code: Select all

# systemctl status cockpit
● cockpit.service - Cockpit Web Service
   Loaded: loaded (/usr/lib/systemd/system/cockpit.service; static; vendor preset: disabled)
   Active: active (running) since Sat 2020-02-15 17:14:25 GMT; 8s ago
     Docs: man:cockpit-ws(8)
  Process: 5666 ExecStartPre=/usr/sbin/remotectl certificate --ensure --user=root --group=cockpit-ws --selinux-type=etc_t (code=exited, status=0/S>
 Main PID: 5668 (cockpit-ws)
    Tasks: 3 (limit: 25007)
   Memory: 3.6M
   CGroup: /system.slice/cockpit.service
           └─5668 /usr/libexec/cockpit-ws
Log in

Code: Select all

# systemctl status cockpit
● cockpit.service - Cockpit Web Service
   Loaded: loaded (/usr/lib/systemd/system/cockpit.service; static; vendor preset: disabled)
   Active: active (running) since Sat 2020-02-15 17:14:25 GMT; 45s ago
     Docs: man:cockpit-ws(8)
  Process: 5666 ExecStartPre=/usr/sbin/remotectl certificate --ensure --user=root --group=cockpit-ws --selinux-type=etc_t (code=exited, status=0/S>
 Main PID: 5668 (cockpit-ws)
    Tasks: 4 (limit: 25007)
   Memory: 9.4M
   CGroup: /system.slice/cockpit.service
           ├─5668 /usr/libexec/cockpit-ws
           └─5691 /usr/bin/ssh-agent

Feb 15 17:14:24 CentOS8.home systemd[1]: Starting Cockpit Web Service...
Feb 15 17:14:25 CentOS8.home systemd[1]: Started Cockpit Web Service.
Feb 15 17:14:25 CentOS8.home cockpit-ws[5668]: Using certificate: /etc/cockpit/ws-certs.d/0-self-signed.cert
Feb 15 17:15:01 CentOS8.home cockpit-session[5686]: pam_ssh_add: Identity added: /home/****/.ssh/id_rsa (/home/****/.ssh/id_rsa)
Feb 15 17:15:01 CentOS8.home cockpit-session[5686]: pam_ssh_add: Identity added: /home/****/.ssh/id_dsa (/home/****/.ssh/id_dsa)
Feb 15 17:15:01 CentOS8.home cockpit-session[5686]: pam_unix(cockpit:session): session opened for user **** by (uid=0)
Feb 15 17:15:02 CentOS8.home cockpit-ws[5668]: logged in user session
Feb 15 17:15:03 CentOS8.home cockpit-ws[5668]: New connection to session from 192.168.X.Y

Re: cockpit install

Posted: 2020/02/15 17:29:24
by lightman47
Oh, then it's likely me who's 'messed-up'. I installed it assuming it would always be available, as is the case in CentOS 8. I'll probably have to manually create a start service for it on my C7 machines.

Thank you!

EDIT: Corrected 'tar service' to 'start service'.

Re: cockpit install

Posted: 2020/02/15 17:54:32
by MartinR
Oops, my mistake. I've only come across cockpit on C8 and so the examples were all from a C8 VM. If you're running the server on C7 it may be different. Sorry for the noise.

Re: cockpit install

Posted: 2020/02/15 18:00:24
by lightman47
No problem - input is useful! Currently I'm poking around my C8 machine to see how they're starting it. If it's a simple service file somewhere, and I can merely copy (or copy/edit a little) it then life is good.

;)

Interestingly, it would appear that the "locate" command, or some components thereof, are now gone in C8. Example: # locate cockpit*.*
locate: can not stat () `/var/lib/mlocate/mlocate.db': No such file or directory

Re: cockpit install

Posted: 2020/02/15 18:17:15
by lightman47
According to the man page, cockpit-ws is the 'listener'. It is installed.

Code: Select all

Package cockpit-ws-195.1-1.el7.centos.0.1.x86_64 already installed and latest version

Code: Select all

systemctl enable cockpit-ws
Failed to execute operation: No such file or directory
I am missing something basic methinks.

Re: cockpit install

Posted: 2020/02/15 18:22:23
by TrevorH
systemctl list-unit-files | grep cockpit ?