Failed to restart containerd.service: Unit not found [closed] - kubernetes

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 1 year ago.
Improve this question
I have installed containerd 1.5.4 by following below steps in CentOS 7.9:
wget -c https://github.com/containerd/containerd/releases/download/v1.5.4/containerd-1.5.4-linux-amd64.tar.gz
tar -zxvf containerd-1.5.4-linux-amd64.tar.gz -C /
mkdir -p /etc/containerd
containerd config default > /etc/containerd/config.toml
I have followed the docs from here and also created the config according to them. But when I try to start containerd:
[root#iZuf62lgwih3vksz3640gnZ sysctl.d]# systemctl start containerd
Failed to start containerd.service: Unit not found.
What should I do to fix this problem?

The main issue is that you are only copying binary files, you are not creating any systemd service.
Be careful when using -C / flag with the tar command. On my CentOS 7 machine, two first commands:
wget -c https://github.com/containerd/containerd/releases/download/v1.5.4/containerd-1.5.4-linux-amd64.tar.gz
tar -zxvf containerd-1.5.4-linux-amd64.tar.gz -C /
led to overwrite the /bin directory which destroyed the OS.
Back to the question, it seems like you are mixing two different instructions for installing containerd package. The instructions from official Kubernetes wiki that you mentioned in your question are pretty-forward and good to follow. Try them:
Step 1. Install the containerd.io package from the official Docker repositories:
yum install -y yum-utils
yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
yum install -y containerd.io
Step 2. Configure containerd:
sudo mkdir -p /etc/containerd
containerd config default | sudo tee /etc/containerd/config.toml
Step 3. Restart containerd:
systemctl restart containerd

Related

How to install postgresql-client to Amazon EC2 Linux machine?

I am trying to install postgresql for the meta data of hive on Amazon EC2 Linux machine.
And at that point, I am trying to connect postgresql outside docker image. Inside, I can connect the postgresql.
I tried this command:
[ec2-user#ip-****-***-** ~]$ sudo yum install postgresql-client -y
and the result:
Failed to set locale, defaulting to C
Loaded plugins: extras_suggestions, langpacks, priorities, update-motd
amzn2-core | 3.7 kB 00:00:00
No package postgresql-client available.
Error: Nothing to do
To ensure locale, I tried these ones:
[ec2-user#ip-***-***-*** ~]$ echo "$LANG"
en_US.UTF-8
[ec2-user#ip-***-***-*** ~]$ echo "$LC_CTYPE"
UTF-8
Then, I tried this one install postgresql-client lastly:
[ec2-user#ip-***-***-*** ~]$ sudo amazon-linux-extras install postgresql-client
Topic postgresql-client is not found.
I am not so familiar with these technologies, if you can help I will be so appreciated
Install postgresql package
sudo yum install postgresql
As mentioned by #Anon Coward in comments, this package contains the postgresql client. Check it with
yum search postgresql
If you get the error...
No match for argument: postgresql ...
I found that AWS Linux is a dynamic changing OS, so here is the current method + how to detect a new way to do this...
Current method (as of Oct 21, 2022)
(I have Machine Image (AMI): Amazon Linux 2022)
$ sudo yum update
$ sudo yum install postgresql13
$ psql --version
psql (PostgreSQL) 13.5
Future proof answer
Try this first ...
$ sudo yum update
$ sudo yum search "postgres"
... and look in the output for a line like this: postgresql13.aarch64 : PostgreSQL client programs. This tells you the current version of an installable client package name - in this case postgresql13. Now you know which package to install and avoid: No match for argument: postgresql error.
TLDR;
It seems, for Linux that Amazon now says to use yum directly vs. the old amazon-linux-extras here... Install software packages on an Amazon Linux instance. Then you wonder, how to know which package name to use to install it, which is here: Find software packages on an Amazon Linux instance. I used a small part of the name as a 'key' to search for: sudo yum search "postgres" which got me the answer, by looking at the output.
This currently works for my version of Amazon linux:
$ uname -a
Linux ip-0-0-0-0.ec2.internal 5.15.43-20.123.amzn2022.aarch64 #1 SMP Thu May 26 17:03:36 UTC 2022 aarch64 aarch64 aarch64 GNU/Linux
This is a new instance with almost nothing added, not even additional yum archives, YMMV.

How do I know this is not a virus?

So I want to install XMrig on the RPI, I happen to find the following article
https://dev.to/ijason/cpu-mining-on-a-raspberry-pi-1e1d
I wanted to know if anything in there is not written, I do have a pool ID and everything I just don't know if any packages contain any damaging effects to my RPI. (Reason, why I am mining, is for experimental purposes I know I won't gain much)
Submit files to Virustotal:
Virustotal website
The website search the cybersecurity community uploads and check if any of the binaries or URLs were already reported as malicious.
Also, you can use ShiftLeftScan for Python code, Github code, etc:
wget https://github.com/ShiftLeftSecurity/sast-scan/releases/download/v1.9.27/scan
chmod +x scan
sh <(curl https://slscan.sh)
sudo apt install docker.io
sudo systemctl enable --now docker
sudo usermod -aG docker USER
sudo docker run --rm -e "WORKSPACE=${PWD}" -v "$PWD:/app" shiftleft/sast-scan scan
https://github.com/ShiftLeftSecurity/sast-scan

I'm unable to install MongoDB in my Ubuntu system and I face this error while installing [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 2 years ago.
Improve this question
Unpacking mongodb-org (4.2.6) ...
Errors were encountered while processing:
/var/cache/apt/archives/mongodb-org-server_4.2.6_amd64.deb
/var/cache/apt/archives/mongodb-org-mongos_4.2.6_amd64.deb
/var/cache/apt/archives/mongodb-org-tools_4.2.6_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
First of all, I would suggest you to stop everything running on your server. Such as Nginx or Apache or node.js process...
Try to upgrade your Ubuntu instance. And try these commands.
sudo apt update
sudo apt install -y mongodb
sudo systemctl enable mongodb
sudo systemctl enable mongodb.service
sudo systemctl start mongodb

MongoDB launching on restart?

I just installed mongodb on my cloud machine following instructions here
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv EA312927
echo "deb http://repo.mongodb.org/apt/ubuntu trusty/mongodb-org/3.2 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.2.list
sudo apt-get update
sudo apt-get install -y mongodb-org
One of the problems I am facing is that, on restart of machine, mongodb is getting launched. I want to disable that operations, I want to launch mongodb manually.
I read that I have to modify /etc/init/mongod.conf file to achieve that, but I am not sure what I have to change. Could somebody please point out what I have to do?
No, the mongod is being started by the /etc/init.d/mongod script.
This is a standard *nix convention for Debian and Redhat amongst other distros.
There are a number of /etc/ directories named to indicate which run level they correspond to. As *nix boots up it changes the run level and will either start or stop processes using the scripts in the /etc/rc#.d directory.
There are some helper scripts that essentially create or remove symlinks from the /etc/init.d directory script to rc#.d directories.
This is talked about in detail here: https://unix.stackexchange.com/questions/106656/how-do-services-in-debian-work-and-how-can-i-manage-them
Needless to say this is not a programming question, but rather a system administration question better suited for the unix board or serveradmin.

Supervisor socket error issue [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 3 years ago.
Improve this question
$ supervisorctl reread
error: <class 'socket.error'>, [Errno 111] Connection refused: file: /usr/lib64/python2.6/socket.py line: 567
I'm trying to configure supervisor on my production system, but am hitting this error. The supervisor log file is empty.
When I just type supervisorctl, it complains:
http://localhost:9001 refused connection
Nothing is currently listening on port 9001, AFACT: lsof | grep TCP returns nothing.
You have to start supervisord before you can use supervisorctl. In my case:
sudo supervisord -c /etc/supervisor/supervisord.conf
sudo supervisorctl -c /etc/supervisor/supervisord.conf
If you started supervisord with a custom path, like this:
sudo supervisord -c /mypath/supervisord.conf
Then you should also start supervisorctl with the same parameter, like this:
sudo supervisorctl -c /mypath/supervisord.conf
You can get this issue if you start supervisor with a relative url for -c and then try run supervisorctl from a different directory.
For example:
supervisord -c supervisord.conf
supervisorctl start someapp ## works
cd somedirectory
supervisorctl restart someapp ## http://localhost:9001 refused connection
Solution would be to always use the absolute path. e.g.:
Good:
supervisord -c /etc/supervisor/supervisord.conf
Bad:
supervisord -c supervisord.conf
This issue also occurs when an old vesion of supervisord.conf file is used.
Newer version of supervisor uses different configuration file.
The above solutions don't work.
In this case you just have to regenerate the configuration file with
echo_supervisord_conf > /etc/supervisord.conf
Hope it helps someoone.
please do the following :
sudo service supervisor start
post which everything is normal as b4 - there is a problem with 1b version
sudo supervisorctl reload
In Ubuntu 18.04 with distribution's package
You probably did the same mistake as me an created the config file /etc/supervisord.conf while my service manager (systemd) was using the config file /etc/supervisor/supervisord.conf
sudo rm /etc/supervisord.conf
Or
sudo mv /etc/supervisord.conf /etc/supervisor/supervisord.conf
if you want to keep it
Now you can run sudo supervisorctl
Why?
when you run supervisorctl it first searches for the config file located at /etc/supervisord.conf, if it's not present, it will search for the package's default file /etc/supervisor/supervisord.conf this is the one systemd actually runs.
Systemd always use the file /etc/supervisor/supervisord.conf regardless of the other file's existence.
You can check which file is using systemd by running sudo systemctl status supervisor
You can see in the last line the command where the config file is hardcoded
both supervisord and supervisorctl use -c with absolute config file path, make sure both commands startup with same config.