How to set ulimit -n from a golang program? - network-programming

My purspose was to set ulimit -n from within a golang program so that I do not have to set it globally but restrict it within the program.
Found systemcalls setrlimit and get rlimit for the same. (http://linux.die.net/man/2/setrlimit)
But when I tried a sample program for the same I was getting an error saying invalid argument while setting the value.
package main
import (
"fmt"
"syscall"
)
func main() {
var rLimit syscall.Rlimit
err := syscall.Getrlimit(syscall.RLIMIT_NOFILE, &rLimit)
if err != nil {
fmt.Println("Error Getting Rlimit ", err)
}
fmt.Println(rLimit)
rLimit.Max = 999999
rLimit.Cur = 999999
err = syscall.Setrlimit(syscall.RLIMIT_NOFILE, &rLimit)
if err != nil {
fmt.Println("Error Setting Rlimit ", err)
}
err = syscall.Getrlimit(syscall.RLIMIT_NOFILE, &rLimit)
if err != nil {
fmt.Println("Error Getting Rlimit ", err)
}
fmt.Println("Rlimit Final", rLimit)
}
The output obtained was:
george#george-Not-Specified ~/work/odesk/progium/trial $ ./getRlimit
{4294963002032703 0}
Error Setting Rlimit invalid argument
Rlimit Final {4294963002032703 999999}
george#george-Not-Specified ~/work/odesk/progium/trial $ sudo ./getRlimit
[sudo] password for george:
{4294963002032703 0}
Error Setting Rlimit invalid argument
Rlimit Final {4294963002032703 999999}
george#george-Not-Specified ~/work/odesk/progium/trial $ uname -a
Linux george-Not-Specified 3.5.0-17-generic #28-Ubuntu SMP Tue Oct 9 19:32:08 UTC 2012 i686 i686 i686 GNU/Linux
george#george-Not-Specified ~/work/odesk/progium/trial $
So I was able to get the rlimit
Setting the limit failed and returned an error.
Even though it failed the MAX value got changed when I took the value again but CUR value remains the same.
Can this error be due to some issue with my kernel or is it a bad program? Where can I find more information and how to deal with an issue like this?
Update:
Works after the fix has been made.
george#george-Not-Specified ~/work/odesk/progium/trial $ go build getRlimit.go
george#george-Not-Specified ~/work/odesk/progium/trial $ ./getRlimit
{1024 4096}
Error Setting Rlimit operation not permitted
Rlimit Final {1024 4096}
george#george-Not-Specified ~/work/odesk/progium/trial $ sudo ./getRlimit
[sudo] password for george:
{1024 4096}
Rlimit Final {999999 999999}
george#george-Not-Specified ~/work/odesk/progium/trial $ uname -a
Linux george-Not-Specified 3.5.0-17-generic #28-Ubuntu SMP Tue Oct 9 19:32:08 UTC 2012 i686 i686 i686 GNU/Linux
george#george-Not-Specified ~/work/odesk/progium/trial $ go version
go version devel +7c42cfa28e24 Tue Jul 30 14:22:14 2013 +1000 linux/386

It works as expected.
setrlimit(2).
The soft limit is the value that the kernel enforces for the
corresponding resource. The hard limit acts as a ceiling for the soft
limit: an unprivileged process may only set its soft limit to a value
in the range from 0 up to the hard limit, and (irreversibly) lower its
hard limit. A privileged process (under Linux: one with the
CAP_SYS_RESOURCE capability) may make arbitrary changes to either
limit value.
rlimit.go:
package main
import (
"fmt"
"syscall"
)
func main() {
var rLimit syscall.Rlimit
err := syscall.Getrlimit(syscall.RLIMIT_NOFILE, &rLimit)
if err != nil {
fmt.Println("Error Getting Rlimit ", err)
}
fmt.Println(rLimit)
rLimit.Max = 999999
rLimit.Cur = 999999
err = syscall.Setrlimit(syscall.RLIMIT_NOFILE, &rLimit)
if err != nil {
fmt.Println("Error Setting Rlimit ", err)
}
err = syscall.Getrlimit(syscall.RLIMIT_NOFILE, &rLimit)
if err != nil {
fmt.Println("Error Getting Rlimit ", err)
}
fmt.Println("Rlimit Final", rLimit)
}
Output:
$ uname -a
Linux peterSO 3.8.0-26-generic #38-Ubuntu SMP Mon Jun 17 21:43:33 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux
$ go build rlimit.go
$ ./rlimit
{1024 4096}
Error Setting Rlimit operation not permitted
Rlimit Final {1024 4096}
$ sudo ./rlimit
[sudo] password for peterSO:
{1024 4096}
Rlimit Final {999999 999999}
UPDATE:
I successfully ran rlimit.go for linux/amd64, you failed for linux/386. There were a Go bugs in Getrlimit and Setrlimit for Linux 32-bit distributions. These bugs have been fixed.
Using the Go default branch tip (to include the bug fixes), run the following, and update your question with the results.
$ uname -a
Linux peterSO 3.8.0-26-generic #38-Ubuntu SMP Mon Jun 17 21:46:08 UTC 2013 i686 i686 i686 GNU/Linux
$ go version
go version devel +ba52f6399462 Thu Jul 25 09:56:06 2013 -0400 linux/386
$ ulimit -Sn
1024
$ ulimit -Hn
4096
$ go build rlimit.go
$ ./rlimit
{1024 4096}
Error Setting Rlimit operation not permitted
Rlimit Final {1024 4096}
$ sudo ./rlimit
[sudo] password for peterSO:
{1024 4096}
Rlimit Final {999999 999999}
$

Related

Nvidia NVML Driver/library version mismatch: dkms, modules, drivers and modinfo versions

I have the Nvidia NVML Driver/library version mismatch error, for which I recommend reading the following answers:
https://stackoverflow.com/a/67105064/1782553
https://stackoverflow.com/a/71672261/1782553
However, after purging and re-installing the nvidia packages (necessary because of the issue described here), I still get the error. A reboot resolved the issue but I'd like to understand why?
Also, I'm not sure I understand the meaning of the 4 following commands and the Nvidia version they display.
Before reboot
$ cat /sys/module/nvidia/version
515.65.01
$ cat /proc/driver/nvidia/version
NVRM version: NVIDIA UNIX x86_64 Kernel Module 515.65.01 Wed Jul 20 14:00:58 UTC 2022
GCC version: gcc version 9.4.0 (Ubuntu 9.4.0-1ubuntu1~20.04.1)
$ dkms status
nvidia, 515.65.07, 5.4.0-131-generic, x86_64: installed
$ modinfo nvidia | grep ^version
version: 515.65.07
After reboot
$ cat /sys/module/nvidia/version
515.65.07
$ cat /proc/driver/nvidia/version
NVRM version: NVIDIA UNIX x86_64 Kernel Module 515.65.07 Thu Sep 22 00:22:12 UTC 2022
GCC version: gcc version 9.4.0 (Ubuntu 9.4.0-1ubuntu1~20.04.1)
$ dkms status
nvidia, 515.65.07, 5.4.0-131-generic, x86_64: installed
$ modinfo nvidia | grep ^version
version: 515.65.07
I understand there's a difference between the loaded driver version and the driver version that will be loaded after next reboot, but I would have guessed that the modinfo version would match the cat /proc/... version, or that the dkms version would match the cat /sys/... version, but they don't…
Could someone make a brief summary of what each command is reading?

Parse error with kprobe event registration

I'm testing kprobe events on CentOS 7, kernel version 3.10.0-1160.59.1.el7.x86_64.
[root#linux2 ~]# echo 'p:qwe do_sys_openat2 filename=+0($arg2):string' > /sys/kernel/debug/tracing/kprobe_events
-bash: echo: write error: Invalid argument
[root#linux2 ~]# dmesg
[447101.144698] Parse error at argument[0]. (-22)
Does anyone know what's wrong here?

BUILD FAILED (OS X 10.15.1 using ruby-build 20191124) when installing ruby-2.4.0 with rbenv in OSX catalina(10.15.1)

I tried a lot of things from online forums. But never worked. Installed Xcode to see if it works. But it doesn't.
At first, there was an issue with the C executables at the time of the OpenSSL installation. But later, I found from here, the error occurred because of Anaconda installation. So I uninstalled anaconda and tried to install again.
But now it is throwing a different error.
➜ ~ rbenv install 2.4.0 Downloading openssl-1.1.0j.tar.gz...
-> https://dqw8nmjcqpjn7.cloudfront.net/31bec6c203ce1a8e93d5994f4ed304c63ccf07676118b6634edded12ad1b3246
Installing openssl-1.1.0j... Installed openssl-1.1.0j to
/Users/akashpinnaka/.rbenv/versions/2.4.0
Downloading ruby-2.4.0.tar.bz2...
-> https://cache.ruby-lang.org/pub/ruby/2.4/ruby-2.4.0.tar.bz2 Installing ruby-2.4.0... ruby-build: using readline from homebrew
BUILD FAILED (OS X 10.15.1 using ruby-build 20191124)
Inspect or clean up the working tree at
/var/folders/xs/gy8wglwj22g9lbhqfv9mwp7m0000gn/T/ruby-build.20191205014031.81437.0Fmlfl
Results logged to
/var/folders/xs/gy8wglwj22g9lbhqfv9mwp7m0000gn/T/ruby-build.20191205014031.81437.log
Last 10 log lines: num2int.c:64:5: note: to match this '('
sprintf(buf, "%"PRI_LL_PREFIX"u", NUM2ULL(num));
^ /usr/local/include/secure/_stdio.h:47:27: note: expanded from macro 'sprintf' builtin___sprintf_chk (str, 0, __darwin_obsz(str),
__VA_ARGS)
^ 190 warnings and 2 errors generated. make[2]: * [num2int.o] Error 1 make1: * [ext/-test-/num2int/all]
Error 2 make: *** [build-ext] Error 2
Did anyone face this problem before? Any help would be greatly appreciated.
UPDATE
Adding the last few lines in the logfile. Most of them look like errors in C lang
/usr/local/include/stdlib.h:354:36: warning: pointer is missing a nullability type specifier (_Nonnull, _Nullable, or _Null_unspecified) [-Wnullability-completeness]
strtouq(const char *__str, char **__endptr, int __base);
^
/usr/local/include/stdlib.h:354:36: note: insert '_Nullable' if the pointer may be null
strtouq(const char *__str, char **__endptr, int __base);
^
_Nullable
/usr/local/include/stdlib.h:354:36: note: insert '_Nonnull' if the pointer should never be null
strtouq(const char *__str, char **__endptr, int __base);
^
_Nonnull
/usr/local/include/stdlib.h:356:13: warning: pointer is missing a nullability type specifier (_Nonnull, _Nullable, or _Null_unspecified) [-Wnullability-completeness]
extern char *suboptarg; /* getsubopt(3) external variable */
^
/usr/local/include/stdlib.h:356:13: note: insert '_Nullable' if the pointer may be null
extern char *suboptarg; /* getsubopt(3) external variable */
^
_Nullable
/usr/local/include/stdlib.h:356:13: note: insert '_Nonnull' if the pointer should never be null
extern char *suboptarg; /* getsubopt(3) external variable */
^
_Nonnull
num2int.c:56:21: error: expected ')'
sprintf(buf, "%"PRI_LL_PREFIX"d", NUM2LL(num));
^
num2int.c:56:5: note: to match this '('
sprintf(buf, "%"PRI_LL_PREFIX"d", NUM2LL(num));
^
/usr/local/include/secure/_stdio.h:47:27: note: expanded from macro 'sprintf'
__builtin___sprintf_chk (str, 0, __darwin_obsz(str), __VA_ARGS__)
^
num2int.c:64:21: error: expected ')'
sprintf(buf, "%"PRI_LL_PREFIX"u", NUM2ULL(num));
^
num2int.c:64:5: note: to match this '('
sprintf(buf, "%"PRI_LL_PREFIX"u", NUM2ULL(num));
^
/usr/local/include/secure/_stdio.h:47:27: note: expanded from macro 'sprintf'
__builtin___sprintf_chk (str, 0, __darwin_obsz(str), __VA_ARGS__)
^
190 warnings and 2 errors generated.
make[2]: *** [num2int.o] Error 1
make[1]: *** [ext/-test-/num2int/all] Error 2
make: *** [build-ext] Error 2
Here is the pate bin for the detailed errors:
https://pastebin.com/wzLGzvC5
EDIT:
$ which clang
/usr/bin/clang
$ brew ls
adns gnutls libksba openssl ruby
autoconf icu4c libtasn1 openssl#1.1 ruby-build
automake libassuan libtool p11-kit sqlite
awk libevent libunistring pinentry unbound
coreutils libffi libusb pkg-config zlib
gettext libgcrypt libyaml postgresql
gmp libgpg-error nettle rbenv
gnupg libidn2 npth readline
$ brew doctor
Your system is ready to brew.
After I deleted the files suggested by brew doctor
Few lines from
$ ls -la /usr/local/include
total 0
drwxrwxr-x 270 akashpinnaka admin 8640 Dec 24 11:30 .
drwxr-xr-x 18 root wheel 576 Dec 5 11:15 ..
-rw-r--r-- 1 akashpinnaka admin 0 Dec 5 10:11 .keepme
lrwxr-xr-x 1 root admin 85 Dec 5 11:21 AppleTextureEncoder.h -> /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/AppleTextureEncoder.h
lrwxr-xr-x 1 root admin 78 Dec 5 11:21 AssertMacros.h -> /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/AssertMacros.h
lrwxr-xr-x 1 root admin 78 Dec 5 11:21 Availability.h -> /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/Availability.h
lrwxr-xr-x 1 root admin 86 Dec 5 11:21 AvailabilityInternal.h -> /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/AvailabilityInternal.h
lrwxr-xr-x 1 root admin 84 Dec 5 11:21 AvailabilityMacros.h -> /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/AvailabilityMacros.h
lrwxr-xr-x 1 root admin 86 Dec 5 11:21 AvailabilityVersions.h -> /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/AvailabilityVersions.h
First, let trim your log to the significant part:
num2int.c:56:21: error: expected ')'
sprintf(buf, "%"PRI_LL_PREFIX"d", NUM2LL(num));
^
num2int.c:56:5: note: to match this '('
sprintf(buf, "%"PRI_LL_PREFIX"d", NUM2LL(num));
^
/usr/local/include/secure/_stdio.h:47:27: note: expanded from macro 'sprintf'
__builtin___sprintf_chk (str, 0, __darwin_obsz(str), __VA_ARGS__)
Basically, this says that there was an error while expanding a macro to some line in file num2int.c. So, where is does that macro come from? The log says that the macro was defined in file /usr/local/include/secure/_stdio.h.
This file correspond to a locally installed package, most probably added through brew (it could also have been installed by some application installed with a package installer, but this appears less probable). I have not found yet to which package that file belongs (don't have it on my computer and havn't found any reference to it on Google), but _stdio.h files are rather exceptionnal, so I believe that it might be related to brew's private GCC. Yet, ruby-build (when executed though rb-env install) prefer to use XCode's clang compiler, which might not support some syntax extension supported by brew's GCC.
In short, you end up loading in Apple's clang some local include file that use some syntax thaat is not compatible with that compiler.
What to do now?
You must determine if the /usr/local/include/secure/ directory is actually useful. Maybe, this is related to a program that you no longer use… I can't tell you exactly what to do about this, but here are some ideas:
Check if either secure or secure/_stdio.h is a symlink (i.e.: ls -l /usr/local/include/secure/). If they have been installed by brew, they should point to somewhere under ../Cellar/<package-name>. If there are, maybe you could consider uninstalling that package…
Run brew doctor and check for "Unexpected header files".
Ideally, you want to end up deleting that directory… If you are not certain either it is a good idea, then you may consider moving it temporarilly out of the include directory, for example by doing the following:
mkdir /usr/local/include.disabled
mv /usr/local/include/secure /usr/local/include.disabled/secure
# Compile ruby
mv /usr/local/include.disabled/secure /usr/local/include/secure
rm -rf /usr/local/include.disabled
If none of this works, please post the output of the following commands to a pastebin:
which clang
brew doctor
brew ls
ls -la /usr/local/include
How to move all OSX SDK include files out of local/include
I think the following command should be enough to move all include files pointing to the OSX SDK out of the /usr/local/include directory (my uncertainty here is related to either sub-directories were themselves symlinked, or if it is the content of these subdirectories that is symlinke… I assumed the first, and this oneliner script will miss directories if they are of the second type).
mkdir -p /usr/local/include.disabled/
find /usr/local/include/ -depth 1 -lname '/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/*' -exec mv '{}' /usr/local/include.disabled/ ';'
Run these commands, then execute ls -la /usr/local/include again… There should be much less content in it. Do you still have a secure directory there?
And most importanly, can you now get through your original build?
I was facing a similar issue and can recommend the approach below that's related to binutils needing to be uninstalled first. What worked for me:
brew uninstall binutils
# Uninstalling /usr/local/Cellar/binutils/2.33.1... (134 files, 167.6MB)
rbenv install 2.6.5 && rbenv local 2.6.5 ;
# Downloading openssl-1.1.1d.tar.gz...
# -> https://dqw8nmjcqpjn7.cloudfront.net/1e3a91bc1f9dfce01af26026f856e064eab4c8ee0a8f457b5ae30b40b8b711f2
# Installing openssl-1.1.1d...
# Installed openssl-1.1.1d to /Users/auser/.rbenv/versions/2.6.5
# Downloading ruby-2.6.5.tar.bz2...
# -> https://cache.ruby-lang.org/pub/ruby/2.6/ruby-2.6.5.tar.bz2
# Installing ruby-2.6.5...
# ruby-build: using readline from homebrew
# Installed ruby-2.6.5 to /Users/auser/.rbenv/versions/2.6.5
Prior to this the I was also getting a number of varying messages in ruby-build.log - with the last being:
# ld: symbol(s) not found for architecture x86_64
A number of other steps that I took as part of my homebrew stepup (prior to uninstall) included:
brew install perl ruby rbenv
# // UPDATE PATHs with suggestions made by brew during install
which awk perl
# /usr/local/bin/awk
# /usr/local/bin/perl
# ^^^ IN SHORT ALL PATHs should be with /usr/local/opt OR /usr/local/bin
You can re-install binutils again after as needed and remember to repeat the uninstallation with any future rbenv install version(s) that you're likely to re-execute (note to self).
PS - tested on macOS Catalina 10.15.3 (19D76) successfully installing both 2.4.0 & 2.6.5
Can you try to run these commands:
brew unlink gawk
brew reinstall awk
awk
before running rbenv install 2.4.0

install docker-ce on redhat 8

I try to install docker-ce on redhat 8 but it failed
first, I try
# systemctl enable docker
Failed to enable unit: Unit file docker.service does not exist.
So, I want to install docker-ce for the daemon
# yum install yum-utils
# yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
# yum repolist -v
# yum list docker-ce --showduplicates | sort -r
# yum install docker-ce
but in this step, I have got this :
# yum install docker-ce
Updating Subscription Management repositories.
Unable to read consumer identity
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
Last metadata expiration check: 0:02:58 ago on Fri 26 Jul 2019 02:11:48 PM UTC.
Error:
Problem: package docker-ce-3:19.03.1-3.el7.x86_64 requires containerd.io >= 1.2.2-3, but none of the providers can be installed
- cannot install the best candidate for the job
- package containerd.io-1.2.2-3.3.el7.x86_64 is excluded
- package containerd.io-1.2.2-3.el7.x86_64 is excluded
- package containerd.io-1.2.4-3.1.el7.x86_64 is excluded
- package containerd.io-1.2.5-3.1.el7.x86_64 is excluded
- package containerd.io-1.2.6-3.3.el7.x86_64 is excluded
(try to add '--skip-broken' to skip uninstallable packages or '--nobest' to use not only best candidate packages)
I create a redhat account, but I have got this problem :
# subscription-manager register --force
Registering to: subscription.rhsm.redhat.com:443/subscription
Username: xxxxxxxxxxx
Password:
The system has been registered with ID: 6c07b574-2601-4a84-90d4-a9dfdc499c2f
The registered system name is: ip-172-31-11-95.us-east-2.compute.internal
Traceback (most recent call last):
File "/usr/lib/python3.6/site-packages/dnf/repo.py", line 566, in load
ret = self._repo.load()
File "/usr/lib64/python3.6/site-packages/libdnf/repo.py", line 503, in load
return _repo.Repo_load(self)
RuntimeError: Failed to synchronize cache for repo 'rhui-client-config-server-8'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/lib64/python3.6/site-packages/subscription_manager/cache.py", line 173, in update_check
self._sync_with_server(uep, consumer_uuid)
File "/usr/lib64/python3.6/site-packages/subscription_manager/cache.py", line 477, in _sync_with_server
combined_profile = self.current_profile
File "/usr/lib64/python3.6/site-packages/subscription_manager/cache.py", line 430, in current_profile
module_profile = get_profile('modulemd').collect()
File "/usr/lib64/python3.6/site-packages/rhsm/profile.py", line 347, in get_profile
profile = PROFILE_MAP[profile_type]()
File "/usr/lib64/python3.6/site-packages/rhsm/profile.py", line 54, in __init__
self.content = self.__generate()
File "/usr/lib64/python3.6/site-packages/rhsm/profile.py", line 76, in __generate
base.fill_sack()
File "/usr/lib/python3.6/site-packages/dnf/base.py", line 400, in fill_sack
self._add_repo_to_sack(r)
File "/usr/lib/python3.6/site-packages/dnf/base.py", line 135, in _add_repo_to_sack
repo.load()
File "/usr/lib/python3.6/site-packages/dnf/repo.py", line 568, in load
raise dnf.exceptions.RepoError(str(e))
dnf.exceptions.RepoError: Failed to synchronize cache for repo 'rhui-client-config-server-8'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/sbin/subscription-manager", line 11, in <module>
load_entry_point('subscription-manager==1.23.8', 'console_scripts', 'subscription-manager')()
File "/usr/lib64/python3.6/site-packages/subscription_manager/scripts/subscription_manager.py", line 85, in main
return managercli.ManagerCLI().main()
File "/usr/lib64/python3.6/site-packages/subscription_manager/managercli.py", line 2918, in main
ret = CLI.main(self)
File "/usr/lib64/python3.6/site-packages/subscription_manager/cli.py", line 183, in main
return cmd.main()
File "/usr/lib64/python3.6/site-packages/subscription_manager/managercli.py", line 506, in main
return_code = self._do_command()
File "/usr/lib64/python3.6/site-packages/subscription_manager/managercli.py", line 1368, in _do_command
profile_mgr.update_check(self.cp, consumer['uuid'], True)
File "/usr/lib64/python3.6/site-packages/subscription_manager/cache.py", line 457, in update_check
return CacheManager.update_check(self, uep, consumer_uuid, force)
File "/usr/lib64/python3.6/site-packages/subscription_manager/cache.py", line 183, in update_check
raise Exception(_("Error updating system data on the server, see /var/log/rhsm/rhsm.log "
Exception: Error updating system data on the server, see /var/log/rhsm/rhsm.log for more details.
Disabling the container-tools module (installed by default) resolves the conflict: dnf module disable container-tools
However, you first need to install the container-selinux dependency, which is provided by the same module:
[root#centos8-2gb-hel1-1 ~]# yum install container-selinux
...
[root#centos8-2gb-hel1-1 ~]# yum module disable container-tools
Last metadata expiration check: 0:05:02 ago on Mon Feb 10 16:31:17 2020.
Dependencies resolved.
======================================================================================================================
Package Architecture Version Repository Size
======================================================================================================================
Disabling modules:
container-tools
Transaction Summary
======================================================================================================================
Is this ok [y/N]: y
Complete!
The docker-ce package can now be installed normally with the previously installed container-selinux version and the new containerd.io depdency:
[root#centos8-2gb-hel1-1 ~]# yum install docker-ce
Last metadata expiration check: 0:06:26 ago on Mon Feb 10 16:31:17 2020.
Dependencies resolved.
======================================================================================================================
Package Arch Version Repository Size
======================================================================================================================
Installing:
docker-ce x86_64 3:19.03.5-3.el7 docker-ce-stable 24 M
Installing dependencies:
libcgroup x86_64 0.41-19.el8 BaseOS 70 k
tar x86_64 2:1.30-4.el8 BaseOS 838 k
containerd.io x86_64 1.2.10-3.2.el7 docker-ce-stable 23 M
docker-ce-cli x86_64 1:19.03.5-3.el7 docker-ce-stable 39 M
Transaction Summary
======================================================================================================================
Install 5 Packages
Total download size: 108 M
Is this ok [y/N]:
RHEL/CentOS 8 excluding the containerd.io package is related to the runc provide conflicting with the runc package from the container-tools module: https://bugzilla.redhat.com/show_bug.cgi?id=1756473
[root#centos8-2gb-hel1-1 ~]# yum provides runc
Last metadata expiration check: 0:07:21 ago on Mon Feb 10 16:31:17 2020.
...
containerd.io-1.2.10-3.2.el7.x86_64 : An industry-standard container runtime
Repo : docker-ce-stable
Matched from:
Provide : runc
runc-1.0.0-60.rc8.module_el8.1.0+237+63e26edc.x86_64 : CLI for running Open Containers
Repo : AppStream
Matched from:
Provide : runc = 1.0.0-60.rc8.module_el8.1.0+237+63e26edc
yum install docker-ce --no-best worked for me
( Installed: docker-ce-3:18.09.1-3.el7.x86_64 and Skipped: docker-ce-3:19.03.1-3.el7.x86_64)
There is a dependency issue in Centos 8 which references the containerd from Centos 7.
Just install the containerd package manually, and it will work
yum install -y https://download.docker.com/linux/centos/7/x86_64/stable/Packages/containerd.io-1.2.10-3.2.el7.x86_64.rpm
My guess, due to a missing subscription you cannot download packages from repositories the docker-ce package needs. So first register for a development account with redhat, then subscribe your host using the subscription Manager (remember, no production usage allowed then) and then retry the installation.
Edit: Here are the subscription commands
subscription-manager register --username <yourname> --password <pw>
subscription-manager role --set="Red Hat Enterprise Linux Server"
subscription-manager service-level --set="Self-Support"
subscription-manager usage --set="Development/Test"
subscription-manager attach
Edit: sorry i answered too fast. Just tried on a new rhel8. docker-ce-18.06.3.ce-3.el7 is the most current Version for rhel 8 and installs fine

Error while trying to enter sleep mode in Beagle Bone Black

While trying to enter sleep mode on beaglebone black am getting an error
When i issue the command echo -n "mem" > /sys/power/state am getting
-sh: echo: write error: No such device
The kernel version and os version is as below
root#beaglebone:~# uname -a
Linux beaglebone 3.8.13 #1 SMP Wed Sep 4 09:09:32 CEST 2013 armv7l GNU/Linux
root#beaglebone:~# lsb_release -a
Distributor ID: Angstrom
Description: Angstrom GNU/Linux v2012.12 (Core edition)
Release: v2012.12
Codename: Core edition
I was just trying to do the same thing and got the same error. Looks like the 3.8.13 kernel doesn't support suspend/sleep mode. In the link below they mention only 3.12 or higher supports that feature. (Note if you upgrade beyond 3.8.13 all the capemgr stuff works completely differently than on 3.8.13. I tried 3.18.1 and couldn't get any capes to work.)
Bug report for sleep mode

Resources