question_id
int64 82.3k
79.7M
| title_clean
stringlengths 15
158
| body_clean
stringlengths 62
28.5k
| full_text
stringlengths 95
28.5k
| tags
stringlengths 4
80
| score
int64 0
1.15k
| view_count
int64 22
1.62M
| answer_count
int64 0
30
| link
stringlengths 58
125
|
|---|---|---|---|---|---|---|---|---|
82,256
|
How do I use sudo to redirect output to a location I don't have permission to write to?
|
I've been given sudo access on one of our development RedHat linux boxes, and I seem to find myself quite often needing to redirect output to a location I don't normally have write access to. The trouble is, this contrived example doesn't work: sudo ls -hal /root/ > /root/test.out I just receive the response: -bash: /root/test.out: Permission denied How can I get this to work?
|
How do I use sudo to redirect output to a location I don't have permission to write to? I've been given sudo access on one of our development RedHat linux boxes, and I seem to find myself quite often needing to redirect output to a location I don't normally have write access to. The trouble is, this contrived example doesn't work: sudo ls -hal /root/ > /root/test.out I just receive the response: -bash: /root/test.out: Permission denied How can I get this to work?
|
linux, bash, permissions, sudo, io-redirection
| 1,150
| 366,401
| 15
|
https://stackoverflow.com/questions/82256/how-do-i-use-sudo-to-redirect-output-to-a-location-i-dont-have-permission-to-wr
|
257,844
|
Quickly create a large file on a Linux system
|
How can I quickly create a large file on a Linux ( Red Hat Linux ) system? dd will do the job, but reading from /dev/zero and writing to the drive can take a long time when you need a file several hundreds of GBs in size for testing... If you need to do that repeatedly, the time really adds up. I don't care about the contents of the file, I just want it to be created quickly. How can this be done? Using a sparse file won't work for this. I need the file to be allocated disk space.
|
Quickly create a large file on a Linux system How can I quickly create a large file on a Linux ( Red Hat Linux ) system? dd will do the job, but reading from /dev/zero and writing to the drive can take a long time when you need a file several hundreds of GBs in size for testing... If you need to do that repeatedly, the time really adds up. I don't care about the contents of the file, I just want it to be created quickly. How can this be done? Using a sparse file won't work for this. I need the file to be allocated disk space.
|
linux, file, filesystems
| 626
| 714,203
| 17
|
https://stackoverflow.com/questions/257844/quickly-create-a-large-file-on-a-linux-system
|
104,055
|
How can I list the contents of a package using YUM?
|
I know how to use rpm to list the contents of a package ( rpm -qpil package.rpm ). However, this requires knowing the location of the .rpm file on the filesystem. A more elegant solution would be to use the package manager, which in my case is YUM . How can YUM be used to achieve this?
|
How can I list the contents of a package using YUM? I know how to use rpm to list the contents of a package ( rpm -qpil package.rpm ). However, this requires knowing the location of the .rpm file on the filesystem. A more elegant solution would be to use the package manager, which in my case is YUM . How can YUM be used to achieve this?
|
linux, fedora, rpm, yum, package-managers
| 363
| 432,616
| 7
|
https://stackoverflow.com/questions/104055/how-can-i-list-the-contents-of-a-package-using-yum
|
19,943,766
|
Hadoop "Unable to load native-hadoop library for your platform" warning
|
I'm currently configuring hadoop on a server running CentOs . When I run start-dfs.sh or stop-dfs.sh , I get the following error: WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable I'm running Hadoop 2.2.0. Doing a search online brought up this link: [URL] However, the contents of /native/ directory on hadoop 2.x appear to be different so I am not sure what to do. I've also added these two environment variables in hadoop-env.sh : export HADOOP_OPTS="$HADOOP_OPTS -Djava.library.path=/usr/local/hadoop/lib/" export HADOOP_COMMON_LIB_NATIVE_DIR="/usr/local/hadoop/lib/native/" Any ideas?
|
Hadoop "Unable to load native-hadoop library for your platform" warning I'm currently configuring hadoop on a server running CentOs . When I run start-dfs.sh or stop-dfs.sh , I get the following error: WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable I'm running Hadoop 2.2.0. Doing a search online brought up this link: [URL] However, the contents of /native/ directory on hadoop 2.x appear to be different so I am not sure what to do. I've also added these two environment variables in hadoop-env.sh : export HADOOP_OPTS="$HADOOP_OPTS -Djava.library.path=/usr/local/hadoop/lib/" export HADOOP_COMMON_LIB_NATIVE_DIR="/usr/local/hadoop/lib/native/" Any ideas?
|
java, linux, hadoop, hadoop2, java.library.path
| 323
| 652,094
| 24
|
https://stackoverflow.com/questions/19943766/hadoop-unable-to-load-native-hadoop-library-for-your-platform-warning
|
37,585,758
|
How to redirect output of systemd service to a file
|
I am trying to redirect output of a systemd service to a file but it doesn't seem to work: [Unit] Description=customprocess After=network.target [Service] Type=forking ExecStart=/usr/local/bin/binary1 agent -config-dir /etc/sample.d/server StandardOutput=/var/log1.log StandardError=/var/log2.log Restart=always [Install] WantedBy=multi-user.target Please correct my approach.
|
How to redirect output of systemd service to a file I am trying to redirect output of a systemd service to a file but it doesn't seem to work: [Unit] Description=customprocess After=network.target [Service] Type=forking ExecStart=/usr/local/bin/binary1 agent -config-dir /etc/sample.d/server StandardOutput=/var/log1.log StandardError=/var/log2.log Restart=always [Install] WantedBy=multi-user.target Please correct my approach.
|
linux, centos7, systemd, rhel, rhel7
| 312
| 425,010
| 10
|
https://stackoverflow.com/questions/37585758/how-to-redirect-output-of-systemd-service-to-a-file
|
24,641,536
|
How to set JAVA_HOME in Linux for all users
|
I am new to Linux system and there seem to be too many Java folders. java -version gives me: java version "1.7.0_55" OpenJDK Runtime Environment (rhel-2.4.7.1.el6_5-x86_64 u55-b13) OpenJDK 64-Bit Server VM (build 24.51-b03, mixed mode) When I am trying to build a Maven project , I am getting error: Error: JAVA_HOME is not defined correctly. We cannot execute /usr/java/jdk1.7.0_05/bin/java Could you please tell me which files I need to modify for root as well as not-root user and where exactly is java located?
|
How to set JAVA_HOME in Linux for all users I am new to Linux system and there seem to be too many Java folders. java -version gives me: java version "1.7.0_55" OpenJDK Runtime Environment (rhel-2.4.7.1.el6_5-x86_64 u55-b13) OpenJDK 64-Bit Server VM (build 24.51-b03, mixed mode) When I am trying to build a Maven project , I am getting error: Error: JAVA_HOME is not defined correctly. We cannot execute /usr/java/jdk1.7.0_05/bin/java Could you please tell me which files I need to modify for root as well as not-root user and where exactly is java located?
|
java, linux, java-home, path-variables
| 311
| 1,623,560
| 25
|
https://stackoverflow.com/questions/24641536/how-to-set-java-home-in-linux-for-all-users
|
22,101,778
|
How to preserve line breaks when storing command output to a variable?
|
I’m using bash shell on Linux. I have this simple script … #!/bin/bash TEMP=sed -n '/'"Starting deployment of"'/,/'"Failed to start context"'/p' "/usr/java/jboss/standalone/log/server.log" | tac | awk '/'"Starting deployment of"'/ {print;exit} 1' | tac echo $TEMP However, when I run this script ./temp.sh all the output is printed without the carriage returns/new lines. Not sure if its the way I’m storing the output to $TEMP, or the echo command itself. How do I store the output of the command to a variable and preserve the line breaks/carriage returns?
|
How to preserve line breaks when storing command output to a variable? I’m using bash shell on Linux. I have this simple script … #!/bin/bash TEMP=sed -n '/'"Starting deployment of"'/,/'"Failed to start context"'/p' "/usr/java/jboss/standalone/log/server.log" | tac | awk '/'"Starting deployment of"'/ {print;exit} 1' | tac echo $TEMP However, when I run this script ./temp.sh all the output is printed without the carriage returns/new lines. Not sure if its the way I’m storing the output to $TEMP, or the echo command itself. How do I store the output of the command to a variable and preserve the line breaks/carriage returns?
|
linux, bash, shell, line-breaks
| 306
| 162,004
| 2
|
https://stackoverflow.com/questions/22101778/how-to-preserve-line-breaks-when-storing-command-output-to-a-variable
|
16,200,501
|
How can I automatically redirect HTTP to HTTPS on Apache servers?
|
I am trying to set up automatic redirection from HTTP to HTTPS: From manage.mydomain.com --- To ---> [URL] I have tried adding the following to my httpd.conf file, but it didn't work: RewriteEngine on ReWriteCond %{SERVER_PORT} !^443$ RewriteRule ^/(.*) [URL] [NC,R,L] How can I fix it? Environment: CentOS with Apache
|
How can I automatically redirect HTTP to HTTPS on Apache servers? I am trying to set up automatic redirection from HTTP to HTTPS: From manage.mydomain.com --- To ---> [URL] I have tried adding the following to my httpd.conf file, but it didn't work: RewriteEngine on ReWriteCond %{SERVER_PORT} !^443$ RewriteRule ^/(.*) [URL] [NC,R,L] How can I fix it? Environment: CentOS with Apache
|
linux, apache, .htaccess, webserver, httpd.conf
| 281
| 593,657
| 13
|
https://stackoverflow.com/questions/16200501/how-can-i-automatically-redirect-http-to-https-on-apache-servers
|
15,622,328
|
How to grep a string in a directory and all its subdirectories?
|
How to grep a string or a text in a directory and all its subdirectories'files in LINUX ??
|
How to grep a string in a directory and all its subdirectories? How to grep a string or a text in a directory and all its subdirectories'files in LINUX ??
|
linux, unix, grep, centos
| 273
| 696,165
| 2
|
https://stackoverflow.com/questions/15622328/how-to-grep-a-string-in-a-directory-and-all-its-subdirectories
|
21,820,715
|
How to install latest version of git on CentOS 8.x/7.x/6.x
|
I used the usual: yum install git It did not install the latest version of git on my CentOS 6. How can I update to the latest version of git for CentOS 6? The solution can be applicable to newer versions of CentOS such as CentOS 7.
|
How to install latest version of git on CentOS 8.x/7.x/6.x I used the usual: yum install git It did not install the latest version of git on my CentOS 6. How can I update to the latest version of git for CentOS 6? The solution can be applicable to newer versions of CentOS such as CentOS 7.
|
linux, git, installation, centos, yum
| 269
| 279,683
| 15
|
https://stackoverflow.com/questions/21820715/how-to-install-latest-version-of-git-on-centos-8-x-7-x-6-x
|
2,150,882
|
How to automatically add user account AND password with a Bash script?
|
I need to have the ability to create user accounts on my Linux (Fedora 10) and automatically assign a password via a bash script(or otherwise, if need be). It's easy to create the user via Bash e.g.: [whoever@server ]# /usr/sbin/useradd newuser Is it possible to assign a password in Bash, something functionally similar to this, but automatically: [whoever@server ]# passwd newuser Changing password for user testpass. New UNIX password: Retype new UNIX password: passwd: all authentication tokens updated successfully. [whoever@server ]#
|
How to automatically add user account AND password with a Bash script? I need to have the ability to create user accounts on my Linux (Fedora 10) and automatically assign a password via a bash script(or otherwise, if need be). It's easy to create the user via Bash e.g.: [whoever@server ]# /usr/sbin/useradd newuser Is it possible to assign a password in Bash, something functionally similar to this, but automatically: [whoever@server ]# passwd newuser Changing password for user testpass. New UNIX password: Retype new UNIX password: passwd: all authentication tokens updated successfully. [whoever@server ]#
|
linux, bash, passwd
| 247
| 505,730
| 20
|
https://stackoverflow.com/questions/2150882/how-to-automatically-add-user-account-and-password-with-a-bash-script
|
15,255,070
|
How do you scroll up/down on the console of a Linux VM
|
I recognize that Up / Down will give you the command history. But, how do you look at past output by scrolling up and down? I have used Shift + Page Up / Page Down , Alt + Shift + Up / Down and Page Up / Page Down but none of these seem to work. It is a Redhat Linux box.
|
How do you scroll up/down on the console of a Linux VM I recognize that Up / Down will give you the command history. But, how do you look at past output by scrolling up and down? I have used Shift + Page Up / Page Down , Alt + Shift + Up / Down and Page Up / Page Down but none of these seem to work. It is a Redhat Linux box.
|
linux, terminal, rhel
| 241
| 562,880
| 15
|
https://stackoverflow.com/questions/15255070/how-do-you-scroll-up-down-on-the-console-of-a-linux-vm
|
7,142,735
|
How to specify more spaces for the delimiter using cut?
|
Is there a way to specify multiple spaces as a field delimiter with the cut command (something like a " "+ regex)? For example, what field delimiter I should specify for the following string to reach value 3744 ? $ps axu | grep jboss jboss 2574 0.0 0.0 3744 1092 ? S Aug17 0:00 /bin/sh /usr/java/jboss/bin/run.sh -c example.com -b 0.0.0.0 cut -d' ' is not what I want, because it's only for a single space. awk is not what I am looking for either, so how to do this with cut ?
|
How to specify more spaces for the delimiter using cut? Is there a way to specify multiple spaces as a field delimiter with the cut command (something like a " "+ regex)? For example, what field delimiter I should specify for the following string to reach value 3744 ? $ps axu | grep jboss jboss 2574 0.0 0.0 3744 1092 ? S Aug17 0:00 /bin/sh /usr/java/jboss/bin/run.sh -c example.com -b 0.0.0.0 cut -d' ' is not what I want, because it's only for a single space. awk is not what I am looking for either, so how to do this with cut ?
|
linux, delimiter, cut
| 233
| 172,685
| 13
|
https://stackoverflow.com/questions/7142735/how-to-specify-more-spaces-for-the-delimiter-using-cut
|
13,046,624
|
How can I permanently export a variable in Linux?
|
I am running RHEL 6, and I have exported an environment variable like this: export DISPLAY=:0 That variable is lost when the terminal is closed. How do I permanently add this so that this variable value always exists with a particular user?
|
How can I permanently export a variable in Linux? I am running RHEL 6, and I have exported an environment variable like this: export DISPLAY=:0 That variable is lost when the terminal is closed. How do I permanently add this so that this variable value always exists with a particular user?
|
linux, environment-variables, redhat
| 232
| 420,201
| 6
|
https://stackoverflow.com/questions/13046624/how-can-i-permanently-export-a-variable-in-linux
|
12,952,913
|
How do I install g++ for Fedora?
|
How do I install g++ for Fedora Linux? I have been searching the dnf command to install g++ but didn't find anything. How do I install it? I have already installed gcc
|
How do I install g++ for Fedora? How do I install g++ for Fedora Linux? I have been searching the dnf command to install g++ but didn't find anything. How do I install it? I have already installed gcc
|
c++, linux, g++, fedora, dnf
| 218
| 227,423
| 11
|
https://stackoverflow.com/questions/12952913/how-do-i-install-g-for-fedora
|
1,157,209
|
Is there an alternative sleep function in C to milliseconds?
|
I have some source code that was compiled on Windows. I am converting it to run on Red Hat Linux. The source code has included the <windows.h> header file and the programmer has used the Sleep() function to wait for a period of milliseconds. This won't work on the Linux. However, I can use the sleep(seconds) function, but that uses integer in seconds. I don't want to convert milliseconds to seconds. Is there a alternative sleep function that I can use with gcc compiling on Linux?
|
Is there an alternative sleep function in C to milliseconds? I have some source code that was compiled on Windows. I am converting it to run on Red Hat Linux. The source code has included the <windows.h> header file and the programmer has used the Sleep() function to wait for a period of milliseconds. This won't work on the Linux. However, I can use the sleep(seconds) function, but that uses integer in seconds. I don't want to convert milliseconds to seconds. Is there a alternative sleep function that I can use with gcc compiling on Linux?
|
c, linux, sleep
| 217
| 504,403
| 6
|
https://stackoverflow.com/questions/1157209/is-there-an-alternative-sleep-function-in-c-to-milliseconds
|
14,460,656
|
Android Debug Bridge (adb) device - no permissions
|
I have a problem connecting HTC Wildfire A3333 in debugging mode with my Fedora Linux 17. Adb says: ./adb devices List of devices attached ???????????? no permissions my udev rules (first rule for Samsung which works just fine and second for HTC which is not): SUBSYSTEM=="usb",SYSFS{idVendor}=="04e8",SYMLINK+="android_adb",MODE="0666",GROUP="plugdev" SUBSYSTEM=="usb",SYSFS{idVendor}=="0bb4",SYMLINK+="android_adb",MODE="0666",GROUP="plugdev" For Samsung devices everything's okay: ./adb devices List of devices attached 00198a9422618e device I have been trying all of the answers given in a simmilar thread wthout any luck: Using HTC wildfire for android development
|
Android Debug Bridge (adb) device - no permissions I have a problem connecting HTC Wildfire A3333 in debugging mode with my Fedora Linux 17. Adb says: ./adb devices List of devices attached ???????????? no permissions my udev rules (first rule for Samsung which works just fine and second for HTC which is not): SUBSYSTEM=="usb",SYSFS{idVendor}=="04e8",SYMLINK+="android_adb",MODE="0666",GROUP="plugdev" SUBSYSTEM=="usb",SYSFS{idVendor}=="0bb4",SYMLINK+="android_adb",MODE="0666",GROUP="plugdev" For Samsung devices everything's okay: ./adb devices List of devices attached 00198a9422618e device I have been trying all of the answers given in a simmilar thread wthout any luck: Using HTC wildfire for android development
|
android, linux, debugging, adb
| 196
| 199,480
| 20
|
https://stackoverflow.com/questions/14460656/android-debug-bridge-adb-device-no-permissions
|
9,541,460
|
httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName
|
I tried to restart my Apache server on CentOS 5.0 and got this message: httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName Here is the /etc/hosts file: 127.0.0.1 server4-245 server4-245.com localhost.localdomain localhost ::1 localhost6.localdomain6 localhost6 Here is the /etc/sysconfig/network file: NETWORKING=yes NETWORKING_IPV6=no HOSTNAME=server4-245 I also have this in the Apache httpd.conf file: ServerName localhost However, I still get the first error message when I restart Apache.
|
httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName I tried to restart my Apache server on CentOS 5.0 and got this message: httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName Here is the /etc/hosts file: 127.0.0.1 server4-245 server4-245.com localhost.localdomain localhost ::1 localhost6.localdomain6 localhost6 Here is the /etc/sysconfig/network file: NETWORKING=yes NETWORKING_IPV6=no HOSTNAME=server4-245 I also have this in the Apache httpd.conf file: ServerName localhost However, I still get the first error message when I restart Apache.
|
linux, apache, centos
| 189
| 540,858
| 12
|
https://stackoverflow.com/questions/9541460/httpd-could-not-reliably-determine-the-servers-fully-qualified-domain-name-us
|
1,766,380
|
Determining the path that a yum package installed to
|
I've installed ffmpeg using yum under Redhat, and I'm having difficulty figuring out where (what path) it installed the package to. Is there an easy way of determining this without resorting to finding it myself manually?
|
Determining the path that a yum package installed to I've installed ffmpeg using yum under Redhat, and I'm having difficulty figuring out where (what path) it installed the package to. Is there an easy way of determining this without resorting to finding it myself manually?
|
linux, redhat, rpm, yum
| 189
| 164,991
| 3
|
https://stackoverflow.com/questions/1766380/determining-the-path-that-a-yum-package-installed-to
|
8,328,250
|
CentOS 64 bit bad ELF interpreter
|
I have just installed CentOS 6 64bit version, I'm trying to install a 32-bit application on a 64-bit machine and got this error: /lib/ld-linux.so.2: bad ELF interpreter: No such file or directory How do I resolve this?
|
CentOS 64 bit bad ELF interpreter I have just installed CentOS 6 64bit version, I'm trying to install a 32-bit application on a 64-bit machine and got this error: /lib/ld-linux.so.2: bad ELF interpreter: No such file or directory How do I resolve this?
|
linux, centos, 32bit-64bit, elf, centos6
| 186
| 389,863
| 9
|
https://stackoverflow.com/questions/8328250/centos-64-bit-bad-elf-interpreter
|
13,876,875
|
How to make rpm auto install dependencies
|
I have built two RPM packages proj1-1.0-1.x86_64.rpm libtest1-1.0-1.x86_64.rpm proj1 depends on the file libtest1.so being present and it is reflected correctly in the RPM packages as seen here: user@my-pc:~$ rpm -qp --requires proj1-1.0-1.x86_64.rpm libtest1.so()(64bit) user@my-pc:~$ rpm -qp --provides libtest1-1.0-1.x86_64.rpm libtest1.so()(64bit) The installation of proj1 fails due to a missing dependency. user@my-pc:~$ rpm -ivh proj1-1.0-1.x86_64.rpm error: Failed dependencies: libtest1.so()(64bit) is needed by proj1-1.0-1.x86_64.rpm How do I ensure that libtest1-1.0-1.x86_64.rpm is installed automatically during the installation of proj1-1.0-1.x86_64.rpm ? I did try the --aid option with rpm -i as described here but it didn't work for me. Is there any other way? Thanks for any help.
|
How to make rpm auto install dependencies I have built two RPM packages proj1-1.0-1.x86_64.rpm libtest1-1.0-1.x86_64.rpm proj1 depends on the file libtest1.so being present and it is reflected correctly in the RPM packages as seen here: user@my-pc:~$ rpm -qp --requires proj1-1.0-1.x86_64.rpm libtest1.so()(64bit) user@my-pc:~$ rpm -qp --provides libtest1-1.0-1.x86_64.rpm libtest1.so()(64bit) The installation of proj1 fails due to a missing dependency. user@my-pc:~$ rpm -ivh proj1-1.0-1.x86_64.rpm error: Failed dependencies: libtest1.so()(64bit) is needed by proj1-1.0-1.x86_64.rpm How do I ensure that libtest1-1.0-1.x86_64.rpm is installed automatically during the installation of proj1-1.0-1.x86_64.rpm ? I did try the --aid option with rpm -i as described here but it didn't work for me. Is there any other way? Thanks for any help.
|
linux, installation, package, rpm, yum
| 174
| 656,457
| 12
|
https://stackoverflow.com/questions/13876875/how-to-make-rpm-auto-install-dependencies
|
17,850,787
|
Where is the php.ini file on a Linux/CentOS PC?
|
I can't find PHP.ini location on my server. I've checked all Stack Overflow answers but I can't find my php.ini location. I have Linux, Cent OS, zPanel. Last version of PHP. My computer: Linux Mint 15 KDE.
|
Where is the php.ini file on a Linux/CentOS PC? I can't find PHP.ini location on my server. I've checked all Stack Overflow answers but I can't find my php.ini location. I have Linux, Cent OS, zPanel. Last version of PHP. My computer: Linux Mint 15 KDE.
|
php, linux, centos
| 164
| 547,728
| 5
|
https://stackoverflow.com/questions/17850787/where-is-the-php-ini-file-on-a-linux-centos-pc
|
27,733,511
|
How to set Linux environment variables with Ansible
|
Hi I am trying to find out how to set environment variable with Ansible. something that a simple shell command like this: EXPORT LC_ALL=C tried as shell command and got an error tried using the environment module and nothing happend. what am I missing
|
How to set Linux environment variables with Ansible Hi I am trying to find out how to set environment variable with Ansible. something that a simple shell command like this: EXPORT LC_ALL=C tried as shell command and got an error tried using the environment module and nothing happend. what am I missing
|
linux, ansible
| 164
| 338,170
| 7
|
https://stackoverflow.com/questions/27733511/how-to-set-linux-environment-variables-with-ansible
|
540,603
|
How can I find the version of the Fedora I use?
|
sudo find /etc | xargs grep -i fedora > searchFedora gives: /etc/netplug.d/netplug: # At least on Fedora Core 1 ... But see the Fedora version in the /etc/netplug.d/netplug file. Is it serious?
|
How can I find the version of the Fedora I use? sudo find /etc | xargs grep -i fedora > searchFedora gives: /etc/netplug.d/netplug: # At least on Fedora Core 1 ... But see the Fedora version in the /etc/netplug.d/netplug file. Is it serious?
|
linux, fedora
| 161
| 349,808
| 14
|
https://stackoverflow.com/questions/540603/how-can-i-find-the-version-of-the-fedora-i-use
|
20,348,007
|
How can I find out the total physical memory (RAM) of my Linux box suitable to be parsed by a shell script?
|
I'm creating a shell script to find out the total physical memory in some RHEL Linux boxes. First of all I want to stress that I'm interested in the total physical memory recognized by the kernel, not just the available memory . Therefore, please, avoid answers suggesting to read /proc/meminfo or to use the free , top or sar commands -- In all these cases, their " total memory " values mean " available memory " ones. The first thought was to read the boot kernel messages: Memory: 61861540k/63438844k available (2577k kernel code, 1042516k reserved, 1305k data, 212k init) But in some Linux boxes, due to the use of EMC2's PowerPath software and its flooding boot messages in the kernel startup, that useful boot kernel message is not available, not even in the /var/log/dmesg file. The second option was the dmidecode command (I'm warned against the possible mismatch of kernel recognized RAM and real RAM due to the limitations of some older kernels and architectures). The option --memory simplifies the script but I realized that older releases of that command have no --memory option. My last chance was the getconf command. It reports the memory page size, but not the total number of physical pages -- the _PHYS_PAGES system variable seems to be the available physical pages, not the total physical pages. # getconf -a | grep PAGES PAGESIZE 4096 _AVPHYS_PAGES 1049978 _PHYS_PAGES 15466409 My question: Is there another way to get the total amount of physical memory, suitable to be parsed by a shell script?
|
How can I find out the total physical memory (RAM) of my Linux box suitable to be parsed by a shell script? I'm creating a shell script to find out the total physical memory in some RHEL Linux boxes. First of all I want to stress that I'm interested in the total physical memory recognized by the kernel, not just the available memory . Therefore, please, avoid answers suggesting to read /proc/meminfo or to use the free , top or sar commands -- In all these cases, their " total memory " values mean " available memory " ones. The first thought was to read the boot kernel messages: Memory: 61861540k/63438844k available (2577k kernel code, 1042516k reserved, 1305k data, 212k init) But in some Linux boxes, due to the use of EMC2's PowerPath software and its flooding boot messages in the kernel startup, that useful boot kernel message is not available, not even in the /var/log/dmesg file. The second option was the dmidecode command (I'm warned against the possible mismatch of kernel recognized RAM and real RAM due to the limitations of some older kernels and architectures). The option --memory simplifies the script but I realized that older releases of that command have no --memory option. My last chance was the getconf command. It reports the memory page size, but not the total number of physical pages -- the _PHYS_PAGES system variable seems to be the available physical pages, not the total physical pages. # getconf -a | grep PAGES PAGESIZE 4096 _AVPHYS_PAGES 1049978 _PHYS_PAGES 15466409 My question: Is there another way to get the total amount of physical memory, suitable to be parsed by a shell script?
|
linux, ram, memory-size
| 147
| 349,220
| 15
|
https://stackoverflow.com/questions/20348007/how-can-i-find-out-the-total-physical-memory-ram-of-my-linux-box-suitable-to-b
|
394,984
|
Best practice to run Linux service as a different user
|
Services default to starting as root at boot time on my RHEL box. If I recall correctly, the same is true for other Linux distros which use the init scripts in /etc/init.d . What do you think is the best way to instead have the processes run as a (static) user of my choosing? The only method I'd arrived at was to use something like: su my_user -c 'daemon my_cmd &>/dev/null &' But this seems a bit untidy... Is there some bit of magic tucked away that provides an easy mechanism to automatically start services as other, non-root users? EDIT: I should have said that the processes I'm starting in this instance are either Python scripts or Java programs. I'd rather not write a native wrapper around them, so unfortunately I'm unable to call setuid() as Black suggests.
|
Best practice to run Linux service as a different user Services default to starting as root at boot time on my RHEL box. If I recall correctly, the same is true for other Linux distros which use the init scripts in /etc/init.d . What do you think is the best way to instead have the processes run as a (static) user of my choosing? The only method I'd arrived at was to use something like: su my_user -c 'daemon my_cmd &>/dev/null &' But this seems a bit untidy... Is there some bit of magic tucked away that provides an easy mechanism to automatically start services as other, non-root users? EDIT: I should have said that the processes I'm starting in this instance are either Python scripts or Java programs. I'd rather not write a native wrapper around them, so unfortunately I'm unable to call setuid() as Black suggests.
|
linux, system-administration, rhel, init.d
| 142
| 266,305
| 8
|
https://stackoverflow.com/questions/394984/best-practice-to-run-linux-service-as-a-different-user
|
19,256,127
|
Two versions of python on linux. how to make 2.7 the default
|
I've got two versions of python on my linuxbox: $python Python 2.6.6 (r266:84292, Jul 10 2013, 22:48:45) [GCC 4.4.7 20120313 (Red Hat 4.4.7-3)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> $ /usr/local/bin/python2.7 Python 2.7.3 (default, Oct 8 2013, 15:53:09) [GCC 4.4.7 20120313 (Red Hat 4.4.7-3)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> $ which python /usr/bin/python $ ls -al /usr/bin/python -rwxr-xr-x. 2 root root 4864 Jul 10 22:49 /usr/bin/python How can I make 2.7 be the default version so when I type python it puts me in 2.7?
|
Two versions of python on linux. how to make 2.7 the default I've got two versions of python on my linuxbox: $python Python 2.6.6 (r266:84292, Jul 10 2013, 22:48:45) [GCC 4.4.7 20120313 (Red Hat 4.4.7-3)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> $ /usr/local/bin/python2.7 Python 2.7.3 (default, Oct 8 2013, 15:53:09) [GCC 4.4.7 20120313 (Red Hat 4.4.7-3)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> $ which python /usr/bin/python $ ls -al /usr/bin/python -rwxr-xr-x. 2 root root 4864 Jul 10 22:49 /usr/bin/python How can I make 2.7 be the default version so when I type python it puts me in 2.7?
|
python, linux, centos
| 136
| 478,643
| 8
|
https://stackoverflow.com/questions/19256127/two-versions-of-python-on-linux-how-to-make-2-7-the-default
|
43,235,179
|
How to execute ssh-keygen without prompt
|
I want to automate generate a pair of ssh key using shell script on Centos7, and I have tried yes "y" | ssh-keygen -t rsa echo "\n\n\n" | ssh-keygen... echo | ssh-keygen.. all of these command doesn't work, just input one 'enter' and the shell script stopped on "Enter passphrase (empty for no passphrase)", I just want to know how to simulate mutiple 'enter' in shell continuously. Many thanks if anyone can help !
|
How to execute ssh-keygen without prompt I want to automate generate a pair of ssh key using shell script on Centos7, and I have tried yes "y" | ssh-keygen -t rsa echo "\n\n\n" | ssh-keygen... echo | ssh-keygen.. all of these command doesn't work, just input one 'enter' and the shell script stopped on "Enter passphrase (empty for no passphrase)", I just want to know how to simulate mutiple 'enter' in shell continuously. Many thanks if anyone can help !
|
linux, bash, shell, ssh
| 135
| 125,582
| 9
|
https://stackoverflow.com/questions/43235179/how-to-execute-ssh-keygen-without-prompt
|
1,367,373
|
Python subprocess.Popen "OSError: [Errno 12] Cannot allocate memory"
|
Note: This question was originally asked here but the bounty time expired even though an acceptable answer was not actually found. I am re-asking this question including all details provided in the original question. A python script is running a set of class functions every 60 seconds using the sched module: # sc is a sched.scheduler instance sc.enter(60, 1, self.doChecks, (sc, False)) The script is running as a daemonised process using the code here . A number of class methods that are called as part of doChecks use the subprocess module to call system functions in order to get system statistics: ps = subprocess.Popen(['ps', 'aux'], stdout=subprocess.PIPE).communicate()[0] This runs fine for a period of time before the entire script crashing with the following error: File "/home/admin/sd-agent/checks.py", line 436, in getProcesses File "/usr/lib/python2.4/subprocess.py", line 533, in __init__ File "/usr/lib/python2.4/subprocess.py", line 835, in _get_handles OSError: [Errno 12] Cannot allocate memory The output of free -m on the server once the script has crashed is: $ free -m total used free shared buffers cached Mem: 894 345 549 0 0 0 -/+ buffers/cache: 345 549 Swap: 0 0 0 The server is running CentOS 5.3. I am unable to reproduce on my own CentOS boxes nor with any other user reporting the same problem. I have tried a number of things to debug this as suggested in the original question: Logging the output of free -m before and after the Popen call. There is no significant change in memory usage i.e. memory is not gradually being used up as the script runs. I added close_fds=True to the Popen call but this made no difference - the script still crashed with the same error. Suggested here and here . I checked the rlimits which showed (-1, -1) on both RLIMIT_DATA and RLIMIT_AS as suggested here . An article suggested the having no swap space might be the cause but swap is actually available on demand (according to the web host) and this was also suggested as a bogus cause here . The processes are being closed because that is the behaviour of using .communicate() as backed up by the Python source code and comments here . The entire checks can be found at on GitHub here with the getProcesses function defined from line 442. This is called by doChecks() starting at line 520. The script was run with strace with the following output before the crash: recv(4, "Total Accesses: 516662\nTotal kBy"..., 234, 0) = 234 gettimeofday({1250893252, 887805}, NULL) = 0 write(3, "2009-08-21 17:20:52,887 - checks"..., 91) = 91 gettimeofday({1250893252, 888362}, NULL) = 0 write(3, "2009-08-21 17:20:52,888 - checks"..., 74) = 74 gettimeofday({1250893252, 888897}, NULL) = 0 write(3, "2009-08-21 17:20:52,888 - checks"..., 67) = 67 gettimeofday({1250893252, 889184}, NULL) = 0 write(3, "2009-08-21 17:20:52,889 - checks"..., 81) = 81 close(4) = 0 gettimeofday({1250893252, 889591}, NULL) = 0 write(3, "2009-08-21 17:20:52,889 - checks"..., 63) = 63 pipe([4, 5]) = 0 pipe([6, 7]) = 0 fcntl64(7, F_GETFD) = 0 fcntl64(7, F_SETFD, FD_CLOEXEC) = 0 clone(child_stack=0, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0xb7f12708) = -1 ENOMEM (Cannot allocate memory) write(2, "Traceback (most recent call last"..., 35) = 35 open("/usr/bin/sd-agent/agent.py", O_RDONLY|O_LARGEFILE) = -1 ENOMEM (Cannot allocate memory) open("/usr/bin/sd-agent/agent.py", O_RDONLY|O_LARGEFILE) = -1 ENOMEM (Cannot allocate memory) open("/usr/lib/python24.zip/agent.py", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory) open("/usr/lib/python2.4/agent.py", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory) open("/usr/lib/python2.4/plat-linux2/agent.py", O_RDONLY|O_LARGEFILE) = -1 ENOMEM (Cannot allocate memory) open("/usr/lib/python2.4/lib-tk/agent.py", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory) open("/usr/lib/python2.4/lib-dynload/agent.py", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory) open("/usr/lib/python2.4/site-packages/agent.py", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory) write(2, " File \"/usr/bin/sd-agent/agent."..., 52) = 52 open("/home/admin/sd-agent/daemon.py", O_RDONLY|O_LARGEFILE) = -1 ENOMEM (Cannot allocate memory) open("/usr/bin/sd-agent/daemon.py", O_RDONLY|O_LARGEFILE) = -1 ENOMEM (Cannot allocate memory) open("/usr/lib/python24.zip/daemon.py", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory) open("/usr/lib/python2.4/daemon.py", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory) open("/usr/lib/python2.4/plat-linux2/daemon.py", O_RDONLY|O_LARGEFILE) = -1 ENOMEM (Cannot allocate memory) open("/usr/lib/python2.4/lib-tk/daemon.py", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory) open("/usr/lib/python2.4/lib-dynload/daemon.py", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory) open("/usr/lib/python2.4/site-packages/daemon.py", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory) write(2, " File \"/home/admin/sd-agent/dae"..., 60) = 60 open("/usr/bin/sd-agent/agent.py", O_RDONLY|O_LARGEFILE) = -1 ENOMEM (Cannot allocate memory) open("/usr/bin/sd-agent/agent.py", O_RDONLY|O_LARGEFILE) = -1 ENOMEM (Cannot allocate memory) open("/usr/lib/python24.zip/agent.py", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory) open("/usr/lib/python2.4/agent.py", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory) open("/usr/lib/python2.4/plat-linux2/agent.py", O_RDONLY|O_LARGEFILE) = -1 ENOMEM (Cannot allocate memory) open("/usr/lib/python2.4/lib-tk/agent.py", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory) open("/usr/lib/python2.4/lib-dynload/agent.py", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory) open("/usr/lib/python2.4/site-packages/agent.py", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory) write(2, " File \"/usr/bin/sd-agent/agent."..., 54) = 54 open("/usr/lib/python2.4/sched.py", O_RDONLY|O_LARGEFILE) = 8 write(2, " File \"/usr/lib/python2.4/sched"..., 55) = 55 fstat64(8, {st_mode=S_IFREG|0644, st_size=4054, ...}) = 0 mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb7d28000 read(8, "\"\"\"A generally useful event sche"..., 4096) = 4054 write(2, " ", 4) = 4 write(2, "void = action(*argument)\n", 25) = 25 close(8) = 0 munmap(0xb7d28000, 4096) = 0 open("/usr/bin/sd-agent/checks.py", O_RDONLY|O_LARGEFILE) = -1 ENOMEM (Cannot allocate memory) open("/usr/bin/sd-agent/checks.py", O_RDONLY|O_LARGEFILE) = -1 ENOMEM (Cannot allocate memory) open("/usr/lib/python24.zip/checks.py", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory) open("/usr/lib/python2.4/checks.py", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory) open("/usr/lib/python2.4/plat-linux2/checks.py", O_RDONLY|O_LARGEFILE) = -1 ENOMEM (Cannot allocate memory) open("/usr/lib/python2.4/lib-tk/checks.py", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory) open("/usr/lib/python2.4/lib-dynload/checks.py", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory) open("/usr/lib/python2.4/site-packages/checks.py", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory) write(2, " File \"/usr/bin/sd-agent/checks"..., 60) = 60 open("/usr/bin/sd-agent/checks.py", O_RDONLY|O_LARGEFILE) = -1 ENOMEM (Cannot allocate memory) open("/usr/bin/sd-agent/checks.py", O_RDONLY|O_LARGEFILE) = -1 ENOMEM (Cannot allocate memory) open("/usr/lib/python24.zip/checks.py", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory) open("/usr/lib/python2.4/checks.py", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory) open("/usr/lib/python2.4/plat-linux2/checks.py", O_RDONLY|O_LARGEFILE) = -1 ENOMEM (Cannot allocate memory) open("/usr/lib/python2.4/lib-tk/checks.py", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory) open("/usr/lib/python2.4/lib-dynload/checks.py", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory) open("/usr/lib/python2.4/site-packages/checks.py", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory) write(2, " File \"/usr/bin/sd-agent/checks"..., 64) = 64 open("/usr/lib/python2.4/subprocess.py", O_RDONLY|O_LARGEFILE) = 8 write(2, " File \"/usr/lib/python2.4/subpr"..., 65) = 65 fstat64(8, {st_mode=S_IFREG|0644, st_size=39931, ...}) = 0 mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb7d28000 read(8, "# subprocess - Subprocesses with"..., 4096) = 4096 read(8, "lso, the newlines attribute of t"..., 4096) = 4096 read(8, "code < 0:\n print >>sys.st"..., 4096) = 4096 read(8, "alse does not exist on 2.2.0\ntry"..., 4096) = 4096 read(8, " p2cread\n # c2pread <-"..., 4096) = 4096 write(2, " ", 4) = 4 write(2, "errread, errwrite)\n", 19) = 19 close(8) = 0 munmap(0xb7d28000, 4096) = 0 open("/usr/lib/python2.4/subprocess.py", O_RDONLY|O_LARGEFILE) = 8 write(2, " File \"/usr/lib/python2.4/subpr"..., 71) = 71 fstat64(8, {st_mode=S_IFREG|0644, st_size=39931, ...}) = 0 mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb7d28000 read(8, "# subprocess - Subprocesses with"..., 4096) = 4096 read(8, "lso, the newlines attribute of t"..., 4096) = 4096 read(8, "code < 0:\n print >>sys.st"..., 4096) = 4096 read(8, "alse does not exist on 2.2.0\ntry"..., 4096) = 4096 read(8, " p2cread\n # c2pread <-"..., 4096) = 4096 read(8, "table(self, handle):\n "..., 4096) = 4096 read(8, "rrno using _sys_errlist (or siml"..., 4096) = 4096 read(8, " p2cwrite = None, None\n "..., 4096) = 4096 write(2, " ", 4) = 4 write(2, "self.pid = os.fork()\n", 21) = 21 close(8) = 0 munmap(0xb7d28000, 4096) = 0 write(2, "OSError", 7) = 7 write(2, ": ", 2) = 2 write(2, "[Errno 12] Cannot allocate memor"..., 33) = 33 write(2, "\n", 1) = 1 unlink("/var/run/sd-agent.pid") = 0 close(3) = 0 munmap(0xb7e0d000, 4096) = 0 rt_sigaction(SIGINT, {SIG_DFL, [], SA_RESTORER, 0x589978}, {0xb89a60, [], SA_RESTORER, 0x589978}, 8) = 0 brk(0xa022000) = 0xa022000 exit_group(1) = ?
|
Python subprocess.Popen "OSError: [Errno 12] Cannot allocate memory" Note: This question was originally asked here but the bounty time expired even though an acceptable answer was not actually found. I am re-asking this question including all details provided in the original question. A python script is running a set of class functions every 60 seconds using the sched module: # sc is a sched.scheduler instance sc.enter(60, 1, self.doChecks, (sc, False)) The script is running as a daemonised process using the code here . A number of class methods that are called as part of doChecks use the subprocess module to call system functions in order to get system statistics: ps = subprocess.Popen(['ps', 'aux'], stdout=subprocess.PIPE).communicate()[0] This runs fine for a period of time before the entire script crashing with the following error: File "/home/admin/sd-agent/checks.py", line 436, in getProcesses File "/usr/lib/python2.4/subprocess.py", line 533, in __init__ File "/usr/lib/python2.4/subprocess.py", line 835, in _get_handles OSError: [Errno 12] Cannot allocate memory The output of free -m on the server once the script has crashed is: $ free -m total used free shared buffers cached Mem: 894 345 549 0 0 0 -/+ buffers/cache: 345 549 Swap: 0 0 0 The server is running CentOS 5.3. I am unable to reproduce on my own CentOS boxes nor with any other user reporting the same problem. I have tried a number of things to debug this as suggested in the original question: Logging the output of free -m before and after the Popen call. There is no significant change in memory usage i.e. memory is not gradually being used up as the script runs. I added close_fds=True to the Popen call but this made no difference - the script still crashed with the same error. Suggested here and here . I checked the rlimits which showed (-1, -1) on both RLIMIT_DATA and RLIMIT_AS as suggested here . An article suggested the having no swap space might be the cause but swap is actually available on demand (according to the web host) and this was also suggested as a bogus cause here . The processes are being closed because that is the behaviour of using .communicate() as backed up by the Python source code and comments here . The entire checks can be found at on GitHub here with the getProcesses function defined from line 442. This is called by doChecks() starting at line 520. The script was run with strace with the following output before the crash: recv(4, "Total Accesses: 516662\nTotal kBy"..., 234, 0) = 234 gettimeofday({1250893252, 887805}, NULL) = 0 write(3, "2009-08-21 17:20:52,887 - checks"..., 91) = 91 gettimeofday({1250893252, 888362}, NULL) = 0 write(3, "2009-08-21 17:20:52,888 - checks"..., 74) = 74 gettimeofday({1250893252, 888897}, NULL) = 0 write(3, "2009-08-21 17:20:52,888 - checks"..., 67) = 67 gettimeofday({1250893252, 889184}, NULL) = 0 write(3, "2009-08-21 17:20:52,889 - checks"..., 81) = 81 close(4) = 0 gettimeofday({1250893252, 889591}, NULL) = 0 write(3, "2009-08-21 17:20:52,889 - checks"..., 63) = 63 pipe([4, 5]) = 0 pipe([6, 7]) = 0 fcntl64(7, F_GETFD) = 0 fcntl64(7, F_SETFD, FD_CLOEXEC) = 0 clone(child_stack=0, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0xb7f12708) = -1 ENOMEM (Cannot allocate memory) write(2, "Traceback (most recent call last"..., 35) = 35 open("/usr/bin/sd-agent/agent.py", O_RDONLY|O_LARGEFILE) = -1 ENOMEM (Cannot allocate memory) open("/usr/bin/sd-agent/agent.py", O_RDONLY|O_LARGEFILE) = -1 ENOMEM (Cannot allocate memory) open("/usr/lib/python24.zip/agent.py", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory) open("/usr/lib/python2.4/agent.py", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory) open("/usr/lib/python2.4/plat-linux2/agent.py", O_RDONLY|O_LARGEFILE) = -1 ENOMEM (Cannot allocate memory) open("/usr/lib/python2.4/lib-tk/agent.py", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory) open("/usr/lib/python2.4/lib-dynload/agent.py", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory) open("/usr/lib/python2.4/site-packages/agent.py", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory) write(2, " File \"/usr/bin/sd-agent/agent."..., 52) = 52 open("/home/admin/sd-agent/daemon.py", O_RDONLY|O_LARGEFILE) = -1 ENOMEM (Cannot allocate memory) open("/usr/bin/sd-agent/daemon.py", O_RDONLY|O_LARGEFILE) = -1 ENOMEM (Cannot allocate memory) open("/usr/lib/python24.zip/daemon.py", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory) open("/usr/lib/python2.4/daemon.py", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory) open("/usr/lib/python2.4/plat-linux2/daemon.py", O_RDONLY|O_LARGEFILE) = -1 ENOMEM (Cannot allocate memory) open("/usr/lib/python2.4/lib-tk/daemon.py", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory) open("/usr/lib/python2.4/lib-dynload/daemon.py", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory) open("/usr/lib/python2.4/site-packages/daemon.py", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory) write(2, " File \"/home/admin/sd-agent/dae"..., 60) = 60 open("/usr/bin/sd-agent/agent.py", O_RDONLY|O_LARGEFILE) = -1 ENOMEM (Cannot allocate memory) open("/usr/bin/sd-agent/agent.py", O_RDONLY|O_LARGEFILE) = -1 ENOMEM (Cannot allocate memory) open("/usr/lib/python24.zip/agent.py", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory) open("/usr/lib/python2.4/agent.py", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory) open("/usr/lib/python2.4/plat-linux2/agent.py", O_RDONLY|O_LARGEFILE) = -1 ENOMEM (Cannot allocate memory) open("/usr/lib/python2.4/lib-tk/agent.py", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory) open("/usr/lib/python2.4/lib-dynload/agent.py", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory) open("/usr/lib/python2.4/site-packages/agent.py", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory) write(2, " File \"/usr/bin/sd-agent/agent."..., 54) = 54 open("/usr/lib/python2.4/sched.py", O_RDONLY|O_LARGEFILE) = 8 write(2, " File \"/usr/lib/python2.4/sched"..., 55) = 55 fstat64(8, {st_mode=S_IFREG|0644, st_size=4054, ...}) = 0 mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb7d28000 read(8, "\"\"\"A generally useful event sche"..., 4096) = 4054 write(2, " ", 4) = 4 write(2, "void = action(*argument)\n", 25) = 25 close(8) = 0 munmap(0xb7d28000, 4096) = 0 open("/usr/bin/sd-agent/checks.py", O_RDONLY|O_LARGEFILE) = -1 ENOMEM (Cannot allocate memory) open("/usr/bin/sd-agent/checks.py", O_RDONLY|O_LARGEFILE) = -1 ENOMEM (Cannot allocate memory) open("/usr/lib/python24.zip/checks.py", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory) open("/usr/lib/python2.4/checks.py", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory) open("/usr/lib/python2.4/plat-linux2/checks.py", O_RDONLY|O_LARGEFILE) = -1 ENOMEM (Cannot allocate memory) open("/usr/lib/python2.4/lib-tk/checks.py", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory) open("/usr/lib/python2.4/lib-dynload/checks.py", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory) open("/usr/lib/python2.4/site-packages/checks.py", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory) write(2, " File \"/usr/bin/sd-agent/checks"..., 60) = 60 open("/usr/bin/sd-agent/checks.py", O_RDONLY|O_LARGEFILE) = -1 ENOMEM (Cannot allocate memory) open("/usr/bin/sd-agent/checks.py", O_RDONLY|O_LARGEFILE) = -1 ENOMEM (Cannot allocate memory) open("/usr/lib/python24.zip/checks.py", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory) open("/usr/lib/python2.4/checks.py", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory) open("/usr/lib/python2.4/plat-linux2/checks.py", O_RDONLY|O_LARGEFILE) = -1 ENOMEM (Cannot allocate memory) open("/usr/lib/python2.4/lib-tk/checks.py", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory) open("/usr/lib/python2.4/lib-dynload/checks.py", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory) open("/usr/lib/python2.4/site-packages/checks.py", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory) write(2, " File \"/usr/bin/sd-agent/checks"..., 64) = 64 open("/usr/lib/python2.4/subprocess.py", O_RDONLY|O_LARGEFILE) = 8 write(2, " File \"/usr/lib/python2.4/subpr"..., 65) = 65 fstat64(8, {st_mode=S_IFREG|0644, st_size=39931, ...}) = 0 mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb7d28000 read(8, "# subprocess - Subprocesses with"..., 4096) = 4096 read(8, "lso, the newlines attribute of t"..., 4096) = 4096 read(8, "code < 0:\n print >>sys.st"..., 4096) = 4096 read(8, "alse does not exist on 2.2.0\ntry"..., 4096) = 4096 read(8, " p2cread\n # c2pread <-"..., 4096) = 4096 write(2, " ", 4) = 4 write(2, "errread, errwrite)\n", 19) = 19 close(8) = 0 munmap(0xb7d28000, 4096) = 0 open("/usr/lib/python2.4/subprocess.py", O_RDONLY|O_LARGEFILE) = 8 write(2, " File \"/usr/lib/python2.4/subpr"..., 71) = 71 fstat64(8, {st_mode=S_IFREG|0644, st_size=39931, ...}) = 0 mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb7d28000 read(8, "# subprocess - Subprocesses with"..., 4096) = 4096 read(8, "lso, the newlines attribute of t"..., 4096) = 4096 read(8, "code < 0:\n print >>sys.st"..., 4096) = 4096 read(8, "alse does not exist on 2.2.0\ntry"..., 4096) = 4096 read(8, " p2cread\n # c2pread <-"..., 4096) = 4096 read(8, "table(self, handle):\n "..., 4096) = 4096 read(8, "rrno using _sys_errlist (or siml"..., 4096) = 4096 read(8, " p2cwrite = None, None\n "..., 4096) = 4096 write(2, " ", 4) = 4 write(2, "self.pid = os.fork()\n", 21) = 21 close(8) = 0 munmap(0xb7d28000, 4096) = 0 write(2, "OSError", 7) = 7 write(2, ": ", 2) = 2 write(2, "[Errno 12] Cannot allocate memor"..., 33) = 33 write(2, "\n", 1) = 1 unlink("/var/run/sd-agent.pid") = 0 close(3) = 0 munmap(0xb7e0d000, 4096) = 0 rt_sigaction(SIGINT, {SIG_DFL, [], SA_RESTORER, 0x589978}, {0xb89a60, [], SA_RESTORER, 0x589978}, 8) = 0 brk(0xa022000) = 0xa022000 exit_group(1) = ?
|
python, linux, memory
| 135
| 181,093
| 8
|
https://stackoverflow.com/questions/1367373/python-subprocess-popen-oserror-errno-12-cannot-allocate-memory
|
29,396,928
|
error retrieving current directory: getcwd: cannot access parent directories
|
I have a simple script: #!/bin/bash for server in $(~/.ansible/ansible_hosts) do ssh $server "hostname; readlink /opt/mydir/mylink;" done It works fine - the program returns the correct hostname and link - except that I get the following error on some but not all of the servers: shell-init: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory All the directories exist. One of the most common suggestions has been to add a cd, a cd -, or a cd /. All that happens when that step is added is an additional: chdir: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory I tried kickstarting the nfs daemon on the off chance that there was some confusion about my homedir and substituted /etc/init.d in case the problem was with /opt. No difference This would simply be an annoyance except that when I try to use an ansible playbook instead of a simple ssh command it fails for that server. Any insights would appreciated.
|
error retrieving current directory: getcwd: cannot access parent directories I have a simple script: #!/bin/bash for server in $(~/.ansible/ansible_hosts) do ssh $server "hostname; readlink /opt/mydir/mylink;" done It works fine - the program returns the correct hostname and link - except that I get the following error on some but not all of the servers: shell-init: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory All the directories exist. One of the most common suggestions has been to add a cd, a cd -, or a cd /. All that happens when that step is added is an additional: chdir: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory I tried kickstarting the nfs daemon on the off chance that there was some confusion about my homedir and substituted /etc/init.d in case the problem was with /opt. No difference This would simply be an annoyance except that when I try to use an ansible playbook instead of a simple ssh command it fails for that server. Any insights would appreciated.
|
linux, bash, shell, ssh, ansible
| 127
| 269,238
| 9
|
https://stackoverflow.com/questions/29396928/error-retrieving-current-directory-getcwd-cannot-access-parent-directories
|
9,422,461
|
Check if directory mounted with bash
|
I am using mount -o bind /some/directory/here /foo/bar I want to check /foo/bar though with a bash script, and see if its been mounted? If not, then call the above mount command, else do something else. How can I do this? CentOS is the operating system.
|
Check if directory mounted with bash I am using mount -o bind /some/directory/here /foo/bar I want to check /foo/bar though with a bash script, and see if its been mounted? If not, then call the above mount command, else do something else. How can I do this? CentOS is the operating system.
|
linux, bash, centos, mount
| 122
| 199,629
| 8
|
https://stackoverflow.com/questions/9422461/check-if-directory-mounted-with-bash
|
2,960,339
|
Unable to install pyodbc on Linux
|
I am running Linux (2.6.18-164.15.1.el5.centos.plus) and trying to install pyodbc. I am doing pip install pyodbc and get a very long list of errors, which end in error: command 'gcc' failed with exit status 1 I looked in /root/.pip/pip.log and saw the following: InstallationError: Command /usr/local/bin/python -c "import setuptools; file ='/home/build/pyodbc/setup.py'; execfile('/home/build/pyodbc/setup.py')" install --single-version-externally-managed --record /tmp/pip-7MS9Vu-record/install-record.txt failed with error code 1 Has anybody had a similar issue installing pyodbc?
|
Unable to install pyodbc on Linux I am running Linux (2.6.18-164.15.1.el5.centos.plus) and trying to install pyodbc. I am doing pip install pyodbc and get a very long list of errors, which end in error: command 'gcc' failed with exit status 1 I looked in /root/.pip/pip.log and saw the following: InstallationError: Command /usr/local/bin/python -c "import setuptools; file ='/home/build/pyodbc/setup.py'; execfile('/home/build/pyodbc/setup.py')" install --single-version-externally-managed --record /tmp/pip-7MS9Vu-record/install-record.txt failed with error code 1 Has anybody had a similar issue installing pyodbc?
|
python, linux, centos, pyodbc
| 119
| 180,320
| 20
|
https://stackoverflow.com/questions/2960339/unable-to-install-pyodbc-on-linux
|
36,918,387
|
How to free up space on docker devmapper and CentOS7?
|
I am learning docker and I am using v1.11.0 I am trying to install hadoop but devmapper is complaining about free disk space? devmapper: Thin Pool has 82984 free data blocks which is less than minimum required 163840 free data blocks. Create more free space in thin pool or use dm.min_free_space option to change behavior I have deleted all my images but the problem persists: [root@localhost hadoop_docker]# docker images REPOSITORY TAG IMAGE ID CREATED SIZE debian latest 47af6ca8a14a 3 weeks ago 125 MB [root@localhost hadoop_docker]# and this is my disk configuration: [root@localhost ~]# lsblk NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT sda 8:0 0 8G 0 disk ├─sda1 8:1 0 500M 0 part /boot └─sda2 8:2 0 7.5G 0 part ├─centos-root 253:0 0 6.7G 0 lvm / └─centos-swap 253:1 0 820M 0 lvm [SWAP] sr0 11:0 1 1024M 0 rom loop0 7:0 0 100G 0 loop └─docker-253:0-844682-pool 253:2 0 100G 0 dm loop1 7:1 0 2G 0 loop └─docker-253:0-844682-pool 253:2 0 100G 0 dm How can I free up the disk space?
|
How to free up space on docker devmapper and CentOS7? I am learning docker and I am using v1.11.0 I am trying to install hadoop but devmapper is complaining about free disk space? devmapper: Thin Pool has 82984 free data blocks which is less than minimum required 163840 free data blocks. Create more free space in thin pool or use dm.min_free_space option to change behavior I have deleted all my images but the problem persists: [root@localhost hadoop_docker]# docker images REPOSITORY TAG IMAGE ID CREATED SIZE debian latest 47af6ca8a14a 3 weeks ago 125 MB [root@localhost hadoop_docker]# and this is my disk configuration: [root@localhost ~]# lsblk NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT sda 8:0 0 8G 0 disk ├─sda1 8:1 0 500M 0 part /boot └─sda2 8:2 0 7.5G 0 part ├─centos-root 253:0 0 6.7G 0 lvm / └─centos-swap 253:1 0 820M 0 lvm [SWAP] sr0 11:0 1 1024M 0 rom loop0 7:0 0 100G 0 loop └─docker-253:0-844682-pool 253:2 0 100G 0 dm loop1 7:1 0 2G 0 loop └─docker-253:0-844682-pool 253:2 0 100G 0 dm How can I free up the disk space?
|
linux, docker
| 118
| 100,568
| 2
|
https://stackoverflow.com/questions/36918387/how-to-free-up-space-on-docker-devmapper-and-centos7
|
6,265,595
|
How can I perform a git pull without re-entering my SSH password?
|
Is it possible to configure git/ssh so I don't have to enter my passphrase every time I want to perform a git pull ? Note that the repo is a private one on github. Or, alternatively, what would be the best practice to automate code deployment from a private Github repo? Additional details: EC2 instance running a public AMI based on Fedora.
|
How can I perform a git pull without re-entering my SSH password? Is it possible to configure git/ssh so I don't have to enter my passphrase every time I want to perform a git pull ? Note that the repo is a private one on github. Or, alternatively, what would be the best practice to automate code deployment from a private Github repo? Additional details: EC2 instance running a public AMI based on Fedora.
|
linux, git, ssh, github
| 118
| 136,706
| 7
|
https://stackoverflow.com/questions/6265595/how-can-i-perform-a-git-pull-without-re-entering-my-ssh-password
|
886,237
|
How can I randomize the lines in a file using standard tools on Red Hat Linux?
|
How can I randomize the lines in a file using standard tools on Red Hat Linux? I don't have the shuf command, so I am looking for something like a perl or awk one-liner that accomplishes the same task.
|
How can I randomize the lines in a file using standard tools on Red Hat Linux? How can I randomize the lines in a file using standard tools on Red Hat Linux? I don't have the shuf command, so I am looking for something like a perl or awk one-liner that accomplishes the same task.
|
linux, file, random, redhat, shuffle
| 116
| 86,440
| 11
|
https://stackoverflow.com/questions/886237/how-can-i-randomize-the-lines-in-a-file-using-standard-tools-on-red-hat-linux
|
16,809,134
|
How to get a list of programs running with nohup
|
I am accessing a server running CentOS (linux distribution) with an SSH connection. Since I can't always stay logged in, I use "nohup [command] &" to run my programs. I couldn't find how to get a list of all the programs I started using nohup. "jobs" only works out before I log out. After that, if I log back again, the jobs command shows me nothing, but I can see in my log files that my programs are still running. Is there a way to get a list of all the programs that I started using "nohup" ?
|
How to get a list of programs running with nohup I am accessing a server running CentOS (linux distribution) with an SSH connection. Since I can't always stay logged in, I use "nohup [command] &" to run my programs. I couldn't find how to get a list of all the programs I started using nohup. "jobs" only works out before I log out. After that, if I log back again, the jobs command shows me nothing, but I can see in my log files that my programs are still running. Is there a way to get a list of all the programs that I started using "nohup" ?
|
linux, shell, centos, nohup
| 115
| 242,261
| 7
|
https://stackoverflow.com/questions/16809134/how-to-get-a-list-of-programs-running-with-nohup
|
36,496,911
|
Run an Ansible task only when the variable contains a specific string
|
I have multiple tasks depend from the value of variable1. I want to check if the value is in {{ variable1 }} but I get an error: - name: do something when the value in variable1 command: <command> when: "'value' in {{ variable1 }}" I'm using ansible 2.0.2
|
Run an Ansible task only when the variable contains a specific string I have multiple tasks depend from the value of variable1. I want to check if the value is in {{ variable1 }} but I get an error: - name: do something when the value in variable1 command: <command> when: "'value' in {{ variable1 }}" I'm using ansible 2.0.2
|
linux, ansible, conditional-statements, ansible-2.x
| 112
| 379,851
| 10
|
https://stackoverflow.com/questions/36496911/run-an-ansible-task-only-when-the-variable-contains-a-specific-string
|
30,464,980
|
How to check all versions of Python installed on OS X and CentOS
|
I just started setting up a CentOS server today and noticed that the default version of Python on CentOS is set to 2.6.6. I want to use Python 2.7 instead. I googled around and found that 2.6.6 is used by system tools such as YUM so I should not tamper with it. Then I opened up a terminal on my Mac and found that I had Python 2.6.8 and 2.7.5 and 3.3.3 installed. Sorry for the long story. In short I just want to know how to look up all the versions of Python installed on CentOS so I don't accidentally install it twice.
|
How to check all versions of Python installed on OS X and CentOS I just started setting up a CentOS server today and noticed that the default version of Python on CentOS is set to 2.6.6. I want to use Python 2.7 instead. I googled around and found that 2.6.6 is used by system tools such as YUM so I should not tamper with it. Then I opened up a terminal on my Mac and found that I had Python 2.6.8 and 2.7.5 and 3.3.3 installed. Sorry for the long story. In short I just want to know how to look up all the versions of Python installed on CentOS so I don't accidentally install it twice.
|
python, linux, macos, centos, version
| 111
| 428,400
| 15
|
https://stackoverflow.com/questions/30464980/how-to-check-all-versions-of-python-installed-on-os-x-and-centos
|
5,952,467
|
How to specify a editor to open crontab file? "export EDITOR=vi" does not work
|
I'm using Red Hat Enterprise Linux 5, and I want to set the vim editor to edit the crontab file. If I run echo $EDITOR , I get vim. But when I run crontab -e , I get different editor.
|
How to specify a editor to open crontab file? "export EDITOR=vi" does not work I'm using Red Hat Enterprise Linux 5, and I want to set the vim editor to edit the crontab file. If I run echo $EDITOR , I get vim. But when I run crontab -e , I get different editor.
|
linux, vim
| 109
| 148,988
| 8
|
https://stackoverflow.com/questions/5952467/how-to-specify-a-editor-to-open-crontab-file-export-editor-vi-does-not-work
|
1,423,346
|
How do I extract a single chunk of bytes from within a file?
|
On a Linux desktop (RHEL4) I want to extract a range of bytes (typically less than 1000) from within a large file (>1 Gig). I know the offset into the file and the size of the chunk. I can write code to do this but is there a command line solution? Ideally, something like: magicprogram --offset 102567 --size 253 < input.binary > output.binary
|
How do I extract a single chunk of bytes from within a file? On a Linux desktop (RHEL4) I want to extract a range of bytes (typically less than 1000) from within a large file (>1 Gig). I know the offset into the file and the size of the chunk. I can write code to do this but is there a command line solution? Ideally, something like: magicprogram --offset 102567 --size 253 < input.binary > output.binary
|
linux, file, split
| 108
| 80,661
| 7
|
https://stackoverflow.com/questions/1423346/how-do-i-extract-a-single-chunk-of-bytes-from-within-a-file
|
18,068,358
|
Can't su to user jenkins after installing Jenkins
|
I've installed jenkins and I'm trying to get into a shell as Jenkins to add an ssh key. I can't seem to su into the jenkins user: [root@pacmandev /]# sudo su jenkins [root@pacmandev /]# whoami root [root@pacmandev /]# echo $USER root [root@pacmandev /]# The jenkins user exists in my /etc/passwd file. Runnin su jenkins asks for a password, but rejects my normal password. sudo su jenkins doesn't seem to do anything; same for sudo su - jenkins . I'm on CentOS.
|
Can't su to user jenkins after installing Jenkins I've installed jenkins and I'm trying to get into a shell as Jenkins to add an ssh key. I can't seem to su into the jenkins user: [root@pacmandev /]# sudo su jenkins [root@pacmandev /]# whoami root [root@pacmandev /]# echo $USER root [root@pacmandev /]# The jenkins user exists in my /etc/passwd file. Runnin su jenkins asks for a password, but rejects my normal password. sudo su jenkins doesn't seem to do anything; same for sudo su - jenkins . I'm on CentOS.
|
linux, unix, jenkins
| 107
| 131,725
| 6
|
https://stackoverflow.com/questions/18068358/cant-su-to-user-jenkins-after-installing-jenkins
|
18,880,024
|
Start ssh-agent on login
|
I have a site as a remote Git repository pulling from Bitbucket using an SSH alias. I can manually start the ssh-agent on my server, but I have to do this every time I log in via SSH. I manually start the ssh-agent : eval ssh-agent $SHELL Then I add the agent: ssh-add ~/.ssh/bitbucket_id Then it shows up when I do: ssh-add -l And I'm good to go. Is there a way to automate this process, so I don't have to do it every time I log in? The server is running Red Hat 6.2 (Santiago).
|
Start ssh-agent on login I have a site as a remote Git repository pulling from Bitbucket using an SSH alias. I can manually start the ssh-agent on my server, but I have to do this every time I log in via SSH. I manually start the ssh-agent : eval ssh-agent $SHELL Then I add the agent: ssh-add ~/.ssh/bitbucket_id Then it shows up when I do: ssh-add -l And I'm good to go. Is there a way to automate this process, so I don't have to do it every time I log in? The server is running Red Hat 6.2 (Santiago).
|
git, ssh, bitbucket, redhat, ssh-agent
| 445
| 506,259
| 12
|
https://stackoverflow.com/questions/18880024/start-ssh-agent-on-login
|
11,213,520
|
Yum crashed with Keyboard Interrupt error
|
I installed the newer version of python (3.2.3) than the one available in Fedora16 (python2.7) And now yum stops working. It shows the following error. [root@localhost yum-3.4.3]# yum File "/usr/bin/yum", line 30 except KeyboardInterrupt, e: ^ SyntaxError: invalid syntax Please advice as how to resolve the error. It would be helpful as I am not able to update or install any package.
|
Yum crashed with Keyboard Interrupt error I installed the newer version of python (3.2.3) than the one available in Fedora16 (python2.7) And now yum stops working. It shows the following error. [root@localhost yum-3.4.3]# yum File "/usr/bin/yum", line 30 except KeyboardInterrupt, e: ^ SyntaxError: invalid syntax Please advice as how to resolve the error. It would be helpful as I am not able to update or install any package.
|
python-3.x, redhat, yum, fedora16
| 99
| 134,313
| 7
|
https://stackoverflow.com/questions/11213520/yum-crashed-with-keyboard-interrupt-error
|
25,751,030
|
How to get only the process ID for a specified process name on Linux?
|
How to get only the process ID for a specified process name on Linux? ps -ef|grep java test 31372 31265 0 13:41 pts/1 00:00:00 grep java Based on the process id I will write some logic. So how do I get only the process id for a specific process name. Sample program: PIDS= ps -ef|grep java if [ -z "$PIDS" ]; then echo "nothing" else mail test@domain.example fi
|
How to get only the process ID for a specified process name on Linux? How to get only the process ID for a specified process name on Linux? ps -ef|grep java test 31372 31265 0 13:41 pts/1 00:00:00 grep java Based on the process id I will write some logic. So how do I get only the process id for a specific process name. Sample program: PIDS= ps -ef|grep java if [ -z "$PIDS" ]; then echo "nothing" else mail test@domain.example fi
|
regex, linux, shell, redhat
| 97
| 142,584
| 5
|
https://stackoverflow.com/questions/25751030/how-to-get-only-the-process-id-for-a-specified-process-name-on-linux
|
46,008,624
|
How to fix: fatal error: openssl/opensslv.h: No such file or directory in RedHat 7
|
I have RedHat Enterprise Linux Server 7, and I downloaded the linux kernel version 4.12.10 which I am trying to compile but when I execute the following command: make modules I get the following error: scripts/sign-file.c:25:30: fatal error: openssl/opensslv.h: No such file or directory Does anyone have an idea to fix this please ?
|
How to fix: fatal error: openssl/opensslv.h: No such file or directory in RedHat 7 I have RedHat Enterprise Linux Server 7, and I downloaded the linux kernel version 4.12.10 which I am trying to compile but when I execute the following command: make modules I get the following error: scripts/sign-file.c:25:30: fatal error: openssl/opensslv.h: No such file or directory Does anyone have an idea to fix this please ?
|
module, linux-kernel, openssl, redhat
| 89
| 230,256
| 4
|
https://stackoverflow.com/questions/46008624/how-to-fix-fatal-error-openssl-opensslv-h-no-such-file-or-directory-in-redhat
|
3,241,086
|
How to schedule to run first Sunday of every month
|
I am using Bash on RedHat. I need to schedule a cron job to run at at 9:00 AM on first Sunday of every month. How can I do this?
|
How to schedule to run first Sunday of every month I am using Bash on RedHat. I need to schedule a cron job to run at at 9:00 AM on first Sunday of every month. How can I do this?
|
bash, shell, cron, redhat
| 81
| 145,076
| 11
|
https://stackoverflow.com/questions/3241086/how-to-schedule-to-run-first-sunday-of-every-month
|
119,390
|
Specify the from user when sending email using the mail command
|
Does anyone know how to change the from user when sending email using the mail command? I have looked through the man page and can not see how to do this. We are running Redhat Linux 5.
|
Specify the from user when sending email using the mail command Does anyone know how to change the from user when sending email using the mail command? I have looked through the man page and can not see how to do this. We are running Redhat Linux 5.
|
linux, email, redhat
| 75
| 236,135
| 15
|
https://stackoverflow.com/questions/119390/specify-the-from-user-when-sending-email-using-the-mail-command
|
17,618,737
|
Linux free shows high memory usage but top does not
|
On RedHat Linux 6.2 I'm running free -m and it shows nearly all 8GB used total used free shared buffers cached Mem: 7989 7734 254 0 28 7128 -/+ buffers/cache: 578 7411 Swap: 4150 0 4150 But at the same time in top -M I cannot see any processes using all this memory: top - 16:03:34 up 4:10, 2 users, load average: 0.08, 0.04, 0.01 Tasks: 169 total, 1 running, 163 sleeping, 5 stopped, 0 zombie Cpu(s): 0.7%us, 0.3%sy, 0.0%ni, 98.6%id, 0.4%wa, 0.0%hi, 0.0%si, 0.0%st Mem: 7989.539M total, 7721.570M used, 267.969M free, 28.633M buffers Swap: 4150.992M total, 0.000k used, 4150.992M free, 7115.312M cached PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND 1863 sroot 20 0 398m 24m 9.8m S 0.3 0.3 3:12.87 App1 1 sroot 20 0 2864 1392 1180 S 0.0 0.0 0:00.91 init 2 sroot 20 0 0 0 0 S 0.0 0.0 0:00.00 kthreadd 3 sroot RT 0 0 0 0 S 0.0 0.0 0:00.07 migration/0 4 sroot 20 0 0 0 0 S 0.0 0.0 0:00.00 ksoftirqd/0 5 sroot RT 0 0 0 0 S 0.0 0.0 0:00.00 migration/0 6 sroot RT 0 0 0 0 S 0.0 0.0 0:00.00 watchdog/0 7 sroot RT 0 0 0 0 S 0.0 0.0 0:00.08 migration/1 8 sroot RT 0 0 0 0 S 0.0 0.0 0:00.00 migration/1 I also tried this ps mem script but it onlt shows about 400MB memory being used.
|
Linux free shows high memory usage but top does not On RedHat Linux 6.2 I'm running free -m and it shows nearly all 8GB used total used free shared buffers cached Mem: 7989 7734 254 0 28 7128 -/+ buffers/cache: 578 7411 Swap: 4150 0 4150 But at the same time in top -M I cannot see any processes using all this memory: top - 16:03:34 up 4:10, 2 users, load average: 0.08, 0.04, 0.01 Tasks: 169 total, 1 running, 163 sleeping, 5 stopped, 0 zombie Cpu(s): 0.7%us, 0.3%sy, 0.0%ni, 98.6%id, 0.4%wa, 0.0%hi, 0.0%si, 0.0%st Mem: 7989.539M total, 7721.570M used, 267.969M free, 28.633M buffers Swap: 4150.992M total, 0.000k used, 4150.992M free, 7115.312M cached PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND 1863 sroot 20 0 398m 24m 9.8m S 0.3 0.3 3:12.87 App1 1 sroot 20 0 2864 1392 1180 S 0.0 0.0 0:00.91 init 2 sroot 20 0 0 0 0 S 0.0 0.0 0:00.00 kthreadd 3 sroot RT 0 0 0 0 S 0.0 0.0 0:00.07 migration/0 4 sroot 20 0 0 0 0 S 0.0 0.0 0:00.00 ksoftirqd/0 5 sroot RT 0 0 0 0 S 0.0 0.0 0:00.00 migration/0 6 sroot RT 0 0 0 0 S 0.0 0.0 0:00.00 watchdog/0 7 sroot RT 0 0 0 0 S 0.0 0.0 0:00.08 migration/1 8 sroot RT 0 0 0 0 S 0.0 0.0 0:00.00 migration/1 I also tried this ps mem script but it onlt shows about 400MB memory being used.
|
linux, memory-management, process, redhat, free-command
| 68
| 84,111
| 3
|
https://stackoverflow.com/questions/17618737/linux-free-shows-high-memory-usage-but-top-does-not
|
70,926,799
|
CentOS through a VM - no URLs in mirrorlist
|
I am trying to run a CentOS 8 server through VirtualBox (6.1.30) ( Vagrant ), which worked just fine yesterday for me, but today I tried running a sudo yum update . I keep getting this error for some reason: [vagrant@192.168.38.4] ~ >> sudo yum update CentOS Linux 8 - AppStream 71 B/s | 38 B 00:00 Error: Failed to download metadata for repo 'appstream': Cannot prepare internal mirrorlist: No URLs in mirrorlist I already tried to change the namespaces on /etc/resolve.conf , remove the DNF folders and everything. On other computers, this works just fine, so I think the problem is with my host machine. I also tried to reset the network settings (I am on a Windows 10 host), without success either. It's not a DNS problem; it works just fine. After I reinstalled Windows, I still have the same error in my VM. File dnf.log : 2022-01-31T15:28:03+0000 INFO --- logging initialized --- 2022-01-31T15:28:03+0000 DDEBUG timer: config: 2 ms 2022-01-31T15:28:03+0000 DEBUG Loaded plugins: builddep, changelog, config-manager, copr, debug, debuginfo-install, download, generate_completion_cache, groups-manager, needs-restarting, playground, repoclosure, repodiff, repograph, repomanage, reposync 2022-01-31T15:28:03+0000 DEBUG YUM version: 4.4.2 2022-01-31T15:28:03+0000 DDEBUG Command: yum update 2022-01-31T15:28:03+0000 DDEBUG Installroot: / 2022-01-31T15:28:03+0000 DDEBUG Releasever: 8 2022-01-31T15:28:03+0000 DEBUG cachedir: /var/cache/dnf 2022-01-31T15:28:03+0000 DDEBUG Base command: update 2022-01-31T15:28:03+0000 DDEBUG Extra commands: ['update'] 2022-01-31T15:28:03+0000 DEBUG User-Agent: constructed: 'libdnf (CentOS Linux 8; generic; Linux.x86_64)' 2022-01-31T15:28:05+0000 DDEBUG Cleaning up. 2022-01-31T15:28:05+0000 SUBDEBUG Traceback (most recent call last): File "/usr/lib/python3.6/site-packages/dnf/repo.py", line 574, in load ret = self._repo.load() File "/usr/lib64/python3.6/site-packages/libdnf/repo.py", line 397, in load return _repo.Repo_load(self) libdnf._error.Error: Failed to download metadata for repo 'appstream': Cannot prepare internal mirrorlist: No URLs in mirrorlist During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/usr/lib/python3.6/site-packages/dnf/cli/main.py", line 67, in main return _main(base, args, cli_class, option_parser_class) File "/usr/lib/python3.6/site-packages/dnf/cli/main.py", line 106, in _main return cli_run(cli, base) File "/usr/lib/python3.6/site-packages/dnf/cli/main.py", line 122, in cli_run cli.run() File "/usr/lib/python3.6/site-packages/dnf/cli/cli.py", line 1050, in run self._process_demands() File "/usr/lib/python3.6/site-packages/dnf/cli/cli.py", line 740, in _process_demands load_available_repos=self.demands.available_repos) File "/usr/lib/python3.6/site-packages/dnf/base.py", line 394, in fill_sack self._add_repo_to_sack(r) File "/usr/lib/python3.6/site-packages/dnf/base.py", line 137, in _add_repo_to_sack repo.load() File "/usr/lib/python3.6/site-packages/dnf/repo.py", line 581, in load raise dnf.exceptions.RepoError(str(e)) dnf.exceptions.RepoError: Failed to download metadata for repo 'appstream': Cannot prepare internal mirrorlist: No URLs in mirrorlist 2022-01-31T15:28:05+0000 CRITICAL Error: Failed to download metadata for repo 'appstream': Cannot prepare internal mirrorlist: No URLs in mirrorlist
|
CentOS through a VM - no URLs in mirrorlist I am trying to run a CentOS 8 server through VirtualBox (6.1.30) ( Vagrant ), which worked just fine yesterday for me, but today I tried running a sudo yum update . I keep getting this error for some reason: [vagrant@192.168.38.4] ~ >> sudo yum update CentOS Linux 8 - AppStream 71 B/s | 38 B 00:00 Error: Failed to download metadata for repo 'appstream': Cannot prepare internal mirrorlist: No URLs in mirrorlist I already tried to change the namespaces on /etc/resolve.conf , remove the DNF folders and everything. On other computers, this works just fine, so I think the problem is with my host machine. I also tried to reset the network settings (I am on a Windows 10 host), without success either. It's not a DNS problem; it works just fine. After I reinstalled Windows, I still have the same error in my VM. File dnf.log : 2022-01-31T15:28:03+0000 INFO --- logging initialized --- 2022-01-31T15:28:03+0000 DDEBUG timer: config: 2 ms 2022-01-31T15:28:03+0000 DEBUG Loaded plugins: builddep, changelog, config-manager, copr, debug, debuginfo-install, download, generate_completion_cache, groups-manager, needs-restarting, playground, repoclosure, repodiff, repograph, repomanage, reposync 2022-01-31T15:28:03+0000 DEBUG YUM version: 4.4.2 2022-01-31T15:28:03+0000 DDEBUG Command: yum update 2022-01-31T15:28:03+0000 DDEBUG Installroot: / 2022-01-31T15:28:03+0000 DDEBUG Releasever: 8 2022-01-31T15:28:03+0000 DEBUG cachedir: /var/cache/dnf 2022-01-31T15:28:03+0000 DDEBUG Base command: update 2022-01-31T15:28:03+0000 DDEBUG Extra commands: ['update'] 2022-01-31T15:28:03+0000 DEBUG User-Agent: constructed: 'libdnf (CentOS Linux 8; generic; Linux.x86_64)' 2022-01-31T15:28:05+0000 DDEBUG Cleaning up. 2022-01-31T15:28:05+0000 SUBDEBUG Traceback (most recent call last): File "/usr/lib/python3.6/site-packages/dnf/repo.py", line 574, in load ret = self._repo.load() File "/usr/lib64/python3.6/site-packages/libdnf/repo.py", line 397, in load return _repo.Repo_load(self) libdnf._error.Error: Failed to download metadata for repo 'appstream': Cannot prepare internal mirrorlist: No URLs in mirrorlist During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/usr/lib/python3.6/site-packages/dnf/cli/main.py", line 67, in main return _main(base, args, cli_class, option_parser_class) File "/usr/lib/python3.6/site-packages/dnf/cli/main.py", line 106, in _main return cli_run(cli, base) File "/usr/lib/python3.6/site-packages/dnf/cli/main.py", line 122, in cli_run cli.run() File "/usr/lib/python3.6/site-packages/dnf/cli/cli.py", line 1050, in run self._process_demands() File "/usr/lib/python3.6/site-packages/dnf/cli/cli.py", line 740, in _process_demands load_available_repos=self.demands.available_repos) File "/usr/lib/python3.6/site-packages/dnf/base.py", line 394, in fill_sack self._add_repo_to_sack(r) File "/usr/lib/python3.6/site-packages/dnf/base.py", line 137, in _add_repo_to_sack repo.load() File "/usr/lib/python3.6/site-packages/dnf/repo.py", line 581, in load raise dnf.exceptions.RepoError(str(e)) dnf.exceptions.RepoError: Failed to download metadata for repo 'appstream': Cannot prepare internal mirrorlist: No URLs in mirrorlist 2022-01-31T15:28:05+0000 CRITICAL Error: Failed to download metadata for repo 'appstream': Cannot prepare internal mirrorlist: No URLs in mirrorlist
|
linux, centos, vagrant, virtualbox, redhat
| 67
| 90,242
| 2
|
https://stackoverflow.com/questions/70926799/centos-through-a-vm-no-urls-in-mirrorlist
|
57,796,839
|
docker compose: Error while loading shared libraries: libz.so.1: failed to map segment from shared object: Operation not permitted
|
After installing docker and docker-compose on: NAME="Red Hat Enterprise Linux Server" VERSION="7.6 (Maipo)" When executing: sudo docker-compose -version It returns: Error while loading shared libraries: libz.so.1: failed to map segment from shared object: Operation not permitted It should return: docker-compose version 1.25.0-rc2, build 661ac20e Installation from docker-compose is this
|
docker compose: Error while loading shared libraries: libz.so.1: failed to map segment from shared object: Operation not permitted After installing docker and docker-compose on: NAME="Red Hat Enterprise Linux Server" VERSION="7.6 (Maipo)" When executing: sudo docker-compose -version It returns: Error while loading shared libraries: libz.so.1: failed to map segment from shared object: Operation not permitted It should return: docker-compose version 1.25.0-rc2, build 661ac20e Installation from docker-compose is this
|
linux, docker, docker-compose, pyinstaller, redhat
| 65
| 109,217
| 3
|
https://stackoverflow.com/questions/57796839/docker-compose-error-while-loading-shared-libraries-libz-so-1-failed-to-map-s
|
36,651,680
|
Click will abort further execution because Python 3 was configured to use ASCII as encoding for the environment
|
I downloaded Quokka Python/Flask CMS to a CentOS7 server. Everything works fine with command sudo python3 manage.py runserver --host 0.0.0.0 --port 80 Then I create a file /etc/init.d/quokkacms. The file contains following code start() { echo -n "Starting quokkacms: " python3 /var/www/quokka/manage.py runserver --host 0.0.0.0 --port 80 touch /var/lock/subsys/quokkacms return 0 } stop() { echo -n "Shutting down quokkacms: " rm -f /var/lock/subsys/quokkacms return 0 } case "$1" in start) start ;; stop) stop ;; status) ;; restart) stop start ;; *) echo "Usage: quokkacms {start|stop|status|restart}" exit 1 ;; esac exit $? But I get error when running sudo service quokkacms start RuntimeError: Click will abort further execution because Python 3 was configured to use ASCII as encoding for the environment. Either switch to Python 2 or consult [URL] for mitigation steps. It seems to me that it is the bash script. How come I get different results? Also I followed instructions in the link in the error message but still had no luck. [update] I had already tried the solution provided by Click before I posted this question. Check the results below (i run in root): [root@webserver quokka]# python3 Python 3.4.3 (default, Jan 26 2016, 02:25:35) [GCC 4.8.5 20150623 (Red Hat 4.8.5-4)] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import locale >>> import codecs >>> print(locale.getpreferredencoding()) UTF-8 >>> print(codecs.lookup(locale.getpreferredencoding()).name) utf-8 >>> locale.getdefaultlocale() ('en_US', 'UTF-8') >>> locale.CODESET 14 >>>
|
Click will abort further execution because Python 3 was configured to use ASCII as encoding for the environment I downloaded Quokka Python/Flask CMS to a CentOS7 server. Everything works fine with command sudo python3 manage.py runserver --host 0.0.0.0 --port 80 Then I create a file /etc/init.d/quokkacms. The file contains following code start() { echo -n "Starting quokkacms: " python3 /var/www/quokka/manage.py runserver --host 0.0.0.0 --port 80 touch /var/lock/subsys/quokkacms return 0 } stop() { echo -n "Shutting down quokkacms: " rm -f /var/lock/subsys/quokkacms return 0 } case "$1" in start) start ;; stop) stop ;; status) ;; restart) stop start ;; *) echo "Usage: quokkacms {start|stop|status|restart}" exit 1 ;; esac exit $? But I get error when running sudo service quokkacms start RuntimeError: Click will abort further execution because Python 3 was configured to use ASCII as encoding for the environment. Either switch to Python 2 or consult [URL] for mitigation steps. It seems to me that it is the bash script. How come I get different results? Also I followed instructions in the link in the error message but still had no luck. [update] I had already tried the solution provided by Click before I posted this question. Check the results below (i run in root): [root@webserver quokka]# python3 Python 3.4.3 (default, Jan 26 2016, 02:25:35) [GCC 4.8.5 20150623 (Red Hat 4.8.5-4)] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import locale >>> import codecs >>> print(locale.getpreferredencoding()) UTF-8 >>> print(codecs.lookup(locale.getpreferredencoding()).name) utf-8 >>> locale.getdefaultlocale() ('en_US', 'UTF-8') >>> locale.CODESET 14 >>>
|
python-3.x, centos, locale, redhat, python-click
| 65
| 62,169
| 2
|
https://stackoverflow.com/questions/36651680/click-will-abort-further-execution-because-python-3-was-configured-to-use-ascii
|
40,622,162
|
Docker load and save: "archive/tar: invalid tar header"
|
I'm trying to import a Docker image into Docker on AWS Red Hat Linux (3.10.0-514.el7.x86_64) and am having problems with the error; Error processing tar file(exit status 1): archive/tar: invalid tar header This same image works fine on my local machine, and in Boot2Docker on Windows also. It's quite large (2.5 GB), but I've verified the checksum on the Red Hat Linux instance, and it's the same as from the source. What could be wrong, or how I can resolve it?
|
Docker load and save: "archive/tar: invalid tar header" I'm trying to import a Docker image into Docker on AWS Red Hat Linux (3.10.0-514.el7.x86_64) and am having problems with the error; Error processing tar file(exit status 1): archive/tar: invalid tar header This same image works fine on my local machine, and in Boot2Docker on Windows also. It's quite large (2.5 GB), but I've verified the checksum on the Red Hat Linux instance, and it's the same as from the source. What could be wrong, or how I can resolve it?
|
linux, docker, redhat, tar, docker-image
| 58
| 77,936
| 5
|
https://stackoverflow.com/questions/40622162/docker-load-and-save-archive-tar-invalid-tar-header
|
4,632,261
|
PIL /JPEG Library: "decoder jpeg not available"
|
I tried to use PIL to do some JPEG work in my django app with PIL but I'm getting this IOError.. not sure what to do. ""decoder jpeg not available"" Am I missing the JPEG decoder from my server? If so, how do I fix it?
|
PIL /JPEG Library: "decoder jpeg not available" I tried to use PIL to do some JPEG work in my django app with PIL but I'm getting this IOError.. not sure what to do. ""decoder jpeg not available"" Am I missing the JPEG decoder from my server? If so, how do I fix it?
|
python, django, python-imaging-library, redhat, libjpeg
| 56
| 51,880
| 8
|
https://stackoverflow.com/questions/4632261/pil-jpeg-library-decoder-jpeg-not-available
|
12,076,326
|
How to install maven on redhat linux
|
Note: When originally posted I was trying to install maven2. Since the main answer is for maven3 I have updated the title. The rest of the question remains as it was originally posted. I'm trying to install maven2 on a redhat linux box using the command yum install maven2 but yum doesn't seem to be able to find maven2. No package maven2 available I've run across other posts about this topic, but the answer to the following post suggests to add repos. I add said repos, but run into errors after adding them. How to install Maven into Red Hat Enterprise Linux 6? I can only access this box via command line so simply downloading maven from their website is difficult for me.
|
How to install maven on redhat linux Note: When originally posted I was trying to install maven2. Since the main answer is for maven3 I have updated the title. The rest of the question remains as it was originally posted. I'm trying to install maven2 on a redhat linux box using the command yum install maven2 but yum doesn't seem to be able to find maven2. No package maven2 available I've run across other posts about this topic, but the answer to the following post suggests to add repos. I add said repos, but run into errors after adding them. How to install Maven into Red Hat Enterprise Linux 6? I can only access this box via command line so simply downloading maven from their website is difficult for me.
|
linux, maven, redhat, yum
| 55
| 131,534
| 7
|
https://stackoverflow.com/questions/12076326/how-to-install-maven-on-redhat-linux
|
42,981,114
|
install Docker CE 17.03 on RHEL7
|
Is it possible to install DockerCE in the specific version 17.03 on RHEL7 ? There is information here: [URL] about the installing Docker on RHEL but there is no version info. and here with Docker 17.03 but only in Docker EE not Docker CE [URL] but they talk about Docker v 0.12
|
install Docker CE 17.03 on RHEL7 Is it possible to install DockerCE in the specific version 17.03 on RHEL7 ? There is information here: [URL] about the installing Docker on RHEL but there is no version info. and here with Docker 17.03 but only in Docker EE not Docker CE [URL] but they talk about Docker v 0.12
|
docker, redhat
| 50
| 99,484
| 8
|
https://stackoverflow.com/questions/42981114/install-docker-ce-17-03-on-rhel7
|
341,608
|
MySQL config file location - redhat linux server
|
What is the default location for the MySQL configuration file on a redhat linux box?
|
MySQL config file location - redhat linux server What is the default location for the MySQL configuration file on a redhat linux box?
|
mysql, linux, redhat
| 45
| 226,470
| 8
|
https://stackoverflow.com/questions/341608/mysql-config-file-location-redhat-linux-server
|
792,563
|
How do I clone an OpenLDAP database
|
I know this is more like a serverfault question than a stackoverflow question, but since serverfault isn't up yet, here I go: I'm supposed to move an application from one redhat server to another, and without very good knowledge of the internal workings of the application, how would I move the OpenLDAP database from the one machine to the other, with schemas and all. What files would I need to copy over? I believe the setup is pretty standard.
|
How do I clone an OpenLDAP database I know this is more like a serverfault question than a stackoverflow question, but since serverfault isn't up yet, here I go: I'm supposed to move an application from one redhat server to another, and without very good knowledge of the internal workings of the application, how would I move the OpenLDAP database from the one machine to the other, with schemas and all. What files would I need to copy over? I believe the setup is pretty standard.
|
linux, ldap, redhat, openldap
| 43
| 100,225
| 6
|
https://stackoverflow.com/questions/792563/how-do-i-clone-an-openldap-database
|
8,962,477
|
Logrotate files with date in the file name
|
I am trying to configure logrotate in RHEL for tomcat6 logs. Currently, logrotate works fine for catalina.out log, it is rotated and compressed properly. The problem is with the files with date in them like: catalina.2012-01-20.log catalina.2012-01-21.log catalina.2012-01-22.log These files are not being rotated. I understand that I have to configure these in /etc/logrotate.d/tomcat6 file where rotation for catalina.out is configured. But I am not able to configure it. All I want is these older files to be compressed daily, except the current date log file. Can anybody help me out on this, please!! Thanks Noman A.
|
Logrotate files with date in the file name I am trying to configure logrotate in RHEL for tomcat6 logs. Currently, logrotate works fine for catalina.out log, it is rotated and compressed properly. The problem is with the files with date in them like: catalina.2012-01-20.log catalina.2012-01-21.log catalina.2012-01-22.log These files are not being rotated. I understand that I have to configure these in /etc/logrotate.d/tomcat6 file where rotation for catalina.out is configured. But I am not able to configure it. All I want is these older files to be compressed daily, except the current date log file. Can anybody help me out on this, please!! Thanks Noman A.
|
tomcat, date, redhat, logrotate
| 43
| 96,222
| 11
|
https://stackoverflow.com/questions/8962477/logrotate-files-with-date-in-the-file-name
|
5,250,345
|
Cannot overwrite Symbolic Link RedHat Linux
|
I have created a symbolic link: sudo ln -s /some/dir new_dir Now I want to overwrite the symbolic link to point to a new location and it will not overwrite. I have tried: sudo ln -f -s /other/dir new_dir I can always sudo rm new_dir , but I would rather have it overwrite accordingly if possible. Any ideas?
|
Cannot overwrite Symbolic Link RedHat Linux I have created a symbolic link: sudo ln -s /some/dir new_dir Now I want to overwrite the symbolic link to point to a new location and it will not overwrite. I have tried: sudo ln -f -s /other/dir new_dir I can always sudo rm new_dir , but I would rather have it overwrite accordingly if possible. Any ideas?
|
linux, symlink, redhat
| 42
| 15,428
| 3
|
https://stackoverflow.com/questions/5250345/cannot-overwrite-symbolic-link-redhat-linux
|
56,432,205
|
How to install ps in redhat ubi8/ubi-minimal
|
For registry.access.redhat.com/ubi8/ubi-minimal this image, i need ps utility to be installed. There is no yum package manager available in the image. Instead , we have microdnf . microdnf install procps says there is no such package named procps
|
How to install ps in redhat ubi8/ubi-minimal For registry.access.redhat.com/ubi8/ubi-minimal this image, i need ps utility to be installed. There is no yum package manager available in the image. Instead , we have microdnf . microdnf install procps says there is no such package named procps
|
redhat, redhat-containers, procps
| 39
| 47,499
| 2
|
https://stackoverflow.com/questions/56432205/how-to-install-ps-in-redhat-ubi8-ubi-minimal
|
47,202,468
|
Segfault on declaring a variable of type vector<shared_ptr<int>>
|
Code Here is the program that gives the segfault. #include <iostream> #include <vector> #include <memory> int main() { std::cout << "Hello World" << std::endl; std::vector<std::shared_ptr<int>> y {}; std::cout << "Hello World" << std::endl; } Of course, there is absolutely nothing wrong in the program itself. The root cause of the segfault depends on the environment in which its built and ran. Background We, at Amazon, use a build system which builds and deploys the binaries ( lib and bin ) in an almost machine independent way. For our case, that basically means it deploys the executable (built from the above program) into $project_dir/build/bin/ and almost all its dependencies (i.e the shared libraries) into $project_dir/build/lib/ . Why I used the phrase "almost" is because for shared libraries such libc.so , libm.so , ld-linux-x86-64.so.2 and possibly few others, the executable picks from the system (i.e from /lib64 ). Note that it is supposed to pick libstdc++ from $project_dir/build/lib though. Now I run it as follows: $ LD_LIBRARY_PATH=$project_dir/build/lib ./build/bin/run segmentation fault However if I run it, without setting the LD_LIBRARY_PATH . It runs fine. Diagnostics 1. ldd Here are ldd informations for both cases (please note that I've edited the output to mention the full version of the libraries wherever there is difference ) $ LD_LIBRARY_PATH=$project_dir/build/lib ldd ./build/bin/run linux-vdso.so.1 => (0x00007ffce19ca000) libstdc++.so.6 => $project_dir/build/lib/libstdc++.so.6.0.20 libgcc_s.so.1 => $project_dir/build/lib/libgcc_s.so.1 libc.so.6 => /lib64/libc.so.6 libm.so.6 => /lib64/libm.so.6 /lib64/ld-linux-x86-64.so.2 (0x0000562ec51bc000) and without LD_LIBRARY_PATH: $ ldd ./build/bin/run linux-vdso.so.1 => (0x00007fffcedde000) libstdc++.so.6 => /usr/lib64/libstdc++.so.6.0.16 libgcc_s.so.1 => /lib64/libgcc_s-4.4.6-20110824.so.1 libc.so.6 => /lib64/libc.so.6 libm.so.6 => /lib64/libm.so.6 /lib64/ld-linux-x86-64.so.2 (0x0000560caff38000) 2. gdb when it segfaults Program received signal SIGSEGV, Segmentation fault. 0x00007ffff7dea45c in _dl_fixup () from /lib64/ld-linux-x86-64.so.2 Missing separate debuginfos, use: debuginfo-install glibc-2.12-1.209.62.al12.x86_64 (gdb) bt #0 0x00007ffff7dea45c in _dl_fixup () from /lib64/ld-linux-x86-64.so.2 #1 0x00007ffff7df0c55 in _dl_runtime_resolve () from /lib64/ld-linux-x86-64.so.2 #2 0x00007ffff7b1dc41 in std::locale::_S_initialize() () from $project_dir/build/lib/libstdc++.so.6 #3 0x00007ffff7b1dc85 in std::locale::locale() () from $project_dir/build/lib/libstdc++.so.6 #4 0x00007ffff7b1a574 in std::ios_base::Init::Init() () from $project_dir/build/lib/libstdc++.so.6 #5 0x0000000000400fde in _GLOBAL__sub_I_main () at $project_dir/build/gcc-4.9.4/include/c++/4.9.4/iostream:74 #6 0x00000000004012ed in __libc_csu_init () #7 0x00007ffff7518cb0 in __libc_start_main () from /lib64/libc.so.6 #8 0x0000000000401021 in _start () (gdb) 3. LD_DEBUG=all I also tried to see the linker information by enabling LD_DEBUG=all for the segfault case. I found something suspicious, as it searches for pthread_once symbol, and when it unable to find this, it gives segfault (that is my interpretation of the following output snippet BTW): initialize program: $project_dir/build/bin/run symbol=_ZNSt8ios_base4InitC1Ev; lookup in file=$project_dir/build/bin/run [0] symbol=_ZNSt8ios_base4InitC1Ev; lookup in file=$project_dir/build/lib/libstdc++.so.6 [0] binding file $project_dir/build/bin/run [0] to $project_dir/build/lib/libstdc++.so.6 [0]: normal symbol _ZNSt8ios_base4InitC1Ev' [GLIBCXX_3.4] symbol=_ZNSt6localeC1Ev; lookup in file=$project_dir/build/bin/run [0] symbol=_ZNSt6localeC1Ev; lookup in file=$project_dir/build/lib/libstdc++.so.6 [0] binding file $project_dir/build/lib/libstdc++.so.6 [0] to $project_dir/build/lib/libstdc++.so.6 [0]: normal symbol _ZNSt6localeC1Ev' [GLIBCXX_3.4] symbol=pthread_once; lookup in file=$project_dir/build/bin/run [0] symbol=pthread_once; lookup in file=$project_dir/build/lib/libstdc++.so.6 [0] symbol=pthread_once; lookup in file=$project_dir/build/lib/libgcc_s.so.1 [0] symbol=pthread_once; lookup in file=/lib64/libc.so.6 [0] symbol=pthread_once; lookup in file=/lib64/libm.so.6 [0] symbol=pthread_once; lookup in file=/lib64/ld-linux-x86-64.so.2 [0] But I dont see any pthread_once for the case when it runs successfully! Questions I know that its very difficult to debug like this and probably I've not given a lot of informations about the environments and all. But still, my question is: what could be the possible root-cause for this segfault? How to debug further and find that? Once I find the issue, fix would be easy. Compiler and Platform I'm using GCC 4.9 on RHEL5. Experiments E#1 If I comment the following line: std::vector<std::shared_ptr<int>> y {}; It compiles and runs fine! E#2 I just included the following header to my program: #include <boost/filesystem.hpp> and linked accordingly. Now it works without any segfault. So it seems by having a dependency on libboost_system.so.1.53.0. , some requirements are met, or the problem is circumvented! E#3 Since I saw it working when I made the executable to be linked against libboost_system.so.1.53.0 , so I did the following things step by step. Instead of using #include <boost/filesystem.hpp> in the code itself, I use the original code and ran it by preloading libboost_system.so using LD_PRELOAD as follows: $ LD_PRELOAD=$project_dir/build/lib/libboost_system.so $project_dir/build/bin/run and it ran successfully! Next I did ldd on the libboost_system.so which gave a list of libs, two of which were: /lib64/librt.so.1 /lib64/libpthread.so.0 So instead of preloading libboost_system , I preload librt and libpthread separately: $ LD_PRELOAD=/lib64/librt.so.1 $project_dir/build/bin/run $ LD_PRELOAD=/lib64/libpthread.so.0 $project_dir/build/bin/run In both cases, it ran successfully. Now my conclusion is that by loading either librt or libpthread (or both ), some requirements are met or the problem is circumvented! I still dont know the root cause of the issue, though. Compilation and Linking Options Since the build system is complex and there are lots of options which are there by default. So I tried to explicitly add -lpthread using CMake's set command, then it worked, as we have already seen that by preloading libpthread it works! In order to see the build difference between these two cases ( when-it-works and when-it-gives-segfault ), I built it in verbose mode by passing -v to GCC, to see the compilation stages and the options it actually passes to cc1plus (compiler) and collect2 (linker). ( Note that paths has been edited for brevity, using dollar-sign and dummy paths. ) $/gcc-4.9.4/cc1plus -quiet -v -I /a/include -I /b/include -iprefix $/gcc-4.9.4/ -MMD main.cpp.d -MF main.cpp.o.d -MT main.cpp.o -D_GNU_SOURCE -D_REENTRANT -D __USE_XOPEN2K8 -D _LARGEFILE_SOURCE -D _FILE_OFFSET_BITS=64 -D __STDC_FORMAT_MACROS -D __STDC_LIMIT_MACROS -D NDEBUG $/lab/main.cpp -quiet -dumpbase main.cpp -msse -mfpmath=sse -march=core2 -auxbase-strip main.cpp.o -g -O3 -Wall -Wextra -std=gnu++1y -version -fdiagnostics-color=auto -ftemplate-depth=128 -fno-operator-names -o /tmp/ccxfkRyd.s Irrespective of whether it works or not, the command-line arguments to cc1plus are exactly the same. No difference at all. That does not seem to be very helpful. The difference, however, is at the linking time. Here is what I see, for the case when it works : $/gcc-4.9.4/collect2 -plugin $/gcc-4.9.4/liblto_plugin.so -plugin-opt=$/gcc-4.9.4/lto-wrapper -plugin-opt=-fresolution=/tmp/cchl8RtI.res -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lpthread -plugin-opt=-pass-through=-lc -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lgcc --eh-frame-hdr -m elf_x86_64 -export-dynamic -dynamic-linker /lib64/ld-linux-x86-64.so.2 -o run /usr/lib/../lib64/crt1.o /usr/lib/../lib64/crti.o $/gcc-4.9.4/crtbegin.o -L/a/lib -L/b/lib -L/c/lib -lpthread --as-needed main.cpp.o -lboost_timer -lboost_wave -lboost_chrono -lboost_filesystem -lboost_graph -lboost_locale -lboost_thread -lboost_wserialization -lboost_atomic -lboost_context -lboost_date_time -lboost_iostreams -lboost_math_c99 -lboost_math_c99f -lboost_math_c99l -lboost_math_tr1 -lboost_math_tr1f -lboost_math_tr1l -lboost_mpi -lboost_prg_exec_monitor -lboost_program_options -lboost_random -lboost_regex -lboost_serialization -lboost_signals -lboost_system -lboost_unit_test_framework -lboost_exception -lboost_test_exec_monitor -lbz2 -licui18n -licuuc -licudata -lz -rpath /a/lib:/b/lib:/c/lib: -lstdc++ -lm -lgcc_s -lgcc -lpthread -lc -lgcc_s -lgcc $/gcc-4.9.4/crtend.o /usr/lib/../lib64/crtn.o As you can see, -lpthread is mentioned twice ! The first -lpthread (which is followed by --as-needed ) is missing for the case when it gives segfault . That is the only difference between these two cases. Output of nm -C in both cases Interestingly, the output of nm -C in both cases is identical ( if you ignore the integer values in the first columns ). 0000000000402580 d _DYNAMIC 0000000000402798 d _GLOBAL_OFFSET_TABLE_ 0000000000401000 t _GLOBAL__sub_I_main 0000000000401358 R _IO_stdin_used w _ITM_deregisterTMCloneTable w _ITM_registerTMCloneTable w _Jv_RegisterClasses U _Unwind_Resume 0000000000401150 W std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)2>::_M_destroy() 0000000000401170 W std::vector<std::shared_ptr<int>, std::allocator<std::shared_ptr<int> > >::~vector() 0000000000401170 W std::vector<std::shared_ptr<int>, std::allocator<std::shared_ptr<int> > >::~vector() 0000000000401250 W std::vector<std::unique_ptr<int, std::default_delete<int> >, std::allocator<std::unique_ptr<int, std::default_delete<int> > > >::~vector() 0000000000401250 W std::vector<std::unique_ptr<int, std::default_delete<int> >, std::allocator<std::unique_ptr<int, std::default_delete<int> > > >::~vector() U std::ios_base::Init::Init() U std::ios_base::Init::~Init() 0000000000402880 B std::cout U std::basic_ostream<char, std::char_traits<char> >& std::endl<char, std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&) 0000000000402841 b std::__ioinit U std::basic_ostream<char, std::char_traits<char> >& std::operator<< <std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*) U operator delete(void*) U operator new(unsigned long) 0000000000401510 r __FRAME_END__ 0000000000402818 d __JCR_END__ 0000000000402818 d __JCR_LIST__ 0000000000402820 d __TMC_END__ 0000000000402820 d __TMC_LIST__ 0000000000402838 A __bss_start U __cxa_atexit 0000000000402808 D __data_start 0000000000401100 t __do_global_dtors_aux 0000000000402820 t __do_global_dtors_aux_fini_array_entry 0000000000402810 d __dso_handle 0000000000402828 t __frame_dummy_init_array_entry w __gmon_start__ U __gxx_personality_v0 0000000000402838 t __init_array_end 0000000000402828 t __init_array_start 00000000004012b0 T __libc_csu_fini 00000000004012c0 T __libc_csu_init U __libc_start_main w __pthread_key_create 0000000000402838 A _edata 0000000000402990 A _end 000000000040134c T _fini 0000000000400e68 T _init 0000000000401028 T _start 0000000000401054 t call_gmon_start 0000000000402840 b completed.6661 0000000000402808 W data_start 0000000000401080 t deregister_tm_clones 0000000000401120 t frame_dummy 0000000000400f40 T main 00000000004010c0 t register_tm_clones
|
Segfault on declaring a variable of type vector<shared_ptr<int>> Code Here is the program that gives the segfault. #include <iostream> #include <vector> #include <memory> int main() { std::cout << "Hello World" << std::endl; std::vector<std::shared_ptr<int>> y {}; std::cout << "Hello World" << std::endl; } Of course, there is absolutely nothing wrong in the program itself. The root cause of the segfault depends on the environment in which its built and ran. Background We, at Amazon, use a build system which builds and deploys the binaries ( lib and bin ) in an almost machine independent way. For our case, that basically means it deploys the executable (built from the above program) into $project_dir/build/bin/ and almost all its dependencies (i.e the shared libraries) into $project_dir/build/lib/ . Why I used the phrase "almost" is because for shared libraries such libc.so , libm.so , ld-linux-x86-64.so.2 and possibly few others, the executable picks from the system (i.e from /lib64 ). Note that it is supposed to pick libstdc++ from $project_dir/build/lib though. Now I run it as follows: $ LD_LIBRARY_PATH=$project_dir/build/lib ./build/bin/run segmentation fault However if I run it, without setting the LD_LIBRARY_PATH . It runs fine. Diagnostics 1. ldd Here are ldd informations for both cases (please note that I've edited the output to mention the full version of the libraries wherever there is difference ) $ LD_LIBRARY_PATH=$project_dir/build/lib ldd ./build/bin/run linux-vdso.so.1 => (0x00007ffce19ca000) libstdc++.so.6 => $project_dir/build/lib/libstdc++.so.6.0.20 libgcc_s.so.1 => $project_dir/build/lib/libgcc_s.so.1 libc.so.6 => /lib64/libc.so.6 libm.so.6 => /lib64/libm.so.6 /lib64/ld-linux-x86-64.so.2 (0x0000562ec51bc000) and without LD_LIBRARY_PATH: $ ldd ./build/bin/run linux-vdso.so.1 => (0x00007fffcedde000) libstdc++.so.6 => /usr/lib64/libstdc++.so.6.0.16 libgcc_s.so.1 => /lib64/libgcc_s-4.4.6-20110824.so.1 libc.so.6 => /lib64/libc.so.6 libm.so.6 => /lib64/libm.so.6 /lib64/ld-linux-x86-64.so.2 (0x0000560caff38000) 2. gdb when it segfaults Program received signal SIGSEGV, Segmentation fault. 0x00007ffff7dea45c in _dl_fixup () from /lib64/ld-linux-x86-64.so.2 Missing separate debuginfos, use: debuginfo-install glibc-2.12-1.209.62.al12.x86_64 (gdb) bt #0 0x00007ffff7dea45c in _dl_fixup () from /lib64/ld-linux-x86-64.so.2 #1 0x00007ffff7df0c55 in _dl_runtime_resolve () from /lib64/ld-linux-x86-64.so.2 #2 0x00007ffff7b1dc41 in std::locale::_S_initialize() () from $project_dir/build/lib/libstdc++.so.6 #3 0x00007ffff7b1dc85 in std::locale::locale() () from $project_dir/build/lib/libstdc++.so.6 #4 0x00007ffff7b1a574 in std::ios_base::Init::Init() () from $project_dir/build/lib/libstdc++.so.6 #5 0x0000000000400fde in _GLOBAL__sub_I_main () at $project_dir/build/gcc-4.9.4/include/c++/4.9.4/iostream:74 #6 0x00000000004012ed in __libc_csu_init () #7 0x00007ffff7518cb0 in __libc_start_main () from /lib64/libc.so.6 #8 0x0000000000401021 in _start () (gdb) 3. LD_DEBUG=all I also tried to see the linker information by enabling LD_DEBUG=all for the segfault case. I found something suspicious, as it searches for pthread_once symbol, and when it unable to find this, it gives segfault (that is my interpretation of the following output snippet BTW): initialize program: $project_dir/build/bin/run symbol=_ZNSt8ios_base4InitC1Ev; lookup in file=$project_dir/build/bin/run [0] symbol=_ZNSt8ios_base4InitC1Ev; lookup in file=$project_dir/build/lib/libstdc++.so.6 [0] binding file $project_dir/build/bin/run [0] to $project_dir/build/lib/libstdc++.so.6 [0]: normal symbol _ZNSt8ios_base4InitC1Ev' [GLIBCXX_3.4] symbol=_ZNSt6localeC1Ev; lookup in file=$project_dir/build/bin/run [0] symbol=_ZNSt6localeC1Ev; lookup in file=$project_dir/build/lib/libstdc++.so.6 [0] binding file $project_dir/build/lib/libstdc++.so.6 [0] to $project_dir/build/lib/libstdc++.so.6 [0]: normal symbol _ZNSt6localeC1Ev' [GLIBCXX_3.4] symbol=pthread_once; lookup in file=$project_dir/build/bin/run [0] symbol=pthread_once; lookup in file=$project_dir/build/lib/libstdc++.so.6 [0] symbol=pthread_once; lookup in file=$project_dir/build/lib/libgcc_s.so.1 [0] symbol=pthread_once; lookup in file=/lib64/libc.so.6 [0] symbol=pthread_once; lookup in file=/lib64/libm.so.6 [0] symbol=pthread_once; lookup in file=/lib64/ld-linux-x86-64.so.2 [0] But I dont see any pthread_once for the case when it runs successfully! Questions I know that its very difficult to debug like this and probably I've not given a lot of informations about the environments and all. But still, my question is: what could be the possible root-cause for this segfault? How to debug further and find that? Once I find the issue, fix would be easy. Compiler and Platform I'm using GCC 4.9 on RHEL5. Experiments E#1 If I comment the following line: std::vector<std::shared_ptr<int>> y {}; It compiles and runs fine! E#2 I just included the following header to my program: #include <boost/filesystem.hpp> and linked accordingly. Now it works without any segfault. So it seems by having a dependency on libboost_system.so.1.53.0. , some requirements are met, or the problem is circumvented! E#3 Since I saw it working when I made the executable to be linked against libboost_system.so.1.53.0 , so I did the following things step by step. Instead of using #include <boost/filesystem.hpp> in the code itself, I use the original code and ran it by preloading libboost_system.so using LD_PRELOAD as follows: $ LD_PRELOAD=$project_dir/build/lib/libboost_system.so $project_dir/build/bin/run and it ran successfully! Next I did ldd on the libboost_system.so which gave a list of libs, two of which were: /lib64/librt.so.1 /lib64/libpthread.so.0 So instead of preloading libboost_system , I preload librt and libpthread separately: $ LD_PRELOAD=/lib64/librt.so.1 $project_dir/build/bin/run $ LD_PRELOAD=/lib64/libpthread.so.0 $project_dir/build/bin/run In both cases, it ran successfully. Now my conclusion is that by loading either librt or libpthread (or both ), some requirements are met or the problem is circumvented! I still dont know the root cause of the issue, though. Compilation and Linking Options Since the build system is complex and there are lots of options which are there by default. So I tried to explicitly add -lpthread using CMake's set command, then it worked, as we have already seen that by preloading libpthread it works! In order to see the build difference between these two cases ( when-it-works and when-it-gives-segfault ), I built it in verbose mode by passing -v to GCC, to see the compilation stages and the options it actually passes to cc1plus (compiler) and collect2 (linker). ( Note that paths has been edited for brevity, using dollar-sign and dummy paths. ) $/gcc-4.9.4/cc1plus -quiet -v -I /a/include -I /b/include -iprefix $/gcc-4.9.4/ -MMD main.cpp.d -MF main.cpp.o.d -MT main.cpp.o -D_GNU_SOURCE -D_REENTRANT -D __USE_XOPEN2K8 -D _LARGEFILE_SOURCE -D _FILE_OFFSET_BITS=64 -D __STDC_FORMAT_MACROS -D __STDC_LIMIT_MACROS -D NDEBUG $/lab/main.cpp -quiet -dumpbase main.cpp -msse -mfpmath=sse -march=core2 -auxbase-strip main.cpp.o -g -O3 -Wall -Wextra -std=gnu++1y -version -fdiagnostics-color=auto -ftemplate-depth=128 -fno-operator-names -o /tmp/ccxfkRyd.s Irrespective of whether it works or not, the command-line arguments to cc1plus are exactly the same. No difference at all. That does not seem to be very helpful. The difference, however, is at the linking time. Here is what I see, for the case when it works : $/gcc-4.9.4/collect2 -plugin $/gcc-4.9.4/liblto_plugin.so -plugin-opt=$/gcc-4.9.4/lto-wrapper -plugin-opt=-fresolution=/tmp/cchl8RtI.res -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lpthread -plugin-opt=-pass-through=-lc -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lgcc --eh-frame-hdr -m elf_x86_64 -export-dynamic -dynamic-linker /lib64/ld-linux-x86-64.so.2 -o run /usr/lib/../lib64/crt1.o /usr/lib/../lib64/crti.o $/gcc-4.9.4/crtbegin.o -L/a/lib -L/b/lib -L/c/lib -lpthread --as-needed main.cpp.o -lboost_timer -lboost_wave -lboost_chrono -lboost_filesystem -lboost_graph -lboost_locale -lboost_thread -lboost_wserialization -lboost_atomic -lboost_context -lboost_date_time -lboost_iostreams -lboost_math_c99 -lboost_math_c99f -lboost_math_c99l -lboost_math_tr1 -lboost_math_tr1f -lboost_math_tr1l -lboost_mpi -lboost_prg_exec_monitor -lboost_program_options -lboost_random -lboost_regex -lboost_serialization -lboost_signals -lboost_system -lboost_unit_test_framework -lboost_exception -lboost_test_exec_monitor -lbz2 -licui18n -licuuc -licudata -lz -rpath /a/lib:/b/lib:/c/lib: -lstdc++ -lm -lgcc_s -lgcc -lpthread -lc -lgcc_s -lgcc $/gcc-4.9.4/crtend.o /usr/lib/../lib64/crtn.o As you can see, -lpthread is mentioned twice ! The first -lpthread (which is followed by --as-needed ) is missing for the case when it gives segfault . That is the only difference between these two cases. Output of nm -C in both cases Interestingly, the output of nm -C in both cases is identical ( if you ignore the integer values in the first columns ). 0000000000402580 d _DYNAMIC 0000000000402798 d _GLOBAL_OFFSET_TABLE_ 0000000000401000 t _GLOBAL__sub_I_main 0000000000401358 R _IO_stdin_used w _ITM_deregisterTMCloneTable w _ITM_registerTMCloneTable w _Jv_RegisterClasses U _Unwind_Resume 0000000000401150 W std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)2>::_M_destroy() 0000000000401170 W std::vector<std::shared_ptr<int>, std::allocator<std::shared_ptr<int> > >::~vector() 0000000000401170 W std::vector<std::shared_ptr<int>, std::allocator<std::shared_ptr<int> > >::~vector() 0000000000401250 W std::vector<std::unique_ptr<int, std::default_delete<int> >, std::allocator<std::unique_ptr<int, std::default_delete<int> > > >::~vector() 0000000000401250 W std::vector<std::unique_ptr<int, std::default_delete<int> >, std::allocator<std::unique_ptr<int, std::default_delete<int> > > >::~vector() U std::ios_base::Init::Init() U std::ios_base::Init::~Init() 0000000000402880 B std::cout U std::basic_ostream<char, std::char_traits<char> >& std::endl<char, std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&) 0000000000402841 b std::__ioinit U std::basic_ostream<char, std::char_traits<char> >& std::operator<< <std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*) U operator delete(void*) U operator new(unsigned long) 0000000000401510 r __FRAME_END__ 0000000000402818 d __JCR_END__ 0000000000402818 d __JCR_LIST__ 0000000000402820 d __TMC_END__ 0000000000402820 d __TMC_LIST__ 0000000000402838 A __bss_start U __cxa_atexit 0000000000402808 D __data_start 0000000000401100 t __do_global_dtors_aux 0000000000402820 t __do_global_dtors_aux_fini_array_entry 0000000000402810 d __dso_handle 0000000000402828 t __frame_dummy_init_array_entry w __gmon_start__ U __gxx_personality_v0 0000000000402838 t __init_array_end 0000000000402828 t __init_array_start 00000000004012b0 T __libc_csu_fini 00000000004012c0 T __libc_csu_init U __libc_start_main w __pthread_key_create 0000000000402838 A _edata 0000000000402990 A _end 000000000040134c T _fini 0000000000400e68 T _init 0000000000401028 T _start 0000000000401054 t call_gmon_start 0000000000402840 b completed.6661 0000000000402808 W data_start 0000000000401080 t deregister_tm_clones 0000000000401120 t frame_dummy 0000000000400f40 T main 00000000004010c0 t register_tm_clones
|
c++, gcc, segmentation-fault, redhat, ld
| 38
| 1,976
| 2
|
https://stackoverflow.com/questions/47202468/segfault-on-declaring-a-variable-of-type-vectorshared-ptrint
|
25,905,923
|
python sys.exit not working in try
|
Python 2.7.5 (default, Feb 26 2014, 13:43:17) [GCC 4.4.7 20120313 (Red Hat 4.4.7-4)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import sys >>> try: ... sys.exit() ... except: ... print "in except" ... in except >>> try: ... sys.exit(0) ... except: ... print "in except" ... in except >>> try: ... sys.exit(1) ... except: ... print "in except" ... in except Why am not able to trigger sys.exit() in try, any suggestions...!!! The code posted here has all the version details. I have tried all possible ways i know to trigger it, but i failed. It gets to 'except' block. Thanks in advance..
|
python sys.exit not working in try Python 2.7.5 (default, Feb 26 2014, 13:43:17) [GCC 4.4.7 20120313 (Red Hat 4.4.7-4)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import sys >>> try: ... sys.exit() ... except: ... print "in except" ... in except >>> try: ... sys.exit(0) ... except: ... print "in except" ... in except >>> try: ... sys.exit(1) ... except: ... print "in except" ... in except Why am not able to trigger sys.exit() in try, any suggestions...!!! The code posted here has all the version details. I have tried all possible ways i know to trigger it, but i failed. It gets to 'except' block. Thanks in advance..
|
python, python-2.7, redhat, exit
| 35
| 82,508
| 2
|
https://stackoverflow.com/questions/25905923/python-sys-exit-not-working-in-try
|
4,140,219
|
How to confirm RedHat Enterprise Linux version?
|
I am a bit confused by the fact that although I installed RHEL 5.1 from DVD (RedHat/5.1.x86_64), when I issue command: cat /etc/redhat-release I got: Red Hat Enterprise Linux Server release 5.5 (Tikanga) What does this mean? is this to be the release version or kernel version? Is there another way to confirm the real version of RHEL? I am asking this question because there will be certain applications that would depend on this. Many thanks in advance.
|
How to confirm RedHat Enterprise Linux version? I am a bit confused by the fact that although I installed RHEL 5.1 from DVD (RedHat/5.1.x86_64), when I issue command: cat /etc/redhat-release I got: Red Hat Enterprise Linux Server release 5.5 (Tikanga) What does this mean? is this to be the release version or kernel version? Is there another way to confirm the real version of RHEL? I am asking this question because there will be certain applications that would depend on this. Many thanks in advance.
|
linux, redhat
| 33
| 190,568
| 4
|
https://stackoverflow.com/questions/4140219/how-to-confirm-redhat-enterprise-linux-version
|
22,509,271
|
import self signed certificate in redhat
|
How can I import a self-signed certificate in Red-Hat Linux. I'm not an expert with respect to certificates and find it difficult to find the right answer through googling, since I don't know the difference between a .cer, .crt or a .pem. Having said that, what I would like to do should not be rocket science (In windows I can do this with a few clicks in my browser) I want to connect to a server that makes use of a self-signed certificate. For example using wget, without having to use the --no-check-certificate option. To make this work I will have to add the self-signed certificate of the server to my RedHat box. I have found out the certificates reside in /etc/pki/tls. But I am at a loss what actions I should perform to make wget function without complaining. I can get the SSL certificate from the server using: openssl s_client -connect server:443 The certificate is between "BEGIN CERTIFICATE and END CERTIFICATE" I do not know what kind of certificate this is. Next I will have to put it in the /etc/pki/tls/certs directory and apply some openssl secert sauce I don't know about. Can you help?
|
import self signed certificate in redhat How can I import a self-signed certificate in Red-Hat Linux. I'm not an expert with respect to certificates and find it difficult to find the right answer through googling, since I don't know the difference between a .cer, .crt or a .pem. Having said that, what I would like to do should not be rocket science (In windows I can do this with a few clicks in my browser) I want to connect to a server that makes use of a self-signed certificate. For example using wget, without having to use the --no-check-certificate option. To make this work I will have to add the self-signed certificate of the server to my RedHat box. I have found out the certificates reside in /etc/pki/tls. But I am at a loss what actions I should perform to make wget function without complaining. I can get the SSL certificate from the server using: openssl s_client -connect server:443 The certificate is between "BEGIN CERTIFICATE and END CERTIFICATE" I do not know what kind of certificate this is. Next I will have to put it in the /etc/pki/tls/certs directory and apply some openssl secert sauce I don't know about. Can you help?
|
ssl, https, openssl, redhat, self-signed
| 33
| 110,889
| 4
|
https://stackoverflow.com/questions/22509271/import-self-signed-certificate-in-redhat
|
46,089,219
|
How to reduce the size of RHEL/Centos/Fedora Docker image
|
The base image from Red Hat is quite small, on the order of 196M for RHEL 7.4. However it tends to be missing a lot of the bits and pieces that are required by the products I want to build new images for. The moment I do a "yum install Xxx" on top of it the image size blows out to by +500M-800M. Is there a way to reduce the size of the image?
|
How to reduce the size of RHEL/Centos/Fedora Docker image The base image from Red Hat is quite small, on the order of 196M for RHEL 7.4. However it tends to be missing a lot of the bits and pieces that are required by the products I want to build new images for. The moment I do a "yum install Xxx" on top of it the image size blows out to by +500M-800M. Is there a way to reduce the size of the image?
|
docker, centos, redhat, fedora
| 32
| 44,777
| 2
|
https://stackoverflow.com/questions/46089219/how-to-reduce-the-size-of-rhel-centos-fedora-docker-image
|
11,286,669
|
jps not working
|
I have installed java-1.6.0-openjdk-devel. $java -version java version "1.6.0_24" OpenJDK Runtime Environment (IcedTea6 1.11.3) (rhel-1.48.1.11.3.el6_2-x86_64) OpenJDK 64-Bit Server VM (build 20.0-b12, mixed mode) when typing jps into command prompt $jps -bash: jps: command not found I do not believe it is an openjdk error because I have used it around 6 months back on the same system and it worked fine. Also, it works fine on my laptop.
|
jps not working I have installed java-1.6.0-openjdk-devel. $java -version java version "1.6.0_24" OpenJDK Runtime Environment (IcedTea6 1.11.3) (rhel-1.48.1.11.3.el6_2-x86_64) OpenJDK 64-Bit Server VM (build 20.0-b12, mixed mode) when typing jps into command prompt $jps -bash: jps: command not found I do not believe it is an openjdk error because I have used it around 6 months back on the same system and it worked fine. Also, it works fine on my laptop.
|
linux, redhat, java
| 31
| 99,027
| 12
|
https://stackoverflow.com/questions/11286669/jps-not-working
|
5,272,026
|
TCP: Server sends [RST, ACK] immediately after receiving [SYN] from Client
|
Host_A tries to send some data to Host_B over TCP. Host_B is listening on port 8181. Both Host_A & Host_B are Linux boxes (Red Hat Enterprise). The TCP layer is implemented using Java NIO API. Whatever Host_A sends, Host_B is unable to receive. Sniffing the data on wire using WireShark resulted in the following log: 1) Host_A (33253) > Host_B (8181): [SYN] Seq=0 Win=5840 Len=0 MSS=1460 TSV=513413781 TSER=0 WS=7 2) Host_B (8181) > Host_A (33253): [RST, ACK] Seq=1 Ack=1 Win=0 Len=0 The logs show that Host_A sends a [SYN] flag to Host_B in order to establish connection. But instead of [SYN, ACK] Host_B responds with an [RST, ACK] which resets/closes the connection. This behavior is observed always. I am wondering under what circumstance does a TCP listener sends [RST,ACK] in response to a [SYN]?
|
TCP: Server sends [RST, ACK] immediately after receiving [SYN] from Client Host_A tries to send some data to Host_B over TCP. Host_B is listening on port 8181. Both Host_A & Host_B are Linux boxes (Red Hat Enterprise). The TCP layer is implemented using Java NIO API. Whatever Host_A sends, Host_B is unable to receive. Sniffing the data on wire using WireShark resulted in the following log: 1) Host_A (33253) > Host_B (8181): [SYN] Seq=0 Win=5840 Len=0 MSS=1460 TSV=513413781 TSER=0 WS=7 2) Host_B (8181) > Host_A (33253): [RST, ACK] Seq=1 Ack=1 Win=0 Len=0 The logs show that Host_A sends a [SYN] flag to Host_B in order to establish connection. But instead of [SYN, ACK] Host_B responds with an [RST, ACK] which resets/closes the connection. This behavior is observed always. I am wondering under what circumstance does a TCP listener sends [RST,ACK] in response to a [SYN]?
|
linux, tcp, nio, redhat
| 31
| 154,355
| 2
|
https://stackoverflow.com/questions/5272026/tcp-server-sends-rst-ack-immediately-after-receiving-syn-from-client
|
21,839,538
|
Change JENKINS_HOME on Red Hat Linux?
|
I used this procedure to install Jenkins: [URL] After it was up and running I discovered the /var/lib/jenkins partition on my server is very small. I want to move it, but I do not want to change the user that it runs under. I am new to Linux and I'm stumped. How do I move it for example to my Home/Public folder? The "Jenkins" user doesn't seem to have a Home folder. Its running as a daemon on startup, so I have no idea where to configure those settings. Can I create a Home folder for the Jenkins user? How? I read this article: [URL] but do not understand HOW to "set the new Jenkins home". I have used the export command, and restarted the service, but the old path still shows up in the Manage Jenkins screens. I've read the 2-3 similar questions on stackoverflow also, but there's always a big missing piece for me. Where to find that file where I change the path permanently?
|
Change JENKINS_HOME on Red Hat Linux? I used this procedure to install Jenkins: [URL] After it was up and running I discovered the /var/lib/jenkins partition on my server is very small. I want to move it, but I do not want to change the user that it runs under. I am new to Linux and I'm stumped. How do I move it for example to my Home/Public folder? The "Jenkins" user doesn't seem to have a Home folder. Its running as a daemon on startup, so I have no idea where to configure those settings. Can I create a Home folder for the Jenkins user? How? I read this article: [URL] but do not understand HOW to "set the new Jenkins home". I have used the export command, and restarted the service, but the old path still shows up in the Manage Jenkins screens. I've read the 2-3 similar questions on stackoverflow also, but there's always a big missing piece for me. Where to find that file where I change the path permanently?
|
jenkins, redhat
| 30
| 98,861
| 9
|
https://stackoverflow.com/questions/21839538/change-jenkins-home-on-red-hat-linux
|
8,789,522
|
How to change the mysql root password
|
I have installed MySQL server 5 on redhat linux. I can't login as root so I can't change the root password. mysql -u root -p Enter password: <blank> ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO) When I try to set one like this: mysqladmin -u root password 'newpass' I get an error: mysqladmin: connect to server at 'localhost' failed error: 'Access denied for user 'root'@'localhost' (using password: NO)' As if there is a root password set. I have also tried resetting the password using (described here ) /sbin/service mysqld start --skip-grant-tables And then making: mysql> UPDATE mysql.user SET Password=PASSWORD('newpass') -> WHERE User='root'; ERROR 1142 (42000): UPDATE command denied to user ''@'localhost' for table 'user' I even uninstalled mysql-server (using yum) and then reinstalled it but that did not help. How do I force reset the root password?
|
How to change the mysql root password I have installed MySQL server 5 on redhat linux. I can't login as root so I can't change the root password. mysql -u root -p Enter password: <blank> ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO) When I try to set one like this: mysqladmin -u root password 'newpass' I get an error: mysqladmin: connect to server at 'localhost' failed error: 'Access denied for user 'root'@'localhost' (using password: NO)' As if there is a root password set. I have also tried resetting the password using (described here ) /sbin/service mysqld start --skip-grant-tables And then making: mysql> UPDATE mysql.user SET Password=PASSWORD('newpass') -> WHERE User='root'; ERROR 1142 (42000): UPDATE command denied to user ''@'localhost' for table 'user' I even uninstalled mysql-server (using yum) and then reinstalled it but that did not help. How do I force reset the root password?
|
mysql, linux, passwords, redhat
| 30
| 104,776
| 10
|
https://stackoverflow.com/questions/8789522/how-to-change-the-mysql-root-password
|
20,790,499
|
No implicit conversion of String into Integer (TypeError)?
|
I'm trying to write a script that will get a system ID from Red Hat Satellite/Spacewalk, which uses XMLRPC. I'm trying to get the ID which is the first value when using the XMLRPC client using the system name. I'm referencing the documentation from Red Hat for the method used below: #!/usr/bin/env ruby require "xmlrpc/client" @SATELLITE_URL = "satellite.rdu.salab.redhat.com" @SATELLITE_API = "/rpc/api" @SATELLITE_LOGIN = "********" @SATELLITE_PASSWORD = "*******" @client = XMLRPC::Client.new(@SATELLITE_URL, @SATELLITE_API) @key = @client.call("auth.login", @SATELLITE_LOGIN, @SATELLITE_PASSWORD) @getsystemid = @client.call("system.getId", @key, 'cfme038') print "#{@getsystemid}" @systemid = @getsystemid ['id'] The output of getsystemid looks like this: [{"id"=>1000010466, "name"=>"cfme038", "last_checkin"=>#<XMLRPC::DateTime:0x007f9581042428 @year=2013, @month=12, @day=26, @hour=14, @min=31, @sec=28>}] But when I try to just get just id I get this error: no implicit conversion of String into Integer (TypeError) Any help is appreciated
|
No implicit conversion of String into Integer (TypeError)? I'm trying to write a script that will get a system ID from Red Hat Satellite/Spacewalk, which uses XMLRPC. I'm trying to get the ID which is the first value when using the XMLRPC client using the system name. I'm referencing the documentation from Red Hat for the method used below: #!/usr/bin/env ruby require "xmlrpc/client" @SATELLITE_URL = "satellite.rdu.salab.redhat.com" @SATELLITE_API = "/rpc/api" @SATELLITE_LOGIN = "********" @SATELLITE_PASSWORD = "*******" @client = XMLRPC::Client.new(@SATELLITE_URL, @SATELLITE_API) @key = @client.call("auth.login", @SATELLITE_LOGIN, @SATELLITE_PASSWORD) @getsystemid = @client.call("system.getId", @key, 'cfme038') print "#{@getsystemid}" @systemid = @getsystemid ['id'] The output of getsystemid looks like this: [{"id"=>1000010466, "name"=>"cfme038", "last_checkin"=>#<XMLRPC::DateTime:0x007f9581042428 @year=2013, @month=12, @day=26, @hour=14, @min=31, @sec=28>}] But when I try to just get just id I get this error: no implicit conversion of String into Integer (TypeError) Any help is appreciated
|
ruby, redhat
| 28
| 117,377
| 1
|
https://stackoverflow.com/questions/20790499/no-implicit-conversion-of-string-into-integer-typeerror
|
37,313,677
|
What is the Difference between ConditionPathExists= and ConditionPathExists=| in systemd?
|
I need check a file not exist before i start my service in Systemd. I see two case in [Unit]: ConditionPathExists=!/tmp/abc and ConditionPathExists=|!/tmp/abc are they the same? Can anybody help me explain if they are different?
|
What is the Difference between ConditionPathExists= and ConditionPathExists=| in systemd? I need check a file not exist before i start my service in Systemd. I see two case in [Unit]: ConditionPathExists=!/tmp/abc and ConditionPathExists=|!/tmp/abc are they the same? Can anybody help me explain if they are different?
|
linux, redhat, systemd
| 28
| 28,371
| 1
|
https://stackoverflow.com/questions/37313677/what-is-the-difference-between-conditionpathexists-and-conditionpathexists-in
|
32,482,664
|
Symfony is linked to the wrong PHP version
|
I'm trying to move my Project to a linux redhat server that uses Apache but the problem I'm facing there is that this Server has 2 different PHP versions installed. Symfony (2.5.12) seems to look for the php executable at /usr/bin/php by default but there is a 5.2 version installed, which is needed for other projects. At /opt/rh/php55/root/usr/bin/php is an installed 5.5 version of PHP that I want to use for symfony. So how can I configure Symfony to use the php version that is installed at the custom path?
|
Symfony is linked to the wrong PHP version I'm trying to move my Project to a linux redhat server that uses Apache but the problem I'm facing there is that this Server has 2 different PHP versions installed. Symfony (2.5.12) seems to look for the php executable at /usr/bin/php by default but there is a 5.2 version installed, which is needed for other projects. At /opt/rh/php55/root/usr/bin/php is an installed 5.5 version of PHP that I want to use for symfony. So how can I configure Symfony to use the php version that is installed at the custom path?
|
php, symfony, redhat
| 27
| 43,679
| 6
|
https://stackoverflow.com/questions/32482664/symfony-is-linked-to-the-wrong-php-version
|
65,763,994
|
LibClamAV Error: cli_loaddbdir(): No supported database files found in /var/lib/clamav
|
When I tried to Scan the /home directory I got this error. [root@ip-172-31-34-67 ~]# clamscan /home LibClamAV Error: cli_loaddbdir(): No supported database files found in /var/lib/clamav ERROR: Can't open file or directory ----------- SCAN SUMMARY ----------- Known viruses: 0 Engine version: 0.103.0 Scanned directories: 0 Scanned files: 0 Infected files: 0 Data scanned: 0.00 MB Data read: 0.00 MB (ratio 0.00:1) Time: 0.004 sec (0 m 0 s) Start Date: 2021:01:17 17:43:31 End Date: 2021:01:17 17:43:31 [root@ip-172-31-34-67 ~]# It shows on supported database files found in /var/lib/clamav, which may caused the issue?
|
LibClamAV Error: cli_loaddbdir(): No supported database files found in /var/lib/clamav When I tried to Scan the /home directory I got this error. [root@ip-172-31-34-67 ~]# clamscan /home LibClamAV Error: cli_loaddbdir(): No supported database files found in /var/lib/clamav ERROR: Can't open file or directory ----------- SCAN SUMMARY ----------- Known viruses: 0 Engine version: 0.103.0 Scanned directories: 0 Scanned files: 0 Infected files: 0 Data scanned: 0.00 MB Data read: 0.00 MB (ratio 0.00:1) Time: 0.004 sec (0 m 0 s) Start Date: 2021:01:17 17:43:31 End Date: 2021:01:17 17:43:31 [root@ip-172-31-34-67 ~]# It shows on supported database files found in /var/lib/clamav, which may caused the issue?
|
linux, centos, redhat, clamav
| 26
| 30,702
| 4
|
https://stackoverflow.com/questions/65763994/libclamav-error-cli-loaddbdir-no-supported-database-files-found-in-var-lib
|
3,848,064
|
Building OpenLDAP from sources and missing BerkelyDB
|
I'm building OpenLDAP on a RHEL 5; I used instructions found at [URL] . All went well, until running './configure' for OpenLDAP - the following error was recorded: *<earlier output snipped>* checking for gethostbyaddr_r... yes checking number of arguments of ctime_r... 2 checking number of arguments of gethostbyname_r... 6 checking number of arguments of gethostbyaddr_r... 8 checking db.h usability... yes checking db.h presence... yes checking for db.h... yes checking for Berkeley DB major version in db.h... 5 checking for Berkeley DB minor version in db.h... 1 checking if Berkeley DB version supported by BDB/HDB backends... yes **checking for Berkeley DB link (default)... no configure: error: BDB/HDB: BerkeleyDB not available** I have Googled like a maniac but have been unsuccessful to find a resolution - any tips on areas to explore? Thanks
|
Building OpenLDAP from sources and missing BerkelyDB I'm building OpenLDAP on a RHEL 5; I used instructions found at [URL] . All went well, until running './configure' for OpenLDAP - the following error was recorded: *<earlier output snipped>* checking for gethostbyaddr_r... yes checking number of arguments of ctime_r... 2 checking number of arguments of gethostbyname_r... 6 checking number of arguments of gethostbyaddr_r... 8 checking db.h usability... yes checking db.h presence... yes checking for db.h... yes checking for Berkeley DB major version in db.h... 5 checking for Berkeley DB minor version in db.h... 1 checking if Berkeley DB version supported by BDB/HDB backends... yes **checking for Berkeley DB link (default)... no configure: error: BDB/HDB: BerkeleyDB not available** I have Googled like a maniac but have been unsuccessful to find a resolution - any tips on areas to explore? Thanks
|
redhat, berkeley-db, openldap
| 26
| 26,421
| 5
|
https://stackoverflow.com/questions/3848064/building-openldap-from-sources-and-missing-berkelydb
|
29,343,809
|
PHP is_writable() function always returns false for a writable directory
|
I'm trying to install a PHP-based software package in a Red Hat 7 Amazon EC2 instance (ami-8cff51fb) that has had Apache 2.4.6 and PHP 5.4.16 installed on it using yum. The installation fails because it says a particular directory needs to be writable by the webserver with 0755 or 0775 permissions. The directory in question has 0775 permissions with root:apache ownership. I have verified that the httpd process is being run by the apache user and that the apache user is a member of the apache group. If I edit /etc/passwd to temporarily give the apache user a login shell and then su to that account, I am able to manually create files as the apache user within the directory using the touch command. I took a look at the source code of the installer script and identified that it's failing because PHP's is_writable() function is returning false for the directory in question. I created a separate test PHP script to isolate and verify the behaviour I'm seeing: <?php $dir = '/var/www/html/limesurvey/tmp'; if (is_writable($dir)) { echo $dir, ' is writable'; } else { echo $dir, ' is NOT writable'; } ?> This outputs the NOT writable message. If I change $dir above to be /tmp then it correctly outputs that /tmp is writable. If I change the directory permissions to 0777 and/or change the ownership to apache:apache then PHP still reports that the directory isn't writable. I even tried creating a /test directory set up with the same permissions and ownership and my test script still reports it as not writable. I'm really at a loss as to explain this behaviour, so any ideas would be welcome! Thanks in advance. The directory listing for /var/www/html/limesurvey is given below. The tmp and upload directories have 0775 permissions as per Lime Survey's installation instructions . test.php is my test script mentioned above. [ec2-user@ip-xx-x-x-xxx limesurvey]$ pwd /var/www/html/limesurvey [ec2-user@ip-xx-x-x-xxx limesurvey]$ ls -al total 80 drwxr-xr-x. 20 root apache 4096 Mar 30 11:25 . drwxr-xr-x. 3 root root 23 Mar 25 14:41 .. drwxr-xr-x. 2 root apache 38 Mar 10 12:56 admin drwxr-xr-x. 16 root apache 4096 Mar 10 12:56 application drwxr-xr-x. 3 root apache 4096 Mar 10 12:56 docs drwxr-xr-x. 2 root apache 4096 Mar 10 12:56 fonts drwxr-xr-x. 19 root apache 4096 Mar 10 12:56 framework -rw-r--r--. 1 root apache 429 Mar 10 12:56 .gitattributes -rw-r--r--. 1 root apache 399 Mar 10 12:56 .gitignore -rw-r--r--. 1 root apache 296 Mar 10 12:56 .htaccess drwxr-xr-x. 4 root apache 4096 Mar 10 12:56 images -rw-r--r--. 1 root apache 6652 Mar 10 12:56 index.php drwxr-xr-x. 5 root apache 39 Mar 10 12:56 installer drwxr-xr-x. 89 root apache 4096 Mar 10 12:56 locale drwxrwxr-x. 2 root apache 39 Mar 25 14:41 logs drwxr-xr-x. 4 root apache 49 Mar 10 12:56 plugins -rw-r--r--. 1 root apache 61 Mar 10 12:56 README drwxr-xr-x. 4 root apache 4096 Mar 10 12:56 scripts -rw-r--r--. 1 root apache 380 Mar 10 12:56 .scrutinizer.yml drwxr-xr-x. 5 root apache 4096 Mar 10 12:56 styles drwxr-xr-x. 5 root apache 4096 Mar 10 12:56 styles-public drwxr-xr-x. 12 root apache 4096 Mar 10 12:56 templates -rw-r--r--. 1 root apache 159 Mar 30 11:11 test.php drwxr-xr-x. 3 root apache 20 Mar 10 12:56 themes drwxr-xr-x. 26 root apache 4096 Mar 10 12:56 third_party drwxrwxr-x. 5 root apache 80 Mar 26 13:45 tmp drwxrwxr-x. 6 root apache 79 Mar 10 12:57 upload Running namei -l /var/www/html/limesurvey/tmp gives: [ec2-user@ip-x-x-x-xxx ~]$ namei -l /var/www/html/limesurvey/tmp f: /var/www/html/limesurvey/tmp drwxr-xr-x root root / drwxr-xr-x root root var drwxr-xr-x root root www drwxr-xr-x root root html drwxr-xr-x root apache limesurvey drwxrwxr-x root apache tmp
|
PHP is_writable() function always returns false for a writable directory I'm trying to install a PHP-based software package in a Red Hat 7 Amazon EC2 instance (ami-8cff51fb) that has had Apache 2.4.6 and PHP 5.4.16 installed on it using yum. The installation fails because it says a particular directory needs to be writable by the webserver with 0755 or 0775 permissions. The directory in question has 0775 permissions with root:apache ownership. I have verified that the httpd process is being run by the apache user and that the apache user is a member of the apache group. If I edit /etc/passwd to temporarily give the apache user a login shell and then su to that account, I am able to manually create files as the apache user within the directory using the touch command. I took a look at the source code of the installer script and identified that it's failing because PHP's is_writable() function is returning false for the directory in question. I created a separate test PHP script to isolate and verify the behaviour I'm seeing: <?php $dir = '/var/www/html/limesurvey/tmp'; if (is_writable($dir)) { echo $dir, ' is writable'; } else { echo $dir, ' is NOT writable'; } ?> This outputs the NOT writable message. If I change $dir above to be /tmp then it correctly outputs that /tmp is writable. If I change the directory permissions to 0777 and/or change the ownership to apache:apache then PHP still reports that the directory isn't writable. I even tried creating a /test directory set up with the same permissions and ownership and my test script still reports it as not writable. I'm really at a loss as to explain this behaviour, so any ideas would be welcome! Thanks in advance. The directory listing for /var/www/html/limesurvey is given below. The tmp and upload directories have 0775 permissions as per Lime Survey's installation instructions . test.php is my test script mentioned above. [ec2-user@ip-xx-x-x-xxx limesurvey]$ pwd /var/www/html/limesurvey [ec2-user@ip-xx-x-x-xxx limesurvey]$ ls -al total 80 drwxr-xr-x. 20 root apache 4096 Mar 30 11:25 . drwxr-xr-x. 3 root root 23 Mar 25 14:41 .. drwxr-xr-x. 2 root apache 38 Mar 10 12:56 admin drwxr-xr-x. 16 root apache 4096 Mar 10 12:56 application drwxr-xr-x. 3 root apache 4096 Mar 10 12:56 docs drwxr-xr-x. 2 root apache 4096 Mar 10 12:56 fonts drwxr-xr-x. 19 root apache 4096 Mar 10 12:56 framework -rw-r--r--. 1 root apache 429 Mar 10 12:56 .gitattributes -rw-r--r--. 1 root apache 399 Mar 10 12:56 .gitignore -rw-r--r--. 1 root apache 296 Mar 10 12:56 .htaccess drwxr-xr-x. 4 root apache 4096 Mar 10 12:56 images -rw-r--r--. 1 root apache 6652 Mar 10 12:56 index.php drwxr-xr-x. 5 root apache 39 Mar 10 12:56 installer drwxr-xr-x. 89 root apache 4096 Mar 10 12:56 locale drwxrwxr-x. 2 root apache 39 Mar 25 14:41 logs drwxr-xr-x. 4 root apache 49 Mar 10 12:56 plugins -rw-r--r--. 1 root apache 61 Mar 10 12:56 README drwxr-xr-x. 4 root apache 4096 Mar 10 12:56 scripts -rw-r--r--. 1 root apache 380 Mar 10 12:56 .scrutinizer.yml drwxr-xr-x. 5 root apache 4096 Mar 10 12:56 styles drwxr-xr-x. 5 root apache 4096 Mar 10 12:56 styles-public drwxr-xr-x. 12 root apache 4096 Mar 10 12:56 templates -rw-r--r--. 1 root apache 159 Mar 30 11:11 test.php drwxr-xr-x. 3 root apache 20 Mar 10 12:56 themes drwxr-xr-x. 26 root apache 4096 Mar 10 12:56 third_party drwxrwxr-x. 5 root apache 80 Mar 26 13:45 tmp drwxrwxr-x. 6 root apache 79 Mar 10 12:57 upload Running namei -l /var/www/html/limesurvey/tmp gives: [ec2-user@ip-x-x-x-xxx ~]$ namei -l /var/www/html/limesurvey/tmp f: /var/www/html/limesurvey/tmp drwxr-xr-x root root / drwxr-xr-x root root var drwxr-xr-x root root www drwxr-xr-x root root html drwxr-xr-x root apache limesurvey drwxrwxr-x root apache tmp
|
php, linux, amazon-ec2, redhat, rhel7
| 26
| 19,763
| 5
|
https://stackoverflow.com/questions/29343809/php-is-writable-function-always-returns-false-for-a-writable-directory
|
56,361,133
|
How to fix ModuleNotFoundError: No module named 'pip._internal' with python source code installation
|
I have installed python3.7 on redhat machine by compiling source code but I have a problem when dealing with pip3. I have made this steps after installation: sudo ln /usr/local/bin/python3.7 /usr/bin/python3 sudo ln /usr/local/bin/pip3.7 /usr/bin/pip3 python3 -- version gives Python 3.7.3 But I have this errors by running these commands : python3 -m pip install requests gives /usr/bin/python3: No module named pip.__main__; 'pip' is a package and cannot be directly executed pip3 install requests gives ModuleNotFoundError: No module named 'pip._internal'
|
How to fix ModuleNotFoundError: No module named 'pip._internal' with python source code installation I have installed python3.7 on redhat machine by compiling source code but I have a problem when dealing with pip3. I have made this steps after installation: sudo ln /usr/local/bin/python3.7 /usr/bin/python3 sudo ln /usr/local/bin/pip3.7 /usr/bin/pip3 python3 -- version gives Python 3.7.3 But I have this errors by running these commands : python3 -m pip install requests gives /usr/bin/python3: No module named pip.__main__; 'pip' is a package and cannot be directly executed pip3 install requests gives ModuleNotFoundError: No module named 'pip._internal'
|
python, python-3.x, pip, redhat
| 25
| 36,431
| 4
|
https://stackoverflow.com/questions/56361133/how-to-fix-modulenotfounderror-no-module-named-pip-internal-with-python-sour
|
8,200,633
|
What's the difference between rpm and yum?
|
Is there any difference between rpm and yum? I know the recent system prefer yum, but want to know if there is need for rpm also.
|
What's the difference between rpm and yum? Is there any difference between rpm and yum? I know the recent system prefer yum, but want to know if there is need for rpm also.
|
centos, redhat, fedora, yum, rhel
| 25
| 26,801
| 2
|
https://stackoverflow.com/questions/8200633/whats-the-difference-between-rpm-and-yum
|
48,930,281
|
Export all users from KeyCloak
|
I have a specific use case in which we want to ask Keycloak for all the users and the groups and roles for each user, on a daily basis. For reconciliation purposes with other internal systems. Currently we are using the provided Keycloak endpoints in the UsersResource for this. But we see that performance slows down after each call to a point we can't use this solution anymore. There are more then 30K users in the realm. We've also seen that Keycloak can export the database, but only on system boot (I guess for migration purposes). Given that we want to extract all the users on a daily basis we cannot use this. Are there some known functionalities or workarounds?
|
Export all users from KeyCloak I have a specific use case in which we want to ask Keycloak for all the users and the groups and roles for each user, on a daily basis. For reconciliation purposes with other internal systems. Currently we are using the provided Keycloak endpoints in the UsersResource for this. But we see that performance slows down after each call to a point we can't use this solution anymore. There are more then 30K users in the realm. We've also seen that Keycloak can export the database, but only on system boot (I guess for migration purposes). Given that we want to extract all the users on a daily basis we cannot use this. Are there some known functionalities or workarounds?
|
java, redhat, keycloak, keycloak-services, redhat-sso
| 25
| 65,366
| 4
|
https://stackoverflow.com/questions/48930281/export-all-users-from-keycloak
|
2,777,737
|
How to set the rpmbuild destination folder
|
I noticed rpmbuild (-bb and --buildroot options) creates the .rpm in different locations depending of what OS are you using: GNU/Linux Ubuntu <= 9.04: /usr/src/rpm/... GNU/Linux Ubuntu >= 9.10: /home/rpmbuild/... GNU/Linux Fedora: /usr/src/redhat/... So how can I set manually the destination folder for all OS?
|
How to set the rpmbuild destination folder I noticed rpmbuild (-bb and --buildroot options) creates the .rpm in different locations depending of what OS are you using: GNU/Linux Ubuntu <= 9.04: /usr/src/rpm/... GNU/Linux Ubuntu >= 9.10: /home/rpmbuild/... GNU/Linux Fedora: /usr/src/redhat/... So how can I set manually the destination folder for all OS?
|
redhat, rpm, rpmbuild
| 25
| 20,625
| 5
|
https://stackoverflow.com/questions/2777737/how-to-set-the-rpmbuild-destination-folder
|
4,669,420
|
Have you ever got this message when moving a file? mv: will not overwrite just-created
|
I have a bourne shell script which performs several tasks. One of these tasks is to move some files to certain directory. Today, when I ran the script I got the following message: mv: will not overwrite just-created <filename> with <sameFilename> where filename is the original file name with its full path, and sameFilename is exactly the same file and path. I regularly use this script every day and never got this message before. Right after running the script i re-run it to see if the error persisted, and I was not able to reproduce it again. I am running this script in a Red Hat 5 Enterprise.
|
Have you ever got this message when moving a file? mv: will not overwrite just-created I have a bourne shell script which performs several tasks. One of these tasks is to move some files to certain directory. Today, when I ran the script I got the following message: mv: will not overwrite just-created <filename> with <sameFilename> where filename is the original file name with its full path, and sameFilename is exactly the same file and path. I regularly use this script every day and never got this message before. Right after running the script i re-run it to see if the error persisted, and I was not able to reproduce it again. I am running this script in a Red Hat 5 Enterprise.
|
shell, move, redhat, overwrite
| 25
| 26,118
| 2
|
https://stackoverflow.com/questions/4669420/have-you-ever-got-this-message-when-moving-a-file-mv-will-not-overwrite-just-c
|
40,593,242
|
Systemd: Using both After and Requires
|
I have a service foo.service which depends on service bar.service . I need to make sure that bar.service is started before foo.service and that bar.service launched successfully. From this source it says that Requires : This directive lists any units upon which this unit essentially depends. If the current unit is activated, the units listed here must successfully activate as well, else this unit will fail. These units are started in parallel with the current unit by default. and that After : The units listed in this directive will be started before starting the current unit. This does not imply a dependency relationship and one must be established through the above directives if this is required. Is it correct to have both the Requires and After sections in the same unit file? Requires says that the service will be launched in parallel, but After says it will be launched before. If bar.service fails to start during the After condition, will it attempt to launch it again during the Requires section? If so I need to find another way to launch foo.service foo.service [Unit] After=bar.service Requires=bar.service
|
Systemd: Using both After and Requires I have a service foo.service which depends on service bar.service . I need to make sure that bar.service is started before foo.service and that bar.service launched successfully. From this source it says that Requires : This directive lists any units upon which this unit essentially depends. If the current unit is activated, the units listed here must successfully activate as well, else this unit will fail. These units are started in parallel with the current unit by default. and that After : The units listed in this directive will be started before starting the current unit. This does not imply a dependency relationship and one must be established through the above directives if this is required. Is it correct to have both the Requires and After sections in the same unit file? Requires says that the service will be launched in parallel, but After says it will be launched before. If bar.service fails to start during the After condition, will it attempt to launch it again during the Requires section? If so I need to find another way to launch foo.service foo.service [Unit] After=bar.service Requires=bar.service
|
linux, redhat, systemd
| 24
| 28,154
| 2
|
https://stackoverflow.com/questions/40593242/systemd-using-both-after-and-requires
|
11,688,819
|
How to configure Django on OpenShift?
|
I recently tried to export a Django project on OpenShift, but fruitlessly. The only solutions I found were "prebuilt" ones (such as [URL] ). I spent some hours trying to adapt it to my project but I always got an Internal Server Error. So, how to setup django on openshift?
|
How to configure Django on OpenShift? I recently tried to export a Django project on OpenShift, but fruitlessly. The only solutions I found were "prebuilt" ones (such as [URL] ). I spent some hours trying to adapt it to my project but I always got an Internal Server Error. So, how to setup django on openshift?
|
python, django, openshift, redhat
| 24
| 10,440
| 1
|
https://stackoverflow.com/questions/11688819/how-to-configure-django-on-openshift
|
5,974,403
|
How to find whether MySQL is installed in Red Hat?
|
I am currently using Red Hat linux. I just want to find out whether MySQL is installed in that system. If yes where is it located? can anyone help please...
|
How to find whether MySQL is installed in Red Hat? I am currently using Red Hat linux. I just want to find out whether MySQL is installed in that system. If yes where is it located? can anyone help please...
|
linux, redhat, status
| 23
| 112,159
| 6
|
https://stackoverflow.com/questions/5974403/how-to-find-whether-mysql-is-installed-in-red-hat
|
15,164,520
|
Determine Redhat Linux Version
|
How do I determine which RedHat Linux version I am running? Here's what I've read: /etc/redhat-release file contains the version, but anybody can tamper with that file. people say uname command, but you can install any kernel on Redhat. If I am running redhat 5.1 and someone upgrade it with 5.2 or 5.x, what determines the version of RedHat? even lsb_release -a read /etc/redhat-release file.
|
Determine Redhat Linux Version How do I determine which RedHat Linux version I am running? Here's what I've read: /etc/redhat-release file contains the version, but anybody can tamper with that file. people say uname command, but you can install any kernel on Redhat. If I am running redhat 5.1 and someone upgrade it with 5.2 or 5.x, what determines the version of RedHat? even lsb_release -a read /etc/redhat-release file.
|
linux, release, redhat
| 23
| 74,426
| 9
|
https://stackoverflow.com/questions/15164520/determine-redhat-linux-version
|
1,212,925
|
On Linux - set maximum open files to unlimited. Possible?
|
Is it possible to set the maximum number of open files to some "infinite" value or must it be a number? I had a requirement to set the descriptor limit for a daemon user to be "unlimited" and I'm trying to determine if that's possible or how to do it. I've seen some mailing lists refer to a "max" value that can be used (as in: "myuser hard nofile max", but so far the man pages and references I've consulted don't back that up. If I can't use 'max' or similar, I'd like to know how to determine what the max number of files is (theoretically) so I have some basis for whatever number I pick. I don't want to use 100000000 or something if there's a more reasonable way to get an upper bound. I'm using RHEL 5 if it's important. Update: I'm an idiot when it comes to writing questions. Ideally I'd like to do this in the limits.conf file (which is where "max" would come from). Does that change any answers? Thanks for the comments. This is for a JBOSS instance and not a daemon I'm writing so I don't know if setrlimit() is useful to me. However, Jefromi - I do like the definition of Infinity :) I saw a post that suggests a file descriptor is "two shorts and a pointer" so I should be able to calculate the approximate upper bound.
|
On Linux - set maximum open files to unlimited. Possible? Is it possible to set the maximum number of open files to some "infinite" value or must it be a number? I had a requirement to set the descriptor limit for a daemon user to be "unlimited" and I'm trying to determine if that's possible or how to do it. I've seen some mailing lists refer to a "max" value that can be used (as in: "myuser hard nofile max", but so far the man pages and references I've consulted don't back that up. If I can't use 'max' or similar, I'd like to know how to determine what the max number of files is (theoretically) so I have some basis for whatever number I pick. I don't want to use 100000000 or something if there's a more reasonable way to get an upper bound. I'm using RHEL 5 if it's important. Update: I'm an idiot when it comes to writing questions. Ideally I'd like to do this in the limits.conf file (which is where "max" would come from). Does that change any answers? Thanks for the comments. This is for a JBOSS instance and not a daemon I'm writing so I don't know if setrlimit() is useful to me. However, Jefromi - I do like the definition of Infinity :) I saw a post that suggests a file descriptor is "two shorts and a pointer" so I should be able to calculate the approximate upper bound.
|
linux, kernel, redhat
| 23
| 52,190
| 2
|
https://stackoverflow.com/questions/1212925/on-linux-set-maximum-open-files-to-unlimited-possible
|
11,418,540
|
JTextField Issues with Numpad
|
I've recently run into a strange issue with the Java JTextField. When I run the following code (see below), typing a "0" into the text field first sends a paste action, then types "0". For example, if "text" is copied to the clipboard, "text0" is typed when I type "0". Similarly, typing a "4" replaces the previous character with a "4" (I'm guessing this is a delete action, then the "4" is typed). Typing "7" clears the text field before typing "7". Here is the code: import javax.swing.JFrame; import javax.swing.JTextField; public class Main { public static void main(String[] args) { JFrame frame = new JFrame(); JTextField text = new JTextField(); frame.add(text); frame.setSize(500, 500); frame.setVisible(true); } } The problem is occurring on Red Hat Linux (accessed using VNC from Windows XP); everything runs as expected on Window XP. Update : No problems with the program on Ubuntu either. I've also tried using different keyboards and VNC viewers. Update 2 : Java Versions For Red Hat: java version "1.6.0_17" OpenJDK Runtime Environment (IcedTea6 1.7.7) (rhel-1.17.b17.el5-x86_64) OpenJDK 64-Bit Server VM (build 14.0-b16, mixed mode) For XP: java version "1.7.0_05" Java(TM) SE Runtime Environment (build 1.7.0_05-b05) Java HotSpot(TM) Client VM (build 23.1-b03, mixed mode, sharing) Update 3 : Tried running the program on three different Red Hat machines (all in the same group at work), and additionally tried running it from a different XP computer and restarting. Update 4 : Today I arrived at work to find that the problem had magically gone away. However, it'd really be nice to know why it happened in the first place so that I (and anyone else who many encounter this strange issue) know how to fix it in the future.
|
JTextField Issues with Numpad I've recently run into a strange issue with the Java JTextField. When I run the following code (see below), typing a "0" into the text field first sends a paste action, then types "0". For example, if "text" is copied to the clipboard, "text0" is typed when I type "0". Similarly, typing a "4" replaces the previous character with a "4" (I'm guessing this is a delete action, then the "4" is typed). Typing "7" clears the text field before typing "7". Here is the code: import javax.swing.JFrame; import javax.swing.JTextField; public class Main { public static void main(String[] args) { JFrame frame = new JFrame(); JTextField text = new JTextField(); frame.add(text); frame.setSize(500, 500); frame.setVisible(true); } } The problem is occurring on Red Hat Linux (accessed using VNC from Windows XP); everything runs as expected on Window XP. Update : No problems with the program on Ubuntu either. I've also tried using different keyboards and VNC viewers. Update 2 : Java Versions For Red Hat: java version "1.6.0_17" OpenJDK Runtime Environment (IcedTea6 1.7.7) (rhel-1.17.b17.el5-x86_64) OpenJDK 64-Bit Server VM (build 14.0-b16, mixed mode) For XP: java version "1.7.0_05" Java(TM) SE Runtime Environment (build 1.7.0_05-b05) Java HotSpot(TM) Client VM (build 23.1-b03, mixed mode, sharing) Update 3 : Tried running the program on three different Red Hat machines (all in the same group at work), and additionally tried running it from a different XP computer and restarting. Update 4 : Today I arrived at work to find that the problem had magically gone away. However, it'd really be nice to know why it happened in the first place so that I (and anyone else who many encounter this strange issue) know how to fix it in the future.
|
java, linux, jtextfield, redhat, numpad
| 23
| 1,593
| 5
|
https://stackoverflow.com/questions/11418540/jtextfield-issues-with-numpad
|
26,123,740
|
Is it possible to install aws-cli package without root permission?
|
As title suggested, I haven't been able to find a good way to install aws-cli ( [URL] ) without having the root access (or equivalent of sudo privileges). The way Homebrew setup on Mac is hinting at it may be possible, provided that a few directories and permissions are set in a way to facility future installs. However, I have yet to find any approach in Linux (specially, Red Hat Enterprise Linux or CentOS distroes). I am also aware of SCL from RHEL ( [URL] ) But again, it requires sudo .
|
Is it possible to install aws-cli package without root permission? As title suggested, I haven't been able to find a good way to install aws-cli ( [URL] ) without having the root access (or equivalent of sudo privileges). The way Homebrew setup on Mac is hinting at it may be possible, provided that a few directories and permissions are set in a way to facility future installs. However, I have yet to find any approach in Linux (specially, Red Hat Enterprise Linux or CentOS distroes). I am also aware of SCL from RHEL ( [URL] ) But again, it requires sudo .
|
amazon-web-services, centos, redhat, aws-cli
| 22
| 34,267
| 8
|
https://stackoverflow.com/questions/26123740/is-it-possible-to-install-aws-cli-package-without-root-permission
|
13,401,727
|
rpmbuild Installed (but unpackaged) files source
|
I'm trying to build an RPM from binaries on a REDHAT 6 system. I have all the files included in the %files section ( find /path/to/fake/install -type f >> specfile ) When I run rpmbuild -bb specfile --target x86_64 I get Checking for unpackaged file(s): /usr/lib/rpm/check-files /path/to/rpmbuild/BUILDROOT/Package-1.0.0-1.el6.x86_64 error: Installed (but unpackaged) file(s) found: RPM build errors: Installed (but unpackaged) file(s) found: Note that no files are listed in the error message. I'm not sure what's wrong, any ideas?
|
rpmbuild Installed (but unpackaged) files source I'm trying to build an RPM from binaries on a REDHAT 6 system. I have all the files included in the %files section ( find /path/to/fake/install -type f >> specfile ) When I run rpmbuild -bb specfile --target x86_64 I get Checking for unpackaged file(s): /usr/lib/rpm/check-files /path/to/rpmbuild/BUILDROOT/Package-1.0.0-1.el6.x86_64 error: Installed (but unpackaged) file(s) found: RPM build errors: Installed (but unpackaged) file(s) found: Note that no files are listed in the error message. I'm not sure what's wrong, any ideas?
|
linux, packaging, redhat, rpm, rpmbuild
| 22
| 46,375
| 3
|
https://stackoverflow.com/questions/13401727/rpmbuild-installed-but-unpackaged-files-source
|
21,264,601
|
Permanently enable RHEL scl
|
Is there a way to permanently enable custom Software Collections for RedHat? I have installed an scl to provide python27 in RHEL6 and don't want to have to enable the custom scl every time.
|
Permanently enable RHEL scl Is there a way to permanently enable custom Software Collections for RedHat? I have installed an scl to provide python27 in RHEL6 and don't want to have to enable the custom scl every time.
|
redhat, rhel, software-collections, rhel-scl
| 22
| 15,898
| 3
|
https://stackoverflow.com/questions/21264601/permanently-enable-rhel-scl
|
43,993,890
|
ModuleNotFoundError: No module named '_sqlite3'
|
On Redhat 4.4.7-18 I am trying to run python3 code using sqlite, but I get the following import error: Traceback (most recent call last): File "database.py", line 7, in <module> import sqlite3 File "/usr/local/lib/python3.6/sqlite3/__init__.py", line 23, in <module> from sqlite3.dbapi2 import * File "/usr/local/lib/python3.6/sqlite3/dbapi2.py", line 27, in <module> from _sqlite3 import * ModuleNotFoundError: No module named '_sqlite3' I tried to install it: >sudo pip install sqlite3 Collecting sqlite3 Retrying (Retry(total=4, connect=None, read=None, redirect=None)) after connection broken by 'ProtocolError('Connection aborted.', error(101, 'Network is unreachable'))': /simple/sqlite3/ (while the network is reachable...) and with the following command: > sudo yum install sqlite-devel Loaded plugins: post-transaction-actions, product-id, refresh-packagekit, : rhnplugin, search-disabled-repos, security, subscription-manager This system is receiving updates from RHN Classic or RHN Satellite. Setting up Install Process Package sqlite-devel-3.6.20-1.el6_7.2.x86_64 already installed and latest version Nothing to do So it is installed and not installed? Any suggestion how I can solve the original problem?
|
ModuleNotFoundError: No module named '_sqlite3' On Redhat 4.4.7-18 I am trying to run python3 code using sqlite, but I get the following import error: Traceback (most recent call last): File "database.py", line 7, in <module> import sqlite3 File "/usr/local/lib/python3.6/sqlite3/__init__.py", line 23, in <module> from sqlite3.dbapi2 import * File "/usr/local/lib/python3.6/sqlite3/dbapi2.py", line 27, in <module> from _sqlite3 import * ModuleNotFoundError: No module named '_sqlite3' I tried to install it: >sudo pip install sqlite3 Collecting sqlite3 Retrying (Retry(total=4, connect=None, read=None, redirect=None)) after connection broken by 'ProtocolError('Connection aborted.', error(101, 'Network is unreachable'))': /simple/sqlite3/ (while the network is reachable...) and with the following command: > sudo yum install sqlite-devel Loaded plugins: post-transaction-actions, product-id, refresh-packagekit, : rhnplugin, search-disabled-repos, security, subscription-manager This system is receiving updates from RHN Classic or RHN Satellite. Setting up Install Process Package sqlite-devel-3.6.20-1.el6_7.2.x86_64 already installed and latest version Nothing to do So it is installed and not installed? Any suggestion how I can solve the original problem?
|
python-3.x, sqlite, redhat
| 21
| 65,883
| 4
|
https://stackoverflow.com/questions/43993890/modulenotfounderror-no-module-named-sqlite3
|
69,539,286
|
How to compile python3 on RHEL with SSL? SSL cannot be imported
|
I'm trying to compile python on RHEL because my current python is using an old 1.0.2k ssl version. (test_env) [brad@reason tlscheck]$ python3 --version Python 3.9.3 (test_env) [brad@reason tlscheck]$ python3 -c "import ssl; print(ssl.OPENSSL_VERSION)" OpenSSL 1.0.2k-fips 26 Jan 2017 (test_env) [brad@reason tlscheck]$ openssl version OpenSSL 1.1.1l 24 Aug 2021 I think the issue is that when I compiled 3.9.3, I had not updated my OpenSSL version. I have since updated my OpenSSL and need to use it with python. So I have downloaded the newest python 3.10, but in the make stage I get an error that it will not make with ssl. I the following message: Following modules built successfully but were removed because they could not be imported: _hashlib _ssl Could not build the ssl module! Python requires a OpenSSL 1.1.1 or newer This is the full log of trying to compile: [URL] When I use the configure options that @tony-yip mentioned, I get the following in my configure. checking for openssl/ssl.h in /etc/ssl... no checking whether compiling and linking against OpenSSL works... no I'm determining my openssl location with: [brad@reason Python-3.10.0]$ openssl version -d OPENSSLDIR: "/etc/ssl" To configure, I'm using: ./configure --with-openssl="/etc/ssl" When I look for ssl.h, I find it in /usr/include/openssl . So I linked this directory to lib in /etc/ssl , but it was no help. [brad@reason Python-3.10.0]$ ls -l /etc/ssl total 40 lrwxrwxrwx 1 root root 16 Jul 16 2020 certs -> ../pki/tls/certs -rw-r--r-- 1 root root 412 Oct 12 02:53 ct_log_list.cnf -rw-r--r-- 1 root root 412 Oct 12 02:53 ct_log_list.cnf.dist lrwxrwxrwx 1 root root 20 Oct 18 10:22 lib -> /usr/include/openssl drwxr-xr-x 2 root root 4096 Oct 12 02:53 misc -rw-r--r-- 1 root root 10909 Oct 12 02:53 openssl.cnf -rw-r--r-- 1 root root 10909 Oct 12 02:53 openssl.cnf.dist drwxr-xr-x 2 root root 4096 Oct 12 02:53 private [brad@reason Python-3.10.0]$ sudo find / -name ssl.h | grep include find: ‘/tmp/.mount_jetbraAJFEnl’: Permission denied /home/brad/Downloads/freerdp-2.0.0-rc4/winpr/include/winpr/ssl.h /home/brad/Downloads/FreeRDP/winpr/include/winpr/ssl.h /home/brad/Development/tlscheck/openssl-1.1.1l/include/openssl/ssl.h /usr/include/openssl/ssl.h /var/lib/docker/overlay2/23e6f3c164ec8939352891c99393669df4ed6e66da1e04ce84616073f08c6051/diff/usr/include/openssl/ssl.h /var/lib/flatpak/runtime/org.freedesktop.Sdk/x86_64/18.08/c8075e929daaffcbe5c78c9e87c0f0463d75e90d2b59c92355fa486e79c7d0e3/files/include/nss/ssl.h /var/lib/flatpak/runtime/org.freedesktop.Sdk/x86_64/18.08/c8075e929daaffcbe5c78c9e87c0f0463d75e90d2b59c92355fa486e79c7d0e3/files/include/openssl/ssl.h find: ‘/run/user/1000/gvfs’: Permission denied This may be extraneous information, but my libssl.so is here: [brad@reason Python-3.10.0]$ ls /usr/lib64 | grep ssl libevent_openssl-2.0.so.5 libevent_openssl-2.0.so.5.1.9 libssl3.so libssl.so libssl.so.10 libssl.so.1.0.2k openssl Any thoughts on why make isn't able to include ssl, please let me know. Thanks.
|
How to compile python3 on RHEL with SSL? SSL cannot be imported I'm trying to compile python on RHEL because my current python is using an old 1.0.2k ssl version. (test_env) [brad@reason tlscheck]$ python3 --version Python 3.9.3 (test_env) [brad@reason tlscheck]$ python3 -c "import ssl; print(ssl.OPENSSL_VERSION)" OpenSSL 1.0.2k-fips 26 Jan 2017 (test_env) [brad@reason tlscheck]$ openssl version OpenSSL 1.1.1l 24 Aug 2021 I think the issue is that when I compiled 3.9.3, I had not updated my OpenSSL version. I have since updated my OpenSSL and need to use it with python. So I have downloaded the newest python 3.10, but in the make stage I get an error that it will not make with ssl. I the following message: Following modules built successfully but were removed because they could not be imported: _hashlib _ssl Could not build the ssl module! Python requires a OpenSSL 1.1.1 or newer This is the full log of trying to compile: [URL] When I use the configure options that @tony-yip mentioned, I get the following in my configure. checking for openssl/ssl.h in /etc/ssl... no checking whether compiling and linking against OpenSSL works... no I'm determining my openssl location with: [brad@reason Python-3.10.0]$ openssl version -d OPENSSLDIR: "/etc/ssl" To configure, I'm using: ./configure --with-openssl="/etc/ssl" When I look for ssl.h, I find it in /usr/include/openssl . So I linked this directory to lib in /etc/ssl , but it was no help. [brad@reason Python-3.10.0]$ ls -l /etc/ssl total 40 lrwxrwxrwx 1 root root 16 Jul 16 2020 certs -> ../pki/tls/certs -rw-r--r-- 1 root root 412 Oct 12 02:53 ct_log_list.cnf -rw-r--r-- 1 root root 412 Oct 12 02:53 ct_log_list.cnf.dist lrwxrwxrwx 1 root root 20 Oct 18 10:22 lib -> /usr/include/openssl drwxr-xr-x 2 root root 4096 Oct 12 02:53 misc -rw-r--r-- 1 root root 10909 Oct 12 02:53 openssl.cnf -rw-r--r-- 1 root root 10909 Oct 12 02:53 openssl.cnf.dist drwxr-xr-x 2 root root 4096 Oct 12 02:53 private [brad@reason Python-3.10.0]$ sudo find / -name ssl.h | grep include find: ‘/tmp/.mount_jetbraAJFEnl’: Permission denied /home/brad/Downloads/freerdp-2.0.0-rc4/winpr/include/winpr/ssl.h /home/brad/Downloads/FreeRDP/winpr/include/winpr/ssl.h /home/brad/Development/tlscheck/openssl-1.1.1l/include/openssl/ssl.h /usr/include/openssl/ssl.h /var/lib/docker/overlay2/23e6f3c164ec8939352891c99393669df4ed6e66da1e04ce84616073f08c6051/diff/usr/include/openssl/ssl.h /var/lib/flatpak/runtime/org.freedesktop.Sdk/x86_64/18.08/c8075e929daaffcbe5c78c9e87c0f0463d75e90d2b59c92355fa486e79c7d0e3/files/include/nss/ssl.h /var/lib/flatpak/runtime/org.freedesktop.Sdk/x86_64/18.08/c8075e929daaffcbe5c78c9e87c0f0463d75e90d2b59c92355fa486e79c7d0e3/files/include/openssl/ssl.h find: ‘/run/user/1000/gvfs’: Permission denied This may be extraneous information, but my libssl.so is here: [brad@reason Python-3.10.0]$ ls /usr/lib64 | grep ssl libevent_openssl-2.0.so.5 libevent_openssl-2.0.so.5.1.9 libssl3.so libssl.so libssl.so.10 libssl.so.1.0.2k openssl Any thoughts on why make isn't able to include ssl, please let me know. Thanks.
|
python, ssl, openssl, redhat
| 21
| 22,687
| 5
|
https://stackoverflow.com/questions/69539286/how-to-compile-python3-on-rhel-with-ssl-ssl-cannot-be-imported
|
30,665,912
|
No ruby-devel in RHEL7?
|
I have a recently installed RHEL7 system, and need to do gem install jekyll, however this fails as: Fetching: yajl-ruby-1.2.1.gem (100%) Building native extensions. This could take a while... ERROR: Error installing jekyll: ERROR: Failed to build gem native extension. /usr/bin/ruby extconf.rb mkmf.rb can't find header files for ruby at /usr/share/include/ruby.h Google suggest this is due to the lack of a ruby-devel package being installed. However there doesn't seem to be such a package in RHEL7. Do I need to move to a software collection (don't really want to do this as this will be for a production machine, not development) or can I get it some other way?
|
No ruby-devel in RHEL7? I have a recently installed RHEL7 system, and need to do gem install jekyll, however this fails as: Fetching: yajl-ruby-1.2.1.gem (100%) Building native extensions. This could take a while... ERROR: Error installing jekyll: ERROR: Failed to build gem native extension. /usr/bin/ruby extconf.rb mkmf.rb can't find header files for ruby at /usr/share/include/ruby.h Google suggest this is due to the lack of a ruby-devel package being installed. However there doesn't seem to be such a package in RHEL7. Do I need to move to a software collection (don't really want to do this as this will be for a production machine, not development) or can I get it some other way?
|
ruby, redhat
| 21
| 25,593
| 8
|
https://stackoverflow.com/questions/30665912/no-ruby-devel-in-rhel7
|
139,605
|
Where to find packages names and versions for RedHat?
|
How can I find out whether a specific RedHat release (RHEL4, RHEL5...) contains a certain package (or a certain version of a package)? For Debian and Ubuntu, there's packages.debian.org and packages.ubuntu.com; is there a similar web site for RedHat? Note: I don't want to have to install all the releases just to check some package version :-)
|
Where to find packages names and versions for RedHat? How can I find out whether a specific RedHat release (RHEL4, RHEL5...) contains a certain package (or a certain version of a package)? For Debian and Ubuntu, there's packages.debian.org and packages.ubuntu.com; is there a similar web site for RedHat? Note: I don't want to have to install all the releases just to check some package version :-)
|
linux, package, redhat, rpm
| 21
| 25,269
| 7
|
https://stackoverflow.com/questions/139605/where-to-find-packages-names-and-versions-for-redhat
|
44,034,752
|
how to decide the memory requirement for my elasticsearch server
|
I have a scenario here, The Elasticsearch DB with about 1.4 TB of data having, _shards": { "total": 202, "successful": 101, "failed": 0 } Each index size is approximately between, 3 GB to 30 GB and in near future, it is expected to have 30GB file size on a daily basis. OS information: NAME="Red Hat Enterprise Linux Server" VERSION="7.2 (Maipo)" ID="rhel" ID_LIKE="fedora" VERSION_ID="7.2" PRETTY_NAME="Red Hat Enterprise Linux Server 7.2 (Maipo)" The system has 32 GB of RAM and the filesystem is 2TB (1.4TB Utilised). I have configured a maximum of 15 GB for Elasticsearch server. But this is not enough for me to query this DB. The server hangs for a single query hit on server. I will be including 1TB on the filesystem in this server so that the total available filesystem size will be 3TB. also I am planning to increase the memory to 128GB which is an approximate estimation. Could someone help me calculate how to determine the minimum RAM required for a server to respond at least 50 requests simultaneously? It would be greatly appreciated if you can suggest any tool/ formula to analyze this requirement. also it will be helpful if you can give me any other scenario with numbers so that I can use that to determine my resource need.
|
how to decide the memory requirement for my elasticsearch server I have a scenario here, The Elasticsearch DB with about 1.4 TB of data having, _shards": { "total": 202, "successful": 101, "failed": 0 } Each index size is approximately between, 3 GB to 30 GB and in near future, it is expected to have 30GB file size on a daily basis. OS information: NAME="Red Hat Enterprise Linux Server" VERSION="7.2 (Maipo)" ID="rhel" ID_LIKE="fedora" VERSION_ID="7.2" PRETTY_NAME="Red Hat Enterprise Linux Server 7.2 (Maipo)" The system has 32 GB of RAM and the filesystem is 2TB (1.4TB Utilised). I have configured a maximum of 15 GB for Elasticsearch server. But this is not enough for me to query this DB. The server hangs for a single query hit on server. I will be including 1TB on the filesystem in this server so that the total available filesystem size will be 3TB. also I am planning to increase the memory to 128GB which is an approximate estimation. Could someone help me calculate how to determine the minimum RAM required for a server to respond at least 50 requests simultaneously? It would be greatly appreciated if you can suggest any tool/ formula to analyze this requirement. also it will be helpful if you can give me any other scenario with numbers so that I can use that to determine my resource need.
|
elasticsearch, memory, filesystems, redhat
| 21
| 53,692
| 3
|
https://stackoverflow.com/questions/44034752/how-to-decide-the-memory-requirement-for-my-elasticsearch-server
|
End of preview. Expand
in Data Studio
No dataset card yet
- Downloads last month
- 13