Unix & Linux Stack Exchange
Q&A for users of Linux, FreeBSD and other Unix-like operating systems
Latest Questions
7
votes
1
answers
3461
views
How to run start up scripts on Amazon linux?
I'm trying to create some script that should run on start. Now I've created some myScript file under the /etc/init.d/ and then run `sudo chkconfig --add myScript;` `chkconfig --list myScript` output is: myScript 0:off 1:off 2:on 3:on 4:on 5:on 6:off **myScript:** #!/bin/sh # chkconfig: 2345 98 02 #...
I'm trying to create some script that should run on start.
Now I've created some myScript file under the /etc/init.d/
and then run
myScript 0:off 1:off 2:on 3:on 4:on 5:on 6:off **myScript:** #!/bin/sh # chkconfig: 2345 98 02 # description: # processname: # Source function library. if [ -f /etc/init.d/functions ] ; then . /etc/init.d/functions elif [ -f /etc/rc.d/init.d/functions ] ; then . /etc/rc.d/init.d/functions else exit 0 fi KIND="_" start() { echo starting
N 3 Need some help.
sudo chkconfig --add myScript;
chkconfig --list myScript
output is:myScript 0:off 1:off 2:on 3:on 4:on 5:on 6:off **myScript:** #!/bin/sh # chkconfig: 2345 98 02 # description: # processname: # Source function library. if [ -f /etc/init.d/functions ] ; then . /etc/init.d/functions elif [ -f /etc/rc.d/init.d/functions ] ; then . /etc/rc.d/init.d/functions else exit 0 fi KIND="_" start() { echo starting
date
>> ~/myScript.log
}
stop() {
echo stopping myScript
}
restart() {
echo restarting
}
case "$1" in
start)
start
;;
stop)
stop
;;
restart)
restart
;;
*)
echo $"Usage: $0 {start|stop|restart}"
exit 1
esac
exit $?
Now I can successfully run service myScript start
and log record will be appended.
But if I run sudo reboot
or restart the instance with AWS UI console it doesn't work as was expected.
Although runlevel
output is:N 3 Need some help.
Silk0vsky
(213 rep)
Nov 15, 2016, 11:19 AM
• Last activity: Aug 4, 2025, 09:09 PM
0
votes
2
answers
2585
views
How do I forward all requests from local port to port on my remote Amazon EC2 instance which is using a custom ssh port
I am trying to forward all requests from local port 8888 to port 8888 to my remote Amazon EC2 instance. The only difference is that my EC2 instance is running ssh on custom port 56129. I can successfully ping my ec2 instance from the local system but when I try to forward requests from a local port...
I am trying to forward all requests from local port 8888 to port 8888 to my remote Amazon EC2 instance. The only difference is that my EC2 instance is running ssh on custom port 56129.
I can successfully ping my ec2 instance from the local system but when I try to forward requests from a local port to a port on ec2 instance, I am getting:
>channel 2: open failed: administratively prohibited: open failed
I am using the following command:
ssh -i -NfL 8888:localhost:8888 @ -p 56129
Then it asks for a password. There are no messages when it accepts the password. But as soon as I open localhost:8888 in my browser, I get the error message:
>channel 2: open failed: administratively prohibited: open failed
Some observations -
- Running
ssh -i @ -p 56129
with a
password is successful.
- I am running Jupyter Notebook at port 8888 in EC2 instance. curl localhost:8888 returns nothing when done after ssh-ing into the instance
kusur
(111 rep)
Feb 20, 2022, 03:17 PM
• Last activity: Aug 4, 2025, 04:10 AM
0
votes
2
answers
1875
views
Aws ec2 - How to rsync files between two remotes?
I'm setting up a crontab server to run several jobs to copy files from prod servers to lower environment servers. I need the cron server job to copy files from one server to another. Here is what I have. the ip's have been modified ssh -v -R localhost:50000:1.0.0.2:22 -i host1key.pem ec2-user@1.0.0....
I'm setting up a crontab server to run several jobs to copy files from prod servers to lower environment servers.
I need the cron server job to copy files from one server to another. Here is what I have.
the ip's have been modified
ssh -v -R localhost:50000:1.0.0.2:22 -i host1key.pem ec2-user@1.0.0.1 'rsync -e "ssh -i /home/ec2-user/host2key.pem -p 50000" -vuar /home/ec2-user/test.txt ec2-user@localhost:/home/ec2-user/test.txt'
I'm using two different pem keys and users. I would think this command would work but I get this error in the debug log. Here is more to it and only show the portion that is erroring. It connects to
ec2-user@1.0.0.1
successfully. But errors on the 1.0.0.2
:
debug1: connect_next: host 1.0.0.2 ([1.0.0.2]:22) in progress, fd=7
debug1: channel 1: new [127.0.0.1]
debug1: confirm forwarded-tcpip
debug1: channel 1: connected to 1.0.0.2 port 22
Host key verification failed.
debug1: client_input_channel_req: channel 0 rtype exit-status reply 0
debug1: client_input_channel_req: channel 0 rtype eow@openssh.com reply 0
rsync: connection unexpectedly closed (0 bytes received so far) [sender]
rsync error: error in rsync protocol data stream (code 12) at io.c(600) [sender=3.0.6]
debug1: channel 0: free: client-session, nchannels 2
debug1: channel 1: free: 127.0.0.1, nchannels 1
Transferred: sent 5296, received 4736 bytes, in 0.9 seconds
Bytes per second: sent 5901.2, received 5277.2
debug1: Exit status 12
chdev77
(101 rep)
Jul 5, 2017, 10:55 PM
• Last activity: Aug 3, 2025, 06:10 AM
1
votes
1
answers
2983
views
SSH Public Key Authorization error Permission denied (publickey,gssapi-keyex,gssapi-with-mic)
I am trying to SSH onto my server with the command ```ssh -i key.pem ec2-user@ip_address``` as I did with no issues last week but this week it is giving me an error of only ```ec2-user@ip_address:Permission denied (publickey,gssapi-keyex,gssapi-with-mic).``` which I got before that led me to connect...
I am trying to SSH onto my server with the command
-i key.pem ec2-user@ip_address
as I did with no issues last week but this week it is giving me an error of only -user@ip_address:Permission denied (publickey,gssapi-keyex,gssapi-with-mic).
which I got before that led me to connecting to wrong server / having key in wrong file but I fixed that so I know that isn't the problem.
This is the error message I am receiving when trying to connect.
-vvv -i key1.pem ec2-user@34.255.97.122
OpenSSH_7.6p1 Ubuntu-4ubuntu0.3, OpenSSL 1.0.2n 7 Dec 2017
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: Applying options for *
debug2: resolving "34.255.97.122" port 22
debug2: ssh_connect_direct: needpriv 0
debug1: Connecting to 34.255.97.122 [34.255.97.122] port 22.
debug1: Connection established.
debug1: key_load_public: No such file or directory
debug1: identity file key1.pem type -1
debug1: key_load_public: No such file or directory
debug1: identity file key1.pem-cert type -1
debug1: Local version string SSH-2.0-OpenSSH_7.6p1 Ubuntu-4ubuntu0.3
debug1: Remote protocol version 2.0, remote software version OpenSSH_7.4
debug1: match: OpenSSH_7.4 pat OpenSSH* compat 0x04000000
debug2: fd 3 setting O_NONBLOCK
debug1: Authenticating to 34.255.97.122:22 as 'ec2-user'
debug3: hostkeys_foreach: reading file "/home/ubuntu/.ssh/known_hosts"
debug3: record_hostkey: found key type ECDSA in file /home/ubuntu/.ssh/known_hosts:7
debug3: load_hostkeys: loaded 1 keys from 34.255.97.122
debug3: order_hostkeyalgs: prefer hostkeyalgs: ecdsa-sha2-nistp256-cert-v01@openssh.com,ecdsa-sha2-nistp384-cert-v01@openssh.com,ecdsa-sha2-nistp521-cert-v01@openssh.com,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521
debug3: send packet: type 20
debug1: SSH2_MSG_KEXINIT sent
debug3: receive packet: type 20
debug1: SSH2_MSG_KEXINIT received
debug2: local client KEXINIT proposal
debug2: KEX algorithms: curve25519-sha256,curve25519-sha256@libssh.org,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group16-sha512,diffie-hellman-group18-sha512,diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha256,diffie-hellman-group14-sha1,ext-info-c
debug2: host key algorithms: ecdsa-sha2-nistp256-cert-v01@openssh.com,ecdsa-sha2-nistp384-cert-v01@openssh.com,ecdsa-sha2-nistp521-cert-v01@openssh.com,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,ssh-ed25519-cert-v01@openssh.com,ssh-rsa-cert-v01@openssh.com,ssh-ed25519,rsa-sha2-512,rsa-sha2-256,ssh-rsa
debug2: ciphers ctos: chacha20-poly1305@openssh.com,aes128-ctr,aes192-ctr,aes256-ctr,aes128-gcm@openssh.com,aes256-gcm@openssh.com
debug2: ciphers stoc: chacha20-poly1305@openssh.com,aes128-ctr,aes192-ctr,aes256-ctr,aes128-gcm@openssh.com,aes256-gcm@openssh.com
debug2: MACs ctos: umac-64-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-sha1-etm@openssh.com,umac-64@openssh.com,umac-128@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-sha1
debug2: MACs stoc: umac-64-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-sha1-etm@openssh.com,umac-64@openssh.com,umac-128@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-sha1
debug2: compression ctos: none,zlib@openssh.com,zlib
debug2: compression stoc: none,zlib@openssh.com,zlib
debug2: languages ctos:
debug2: languages stoc:
debug2: first_kex_follows 0
debug2: reserved 0
debug2: peer server KEXINIT proposal
debug2: KEX algorithms: curve25519-sha256,curve25519-sha256@libssh.org,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group16-sha512,diffie-hellman-group18-sha512,diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha256,diffie-hellman-group14-sha1,diffie-hellman-group1-sha1
debug2: host key algorithms: ssh-rsa,rsa-sha2-512,rsa-sha2-256,ecdsa-sha2-nistp256,ssh-ed25519
debug2: ciphers ctos: chacha20-poly1305@openssh.com,aes128-ctr,aes192-ctr,aes256-ctr,aes128-gcm@openssh.com,aes256-gcm@openssh.com,aes128-cbc,aes192-cbc,aes256-cbc,blowfish-cbc,cast128-cbc,3des-cbc
debug2: ciphers stoc: chacha20-poly1305@openssh.com,aes128-ctr,aes192-ctr,aes256-ctr,aes128-gcm@openssh.com,aes256-gcm@openssh.com,aes128-cbc,aes192-cbc,aes256-cbc,blowfish-cbc,cast128-cbc,3des-cbc
debug2: MACs ctos: umac-64-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-sha1-etm@openssh.com,umac-64@openssh.com,umac-128@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-sha1
debug2: MACs stoc: umac-64-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-sha1-etm@openssh.com,umac-64@openssh.com,umac-128@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-sha1
debug2: compression ctos: none,zlib@openssh.com
debug2: compression stoc: none,zlib@openssh.com
debug2: languages ctos:
debug2: languages stoc:
debug2: first_kex_follows 0
debug2: reserved 0
debug1: kex: algorithm: curve25519-sha256
debug1: kex: host key algorithm: ecdsa-sha2-nistp256
debug1: kex: server->client cipher: chacha20-poly1305@openssh.com MAC: compression: none
debug1: kex: client->server cipher: chacha20-poly1305@openssh.com MAC: compression: none
debug3: send packet: type 30
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
debug3: receive packet: type 31
debug1: Server host key: ecdsa-sha2-nistp256 SHA256:KcJCcNrItmtT7CwXIEndRD42wLyphxOtQR540TzFbSk
debug3: hostkeys_foreach: reading file "/home/ubuntu/.ssh/known_hosts"
debug3: record_hostkey: found key type ECDSA in file /home/ubuntu/.ssh/known_hosts:7
debug3: load_hostkeys: loaded 1 keys from 34.255.97.130
debug1: Host '34.255.97.130' is known and matches the ECDSA host key.
debug1: Found key in /home/ubuntu/.ssh/known_hosts:7
debug3: send packet: type 21
debug2: set_newkeys: mode 1
debug1: rekey after 134217728 blocks
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug3: receive packet: type 21
debug1: SSH2_MSG_NEWKEYS received
debug2: set_newkeys: mode 0
debug1: rekey after 134217728 blocks
debug2: key: key1.pem ((nil)), explicit
debug3: send packet: type 5
debug3: receive packet: type 7
debug1: SSH2_MSG_EXT_INFO received
debug1: kex_input_ext_info: server-sig-algs=
debug3: receive packet: type 6
debug2: service_accept: ssh-userauth
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug3: send packet: type 50
debug3: receive packet: type 51
debug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic
debug3: start over, passed a different list publickey,gssapi-keyex,gssapi-with-mic
debug3: preferred gssapi-keyex,gssapi-with-mic,publickey,keyboard-interactive,password
debug3: authmethod_lookup gssapi-keyex
debug3: remaining preferred: gssapi-with-mic,publickey,keyboard-interactive,password
debug3: authmethod_is_enabled gssapi-keyex
debug1: Next authentication method: gssapi-keyex
debug1: No valid Key exchange context
debug2: we did not send a packet, disable method
debug3: authmethod_lookup gssapi-with-mic
debug3: remaining preferred: publickey,keyboard-interactive,password
debug3: authmethod_is_enabled gssapi-with-mic
debug1: Next authentication method: gssapi-with-mic
debug1: Unspecified GSS failure. Minor code may provide more information
No Kerberos credentials available (default cache: FILE:/tmp/krb5cc_1000)
debug1: Unspecified GSS failure. Minor code may provide more information
No Kerberos credentials available (default cache: FILE:/tmp/krb5cc_1000)
debug2: we did not send a packet, disable method
debug3: authmethod_lookup publickey
debug3: remaining preferred: keyboard-interactive,password
debug3: authmethod_is_enabled publickey
debug1: Next authentication method: publickey
debug1: Trying private key: key1.pem
debug3: sign_and_send_pubkey: RSA SHA256:ROAQ4zFxWIgz+DlQwSwqivDbjdPsFEh1LCmRYMc/iss
debug3: send packet: type 50
debug2: we sent a publickey packet, wait for reply
debug3: receive packet: type 51
debug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic
debug2: we did not send a packet, disable method
debug1: No more authentication methods to try.
ec2-user@34.255.97.130: Permission denied (publickey,gssapi-keyex,gssapi-with-mic).
Any help would be appreciated as my only solution is from more experienced people.
Decjk
(11 rep)
Jul 6, 2021, 05:51 PM
• Last activity: Jul 26, 2025, 12:10 AM
3
votes
2
answers
2190
views
Timeout when connecting RDS using AWS session manager via EC2 instance
I am having trouble accessing AWS RDS instance in a private subnet using session manager through ec2 instance (Ubuntu). Port forwarding using AWS Session manager - ```shell aws ssm start-session --target $INSTANCE_ID \ --document-name AWS-StartPortForwardingSession \ --parameters '{"portNumber":[330...
I am having trouble accessing AWS RDS instance in a private subnet using session manager through ec2 instance (Ubuntu).
Port forwarding using AWS Session manager -
aws ssm start-session --target $INSTANCE_ID \
--document-name AWS-StartPortForwardingSession \
--parameters '{"portNumber":,"localPortNumber":["8000"]}' \
--profile=production \
--region=us-east-1`
Now local port 8000 successfully forwarded to port 3307 of EC2.
lsof -nP +c 15 | grep LISTEN
session-manager 59744 xrage 12u IPv4 0xa6c821d0a800e9a1 0t0 TCP 127.0.0.1:8000 (LISTEN)
EC2 instance has an iptable rule that forward all traffic on port 3307 to rds host at port 3306 (MYSQL PORT).
sudo iptables -t nat -A OUTPUT -o lo -d 127.0.0.1 -p tcp --dport 3307 -j DNAT --to-destination :3306
This allowed me to access remote host on the desired port from ec2, But still, the remote host is not accessible locally on port 8000.
Network details on the local machine -
- Not using any proxy
- Firewall disabled on mac
So it's clear that SSM setup is working but something else is blocking this traffic, Need some help here.
xrage
(139 rep)
Apr 10, 2020, 12:52 PM
• Last activity: Jul 21, 2025, 08:04 AM
1
votes
1
answers
1959
views
Installing Firefox on EC2 using Lambda Linux Project
I'm trying to set up a nodejs+selenium server on ec2. I got node installed and working and I tried to set up Firefox using the tutorial here: https://lambda-linux.io/blog/2015/01/28/announcing-firefox-browser-support-for-amazon-linux/ I got it all installed but however, whenever I run firefox, I get...
I'm trying to set up a nodejs+selenium server on ec2.
I got node installed and working and I tried to set up Firefox using the tutorial here:
https://lambda-linux.io/blog/2015/01/28/announcing-firefox-browser-support-for-amazon-linux/
I got it all installed but however, whenever I run firefox, I get this error.
>GLib-CRITICAL **: g_slice_set_config: assertion `sys_page_size == 0' failed
Anyone know how I can fix this?
Thanks!
user3091859
(11 rep)
Dec 9, 2015, 09:59 PM
• Last activity: Jul 10, 2025, 05:05 AM
1
votes
0
answers
2273
views
auditctl doesn't log anything
I am trying to find app/activity on a server for failed connection to external mysql host. For that I decided to use `auditctl`. I'm running the following command: [nir]$ sudo auditctl -A exit,always -F arch=b64 -S connect [nir]$ sudo auditctl -l | grep -i 'arch' -a always,exit -F arch=b64 -S connec...
I am trying to find app/activity on a server for failed connection to external mysql host.
For that I decided to use
auditctl
. I'm running the following command:
[nir]$ sudo auditctl -A exit,always -F arch=b64 -S connect
[nir]$ sudo auditctl -l | grep -i 'arch'
-a always,exit -F arch=b64 -S connect
[nir]$ sudo ls -l -h /var/log/audit/audit.log
-rw------- 1 root root 6.2M May 1 2020 /var/log/audit/audit.log
[nir]$ sudo auditctl -m 'hey, are you working at all?'
[nir]$ sudo ls -l -h /var/log/audit/audit.log
-rw------- 1 root root 6.2M May 1 2020 /var/log/audit/audit.log
[nir]$ service auditd status
Redirecting to /bin/systemctl status auditd.service
● auditd.service - Security Auditing Service
Loaded: loaded (/usr/lib/systemd/system/auditd.service; enabled; vendor preset: enabled)
Active: active (running) since Sun 2019-12-15 20:24:05 UTC; 1 years 2 months ago
Docs: man:auditd(8)
https://github.com/linux-audit/audit-documentation
Main PID: 1898 (auditd)
Tasks: 2
Memory: 140.0K
CGroup: /system.slice/auditd.service
└─1898 /sbin/auditd
Warning: Journal has been rotated since unit was started. Log output is incomplete or unavailable.
But the log file /var/log/audit/audit.log
does not get updated at all. I'm using aws ec2 server.
Any suggestions?
Nir
(1405 rep)
Feb 18, 2021, 09:02 AM
• Last activity: Jul 9, 2025, 09:48 AM
4
votes
2
answers
2242
views
Make date change permanent in EC2
How can I manually set date and time to future in EC2 instance and make it permanent, so it won't reset after reboot ? I can change date using this command: $ sudo timedatectl set-time "2017-12-09 16:00:00" $ timedatectl Local time: Sat 2017-12-09 16:00:01 UTC Universal time: Sat 2017-12-09 16:00:01...
How can I manually set date and time to future in EC2 instance and make it permanent, so it won't reset after reboot ?
I can change date using this command:
$ sudo timedatectl set-time "2017-12-09 16:00:00"
$ timedatectl
Local time: Sat 2017-12-09 16:00:01 UTC
Universal time: Sat 2017-12-09 16:00:01 UTC
RTC time: Sat 2017-12-09 16:00:02
Time zone: Etc/UTC (UTC, +0000)
Network time on: no
NTP synchronized: no
RTC in local TZ: no
OS on EC2:
$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 16.04.3 LTS
Release: 16.04
Codename: xenial
What else should I do to make this permanent ?
The purpose of this adjustment is to set the date to future, so I can test few things.
Michal Przybylowicz
(471 rep)
Nov 2, 2017, 01:58 PM
• Last activity: Jul 6, 2025, 01:08 AM
4
votes
1
answers
2005
views
How to get private IP address of EC2 after spinning the AWS from local machine/ at Jenkins outside AWS
Assume we already spin the AWS using cloudformation plugin from Jenkins outside AWS and now, how to get private IP address after spinning the AWS at my local machine/jenkins using any API methods? I tried ruby aws-sdk, REST API methods to get the private ip outside AWS (at my local) and I'm getting...
Assume we already spin the AWS using cloudformation plugin from Jenkins outside AWS and now, how to get private IP address after spinning the AWS at my local machine/jenkins using any API methods? I tried ruby aws-sdk, REST API methods to get the private ip outside AWS (at my local) and I'm getting timed out for the connection. Here are some examples that did not yield the ip address/EC2 objects and getting timeout -
#using ruby aws-sdk
require 'rubygems'
require 'aws-sdk-v1'
require 'aws-sdk'
AWS.config(:region => "xxxxx",
:access_key_id => "xxxxx",
:secret_access_key => "xxxxx")
ec2 = AWS::EC2.new(
:region => "xxxxxx",
:access_key_id => "xxxx",
:secret_access_key => "xxxxxxx")
ec2.instances.each do |test|
puts test.id
end
#using REST API client -
require 'rubygems'
require 'rest-client'
url = "https://ec2.amazonaws.com/?Action=DescribeNatGateways&ImageId=xxxxxxx&access_key_id=xxxxxx&secret_access_key=xxxxxxxx "
response=RestClient::Request.execute(:url =>url, :method => :get, :verify_ssl => false)
puts response
Tried uploading the IP address contained text file to S3 and then reading it back -
--------------cloudformation Json contains the following ---------
"wget -qO- http://169.254.169.254/latest/meta-data/local-pv4 >>dockeriseleniumgrid_ip_address\n", "aws s3 cp dockeriseleniumgrid_ip_address s3://xxxxx/dockeriseleniumgrid_ip_address\n"
----------tried reading it from s3 and writing to local machine --------
require 'aws/s3'
S3ID = "xxxxx"
S3KEY = "xxxx"
# include AWS::S3
AWS::S3::Base.establish_connection!(
:access_key_id => S3ID,
:secret_access_key => S3KEY
)
bucket = AWS::S3::Bucket.find("dockeriseleniumgrid_ip_address")
File.open("ip_address.txt", "w") do |f|
f.write(bucket.objects.read)
end
I'm new to AWS and appreciate if anyone can help
user176867
(41 rep)
Nov 18, 2016, 08:12 PM
• Last activity: Jul 3, 2025, 06:07 AM
6
votes
1
answers
1961
views
Why does `/dev/shm` on an EC2 instance have I/O throughput comparable to an EBS drive?
I recently learned about the convenient "shared memory" file system at `/dev/shm`. I wanted to see if I could use this to speed up a sometimes-disk-bound program that writes to and reads from a directory, so I ran a little experiment on an EC2 instance (c4.8xlarge running Ubuntu 16.04): $ time yes a...
I recently learned about the convenient "shared memory" file system at
/dev/shm
. I wanted to see if I could use this to speed up a sometimes-disk-bound program that writes to and reads from a directory, so I ran a little experiment on an EC2 instance (c4.8xlarge running Ubuntu 16.04):
$ time yes asdfjkl | head -1000000000 > /mnt/fake.txt
real 0m21.381s
$ time yes asdfjkl | head -1000000000 > /dev/shm/fake.txt
real 0m20.266s
$ time yes asdfjkl | head -1000000000 > /dev/null
real 0m14.334s
The EC2 instance seems to have a write throughput to /dev/shm/
, that is comparable to an EBS drive, which was surprising. htop
indicates that the machine isn't using swap space in order to write to /dev/shm
. The noticeably faster write to /dev/null
in the third case indicates that I'm probably not bound by some other factor (e.g. CPU via the implementation of yes
) in the first two cases.
I ran the same experiment on my personal computer -- enough memory that /dev/shm
can hold 7.5 GB of asdfjkl\n
by default, I can dig up more hardware details if anyone thinks they'll matter -- also running Ubuntu 16.04:
$ time yes asdfjkl | head -1000000000 > /mnt/fake.txt
real 0m36.520s
$ time yes asdfjkl | head -1000000000 > /dev/shm/fake.txt
real 0m12.516s
$ time yes asdfjkl | head -1000000000 > /dev/null
real 0m11.252s
This is much closer to what I expected. Read throughput (writing to /dev/null
) on both machines and from both file systems is roughly proportional to write throughput in the corresponding case.
Two other observations, which I don't know quite how to interpret:
- On the EC2 instance, htop
indicates memory usage comparable to the size of /dev/shm/fake.txt
once it's written, while on my desktop, it does not.
- On the EC2 instance, concurrent disk write congestion appears to slow down a write to shared memory by an amount comparable to how much the writes to disk were slowed down, while on my desktop, it does not.
James
(161 rep)
Jan 24, 2018, 04:43 AM
• Last activity: May 29, 2025, 02:03 AM
0
votes
1
answers
1981
views
How to resolve problems connecting to Samba4 Active Directory Domain Controller on Ubuntu Micro AWS Instance
I'm trying to set up a Active Directory Domain Controller on an Ubuntu 16.04 instance on Amazon's EC2 micro services. I do everything right (following at least three different tutorials) and get all the server side tests to run and go fine. My most recent attempt used this tutorial:https://wiki.samb...
I'm trying to set up a Active Directory Domain Controller on an Ubuntu 16.04 instance on Amazon's EC2 micro services. I do everything right (following at least three different tutorials) and get all the server side tests to run and go fine. My most recent attempt used this tutorial:https://wiki.samba.org/index.php/Setting_up_Samba_as_an_Active_Directory_Domain_Controller (although I got the kerberos install list from Step 2 of https://www.tecmint.com/install-samba4-active-directory-ubuntu/) .
But when I try to connect from Windows 10 (as explained here https://wiki.samba.org/index.php/Windows_DNS_Configuration) , I get the following error:
> Note: This information is intended for a network administrator. If
> you are not your network's administrator, notify the administrator
> that you received this information, which has been recorded in the
> file C:\Windows\debug\dcdiag.txt.
>
> DNS was successfully queried for the service location (SRV) resource
> record used to locate a domain controller for domain
> "ad.company.com.my":
>
> The query was for the SRV record for
> _ldap._tcp.dc._msdcs.ad.company.com.my
>
> The following domain controllers were identified by the query:
> dc1.ad.company.com.my
>
>
> However no domain controllers could be contacted.
>
> Common causes of this error include:
>
> - Host (A) or (AAAA) records that map the names of the domain controllers to their IP addresses are missing or contain incorrect
> addresses.
>
> - Domain controllers registered in DNS are not connected to the network or are not running.
My setup:
AWS Micro instance running Ubuntu 16.04 LTS. Elastic IP address set so that I have a static IP address for the server.
The Windows client is a virtual machine. It has the public IP address of the amazon instance set as per instructed on the samba wiki (https://wiki.samba.org/index.php/Windows_DNS_Configuration) .
All of these work:
host -t A ad.company.com.my
host -t A dc1
ping -c3 ad.company.com.my
ping -c3 dc1.ad.company.com.my
Configuration files:
/etc/network/interfaces:
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
# The loopback network interface
auto lo
iface lo inet loopback
# Source interfaces
# Please check /etc/network/interfaces.d before changing this file
# as interfaces may have been defined in /etc/network/interfaces.d
# See LP: #1262951
# source /etc/network/interfaces.d/*.cfg
auto eth0
iface eth0 inet static
address 172.31.36.46
netmask 255.255.240.0
broadcast 172.31.47.255
gateway 172.31.32.1
dns-nameserver 172.31.36.46
# dns-nameserver 172.31.0.2
# dns-nameserver 8.8.8.8
dns-search ad.company.com.my
/etc/hosts:
127.0.0.1 localhost localhost.localdomain
172.31.36.46 dc1.ad.company.com.my dc1
# The following lines are desirable for IPv6 capable hosts
::1 ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
ff02::3 ip6-allhosts
/etc/resolv.conf
# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
# DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
nameserver 172.31.36.46
search ad.company.com.my
/etc/hostname
dc1
/etc/krb5.conf
[libdefaults]
default_realm = AD.COMPANY.COM.MY
dns_lookup_realm = false
dns_lookup_kdc = true
/etc/samba/smb.conf
[global]
workgroup = AD
realm = AD.COMPANY.COM.MY
netbios name = DC1
server role = active directory domain controller
dns forwarder = 8.8.8.8
idmap_ldb:use rfc2307 = yes
[netlogon]
path = /var/lib/samba/sysvol/ad.company.com.my/scripts
read only = No
[sysvol]
path = /var/lib/samba/sysvol
read only = No
Here is the output of the command: nslookup dc1.ad.company.com.my
Server: ec2-ADDRESS.ap-southeast-1.compute.amazonaws.com
Address: ADDRESS
Name: dc1.ad.company.com.my
Address: 172.31.36.46
And then doing an SRV check:
C:\Users\user>nslookup
Default Server: ec2-ADDRESS.ap-southeast-1.compute.amazonaws.com
Address: ADDRESS
> set type=SRV
> _ldap._tcp.ad.company.com.my
Server: ec2-ADDRESS.ap-southeast-1.compute.amazonaws.com
Address: ADDRESS
_ldap._tcp.ad.company.com.my SRV service location:
priority = 0
weight = 100
port = 389
svr hostname = dc1.ad.company.com.my
I've opened all traffic on the instance so that I know it's not a firewall issue.
So, what am I doing wrong?
Jack Holtby
(1 rep)
Jun 19, 2019, 08:22 AM
• Last activity: Apr 19, 2025, 10:03 PM
1
votes
2
answers
4817
views
Successfully installed amazon-efs-utils but cannot find it
```` $ sudo yum install -y amazon-efs-utils --verbose Loading "extras_suggestions" plugin Loading "langpacks" plugin Loading "priorities" plugin Loading "update-mood" plugin Adding en_US to language list Config time: 0.391 Yum version: 3.4.3 rpmdb time: 0.000 Setting up Package Sacks amzn2-core pkgs...
`
$ sudo yum install -y amazon-efs-utils --verbose
Loading "extras_suggestions" plugin
Loading "langpacks" plugin
Loading "priorities" plugin
Loading "update-mood" plugin
Adding en_US to language list
Config time: 0.391
Yum version: 3.4.3
rpmdb time: 0.000
Setting up Package Sacks
amzn2-core
pkgsack time: 0.052
Obs Init time: 0.172
Package amazon-efs-utils-1.29.1-1.amzn2.noarch already installed and latest version
Nothing to do
`
Installation of amazon-efs-utils
seems to be successful as shown above.
But when I try to run the tool, I get this error:
`
$ sudo amazon-efs-utils
sudo: amazon-efs-utils: command not found
`
1. Is it possible that the URL from where amazon-efs-utils
gets downloaded is blocked and hence it did not really get downloaded?
2. I ran yum
with --verbose
option to see if it would print a trace of which URL it tries to download the tool from. But it did not! Any idea how I can find which URL amazon-efs-utils
would be downloaded from so that I can try whitelisting that URL on my server and try again?
I am using Amazon Linux2 EC2 btw.
Biju
(111 rep)
Mar 10, 2021, 03:06 AM
• Last activity: Apr 12, 2025, 07:01 AM
7
votes
2
answers
13493
views
Return the private IP of an EC2 instance from within the EC2 instance
What specific syntax can be used to return the private IP address of an Amazon Linux EC2 instance from the command line within that instance? So far, I have come up with the following: # Get private IP from inside the instance by filtering inside the following: instanceid=$(curl http://169.254.169.2...
What specific syntax can be used to return the private IP address of an Amazon Linux EC2 instance from the command line within that instance?
So far, I have come up with the following:
# Get private IP from inside the instance by filtering inside the following:
instanceid=$(curl http://169.254.169.254/latest/meta-data/instance-id)
echo $instanceid
aws ec2 describe-instances --instance-id $instanceid --region us-west-2
However, as you can see if you type these commands inside an EC2 instance yourself, the above 3 lines result in a massive output, which would be a mess to filter through manually.
Can someone suggest one or two lines of code to return simply the private ip of the instance and NO other information?
CodeMed
(5357 rep)
Jun 8, 2019, 12:49 AM
• Last activity: Apr 9, 2025, 01:38 PM
0
votes
1
answers
482
views
How to install Postgresql17 to my EC2 instance on Amazon Linux
I'm trying to install postgres version 17 on my EC2 instance on Amazon Linux but I get this error: ``` [ec2-user@ip-172-31-8-1 ~]$ sudo dnf install -y postgresql17 postgresql17-server Last metadata expiration check: 1:30:57 ago on Tue Mar 18 13:55:34 2025. Error: Problem 1: conflicting requests - no...
I'm trying to install postgres version 17 on my EC2 instance on Amazon Linux but I get this error:
[ec2-user@ip-172-31-8-1 ~]$ sudo dnf install -y postgresql17 postgresql17-server
Last metadata expiration check: 1:30:57 ago on Tue Mar 18 13:55:34 2025.
Error:
Problem 1: conflicting requests
- nothing provides libldap.so.2()(64bit) needed by postgresql17-server-17.0-1PGDG.rhel9.x86_64 from download.postgresql.org_pub_repos_yum_17_redhat_rhel-9-x86_64_
- nothing provides libldap.so.2(OPENLDAP_2.200)(64bit) needed by postgresql17-server-17.0-1PGDG.rhel9.x86_64 from download.postgresql.org_pub_repos_yum_17_redhat_rhel-9-x86_64_
- nothing provides libldap.so.2()(64bit) needed by postgresql17-server-17.0-2PGDG.rhel9.x86_64 from download.postgresql.org_pub_repos_yum_17_redhat_rhel-9-x86_64_
- nothing provides libldap.so.2(OPENLDAP_2.200)(64bit) needed by postgresql17-server-17.0-2PGDG.rhel9.x86_64 from download.postgresql.org_pub_repos_yum_17_redhat_rhel-9-x86_64_
- nothing provides libldap.so.2()(64bit) needed by postgresql17-server-17.1-1PGDG.rhel9.x86_64 from download.postgresql.org_pub_repos_yum_17_redhat_rhel-9-x86_64_
- nothing provides libldap.so.2(OPENLDAP_2.200)(64bit) needed by postgresql17-server-17.1-1PGDG.rhel9.x86_64 from download.postgresql.org_pub_repos_yum_17_redhat_rhel-9-x86_64_
- nothing provides libldap.so.2()(64bit) needed by postgresql17-server-17.2-1PGDG.rhel9.x86_64 from download.postgresql.org_pub_repos_yum_17_redhat_rhel-9-x86_64_
- nothing provides libldap.so.2(OPENLDAP_2.200)(64bit) needed by postgresql17-server-17.2-1PGDG.rhel9.x86_64 from download.postgresql.org_pub_repos_yum_17_redhat_rhel-9-x86_64_
- nothing provides libldap.so.2()(64bit) needed by postgresql17-server-17.3-1PGDG.rhel9.x86_64 from download.postgresql.org_pub_repos_yum_17_redhat_rhel-9-x86_64_
- nothing provides libldap.so.2(OPENLDAP_2.200)(64bit) needed by postgresql17-server-17.3-1PGDG.rhel9.x86_64 from download.postgresql.org_pub_repos_yum_17_redhat_rhel-9-x86_64_
- nothing provides libldap.so.2()(64bit) needed by postgresql17-server-17.4-1PGDG.rhel9.x86_64 from download.postgresql.org_pub_repos_yum_17_redhat_rhel-9-x86_64_
- nothing provides libldap.so.2(OPENLDAP_2.200)(64bit) needed by postgresql17-server-17.4-1PGDG.rhel9.x86_64 from download.postgresql.org_pub_repos_yum_17_redhat_rhel-9-x86_64_
- nothing provides libcrypto.so.1.1()(64bit) needed by postgresql17-server-17.0-1PGDG.rhel8.x86_64 from pgdg17
- nothing provides libcrypto.so.1.1(OPENSSL_1_1_0)(64bit) needed by postgresql17-server-17.0-1PGDG.rhel8.x86_64 from pgdg17
- nothing provides libssl.so.1.1()(64bit) needed by postgresql17-server-17.0-1PGDG.rhel8.x86_64 from pgdg17
- nothing provides libssl.so.1.1(OPENSSL_1_1_0)(64bit) needed by postgresql17-server-17.0-1PGDG.rhel8.x86_64 from pgdg17
- nothing provides libcrypto.so.1.1(OPENSSL_1_1_1)(64bit) needed by postgresql17-server-17.0-1PGDG.rhel8.x86_64 from pgdg17
- nothing provides libicudata.so.60()(64bit) needed by postgresql17-server-17.0-1PGDG.rhel8.x86_64 from pgdg17
- nothing provides libicui18n.so.60()(64bit) needed by postgresql17-server-17.0-1PGDG.rhel8.x86_64 from pgdg17
- nothing provides libicuuc.so.60()(64bit) needed by postgresql17-server-17.0-1PGDG.rhel8.x86_64 from pgdg17
- nothing provides libssl.so.1.1(OPENSSL_1_1_1)(64bit) needed by postgresql17-server-17.0-1PGDG.rhel8.x86_64 from pgdg17
- nothing provides libcrypto.so.1.1()(64bit) needed by postgresql17-server-17.0-2PGDG.rhel8.x86_64 from pgdg17
- nothing provides libcrypto.so.1.1(OPENSSL_1_1_0)(64bit) needed by postgresql17-server-17.0-2PGDG.rhel8.x86_64 from pgdg17
- nothing provides libssl.so.1.1()(64bit) needed by postgresql17-server-17.0-2PGDG.rhel8.x86_64 from pgdg17
- nothing provides libssl.so.1.1(OPENSSL_1_1_0)(64bit) needed by postgresql17-server-17.0-2PGDG.rhel8.x86_64 from pgdg17
- nothing provides libcrypto.so.1.1(OPENSSL_1_1_1)(64bit) needed by postgresql17-server-17.0-2PGDG.rhel8.x86_64 from pgdg17
- nothing provides libicudata.so.60()(64bit) needed by postgresql17-server-17.0-2PGDG.rhel8.x86_64 from pgdg17
- nothing provides libicui18n.so.60()(64bit) needed by postgresql17-server-17.0-2PGDG.rhel8.x86_64 from pgdg17
- nothing provides libicuuc.so.60()(64bit) needed by postgresql17-server-17.0-2PGDG.rhel8.x86_64 from pgdg17
- nothing provides libssl.so.1.1(OPENSSL_1_1_1)(64bit) needed by postgresql17-server-17.0-2PGDG.rhel8.x86_64 from pgdg17
- nothing provides libcrypto.so.1.1()(64bit) needed by postgresql17-server-17.1-1PGDG.rhel8.x86_64 from pgdg17
- nothing provides libcrypto.so.1.1(OPENSSL_1_1_0)(64bit) needed by postgresql17-server-17.1-1PGDG.rhel8.x86_64 from pgdg17
- nothing provides libssl.so.1.1()(64bit) needed by postgresql17-server-17.1-1PGDG.rhel8.x86_64 from pgdg17
- nothing provides libssl.so.1.1(OPENSSL_1_1_0)(64bit) needed by postgresql17-server-17.1-1PGDG.rhel8.x86_64 from pgdg17
- nothing provides libcrypto.so.1.1(OPENSSL_1_1_1)(64bit) needed by postgresql17-server-17.1-1PGDG.rhel8.x86_64 from pgdg17
- nothing provides libicudata.so.60()(64bit) needed by postgresql17-server-17.1-1PGDG.rhel8.x86_64 from pgdg17
- nothing provides libicui18n.so.60()(64bit) needed by postgresql17-server-17.1-1PGDG.rhel8.x86_64 from pgdg17
- nothing provides libicuuc.so.60()(64bit) needed by postgresql17-server-17.1-1PGDG.rhel8.x86_64 from pgdg17
- nothing provides libssl.so.1.1(OPENSSL_1_1_1)(64bit) needed by postgresql17-server-17.1-1PGDG.rhel8.x86_64 from pgdg17
- nothing provides libcrypto.so.1.1()(64bit) needed by postgresql17-server-17.2-1PGDG.rhel8.x86_64 from pgdg17
- nothing provides libcrypto.so.1.1(OPENSSL_1_1_0)(64bit) needed by postgresql17-server-17.2-1PGDG.rhel8.x86_64 from pgdg17
- nothing provides libssl.so.1.1()(64bit) needed by postgresql17-server-17.2-1PGDG.rhel8.x86_64 from pgdg17
- nothing provides libssl.so.1.1(OPENSSL_1_1_0)(64bit) needed by postgresql17-server-17.2-1PGDG.rhel8.x86_64 from pgdg17
- nothing provides libcrypto.so.1.1(OPENSSL_1_1_1)(64bit) needed by postgresql17-server-17.2-1PGDG.rhel8.x86_64 from pgdg17
- nothing provides libicudata.so.60()(64bit) needed by postgresql17-server-17.2-1PGDG.rhel8.x86_64 from pgdg17
- nothing provides libicui18n.so.60()(64bit) needed by postgresql17-server-17.2-1PGDG.rhel8.x86_64 from pgdg17
- nothing provides libicuuc.so.60()(64bit) needed by postgresql17-server-17.2-1PGDG.rhel8.x86_64 from pgdg17
- nothing provides libssl.so.1.1(OPENSSL_1_1_1)(64bit) needed by postgresql17-server-17.2-1PGDG.rhel8.x86_64 from pgdg17
- nothing provides libcrypto.so.1.1()(64bit) needed by postgresql17-server-17.3-1PGDG.rhel8.x86_64 from pgdg17
- nothing provides libcrypto.so.1.1(OPENSSL_1_1_0)(64bit) needed by postgresql17-server-17.3-1PGDG.rhel8.x86_64 from pgdg17
- nothing provides libssl.so.1.1()(64bit) needed by postgresql17-server-17.3-1PGDG.rhel8.x86_64 from pgdg17
- nothing provides libssl.so.1.1(OPENSSL_1_1_0)(64bit) needed by postgresql17-server-17.3-1PGDG.rhel8.x86_64 from pgdg17
- nothing provides libcrypto.so.1.1(OPENSSL_1_1_1)(64bit) needed by postgresql17-server-17.3-1PGDG.rhel8.x86_64 from pgdg17
- nothing provides libicudata.so.60()(64bit) needed by postgresql17-server-17.3-1PGDG.rhel8.x86_64 from pgdg17
- nothing provides libicui18n.so.60()(64bit) needed by postgresql17-server-17.3-1PGDG.rhel8.x86_64 from pgdg17
- nothing provides libicuuc.so.60()(64bit) needed by postgresql17-server-17.3-1PGDG.rhel8.x86_64 from pgdg17
- nothing provides libssl.so.1.1(OPENSSL_1_1_1)(64bit) needed by postgresql17-server-17.3-1PGDG.rhel8.x86_64 from pgdg17
- nothing provides libcrypto.so.1.1()(64bit) needed by postgresql17-server-17.4-1PGDG.rhel8.x86_64 from pgdg17
- nothing provides libcrypto.so.1.1(OPENSSL_1_1_0)(64bit) needed by postgresql17-server-17.4-1PGDG.rhel8.x86_64 from pgdg17
- nothing provides libssl.so.1.1()(64bit) needed by postgresql17-server-17.4-1PGDG.rhel8.x86_64 from pgdg17
- nothing provides libssl.so.1.1(OPENSSL_1_1_0)(64bit) needed by postgresql17-server-17.4-1PGDG.rhel8.x86_64 from pgdg17
- nothing provides libcrypto.so.1.1(OPENSSL_1_1_1)(64bit) needed by postgresql17-server-17.4-1PGDG.rhel8.x86_64 from pgdg17
- nothing provides libicudata.so.60()(64bit) needed by postgresql17-server-17.4-1PGDG.rhel8.x86_64 from pgdg17
- nothing provides libicui18n.so.60()(64bit) needed by postgresql17-server-17.4-1PGDG.rhel8.x86_64 from pgdg17
- nothing provides libicuuc.so.60()(64bit) needed by postgresql17-server-17.4-1PGDG.rhel8.x86_64 from pgdg17
- nothing provides libssl.so.1.1(OPENSSL_1_1_1)(64bit) needed by postgresql17-server-17.4-1PGDG.rhel8.x86_64 from pgdg17
Problem 2: conflicting requests
- package postgresql17-17.0-1PGDG.rhel9.x86_64 from download.postgresql.org_pub_repos_yum_17_redhat_rhel-9-x86_64_ requires postgresql17-libs(x86-64) = 17.0-1PGDG.rhel9, but none of the providers can be installed
- package postgresql17-17.0-2PGDG.rhel9.x86_64 from download.postgresql.org_pub_repos_yum_17_redhat_rhel-9-x86_64_ requires postgresql17-libs(x86-64) = 17.0-2PGDG.rhel9, but none of the providers can be installed
- package postgresql17-17.1-1PGDG.rhel9.x86_64 from download.postgresql.org_pub_repos_yum_17_redhat_rhel-9-x86_64_ requires postgresql17-libs(x86-64) = 17.1-1PGDG.rhel9, but none of the providers can be installed
- package postgresql17-17.2-1PGDG.rhel9.x86_64 from download.postgresql.org_pub_repos_yum_17_redhat_rhel-9-x86_64_ requires postgresql17-libs(x86-64) = 17.2-1PGDG.rhel9, but none of the providers can be installed
- package postgresql17-17.3-1PGDG.rhel9.x86_64 from download.postgresql.org_pub_repos_yum_17_redhat_rhel-9-x86_64_ requires postgresql17-libs(x86-64) = 17.3-1PGDG.rhel9, but none of the providers can be installed
- package postgresql17-17.4-1PGDG.rhel9.x86_64 from download.postgresql.org_pub_repos_yum_17_redhat_rhel-9-x86_64_ requires postgresql17-libs(x86-64) = 17.4-1PGDG.rhel9, but none of the providers can be installed
- nothing provides libldap.so.2()(64bit) needed by postgresql17-libs-17.0-1PGDG.rhel9.x86_64 from download.postgresql.org_pub_repos_yum_17_redhat_rhel-9-x86_64_
- nothing provides libldap.so.2(OPENLDAP_2.200)(64bit) needed by postgresql17-libs-17.0-1PGDG.rhel9.x86_64 from download.postgresql.org_pub_repos_yum_17_redhat_rhel-9-x86_64_
- nothing provides libldap.so.2()(64bit) needed by postgresql17-libs-17.0-2PGDG.rhel9.x86_64 from download.postgresql.org_pub_repos_yum_17_redhat_rhel-9-x86_64_
- nothing provides libldap.so.2(OPENLDAP_2.200)(64bit) needed by postgresql17-libs-17.0-2PGDG.rhel9.x86_64 from download.postgresql.org_pub_repos_yum_17_redhat_rhel-9-x86_64_
- nothing provides libldap.so.2()(64bit) needed by postgresql17-libs-17.1-1PGDG.rhel9.x86_64 from download.postgresql.org_pub_repos_yum_17_redhat_rhel-9-x86_64_
- nothing provides libldap.so.2(OPENLDAP_2.200)(64bit) needed by postgresql17-libs-17.1-1PGDG.rhel9.x86_64 from download.postgresql.org_pub_repos_yum_17_redhat_rhel-9-x86_64_
- nothing provides libldap.so.2()(64bit) needed by postgresql17-libs-17.2-1PGDG.rhel9.x86_64 from download.postgresql.org_pub_repos_yum_17_redhat_rhel-9-x86_64_
- nothing provides libldap.so.2(OPENLDAP_2.200)(64bit) needed by postgresql17-libs-17.2-1PGDG.rhel9.x86_64 from download.postgresql.org_pub_repos_yum_17_redhat_rhel-9-x86_64_
- nothing provides libldap.so.2()(64bit) needed by postgresql17-libs-17.3-1PGDG.rhel9.x86_64 from download.postgresql.org_pub_repos_yum_17_redhat_rhel-9-x86_64_
- nothing provides libldap.so.2(OPENLDAP_2.200)(64bit) needed by postgresql17-libs-17.3-1PGDG.rhel9.x86_64 from download.postgresql.org_pub_repos_yum_17_redhat_rhel-9-x86_64_
- nothing provides libldap.so.2()(64bit) needed by postgresql17-libs-17.4-1PGDG.rhel9.x86_64 from download.postgresql.org_pub_repos_yum_17_redhat_rhel-9-x86_64_
- nothing provides libldap.so.2(OPENLDAP_2.200)(64bit) needed by postgresql17-libs-17.4-1PGDG.rhel9.x86_64 from download.postgresql.org_pub_repos_yum_17_redhat_rhel-9-x86_64_
- nothing provides libcrypto.so.1.1()(64bit) needed by postgresql17-17.0-1PGDG.rhel8.x86_64 from pgdg17
- nothing provides libcrypto.so.1.1(OPENSSL_1_1_0)(64bit) needed by postgresql17-17.0-1PGDG.rhel8.x86_64 from pgdg17
- nothing provides libreadline.so.7()(64bit) needed by postgresql17-17.0-1PGDG.rhel8.x86_64 from pgdg17
- nothing provides libcrypto.so.1.1()(64bit) needed by postgresql17-17.0-2PGDG.rhel8.x86_64 from pgdg17
- nothing provides libcrypto.so.1.1(OPENSSL_1_1_0)(64bit) needed by postgresql17-17.0-2PGDG.rhel8.x86_64 from pgdg17
- nothing provides libreadline.so.7()(64bit) needed by postgresql17-17.0-2PGDG.rhel8.x86_64 from pgdg17
- nothing provides libcrypto.so.1.1()(64bit) needed by postgresql17-17.1-1PGDG.rhel8.x86_64 from pgdg17
- nothing provides libcrypto.so.1.1(OPENSSL_1_1_0)(64bit) needed by postgresql17-17.1-1PGDG.rhel8.x86_64 from pgdg17
- nothing provides libreadline.so.7()(64bit) needed by postgresql17-17.1-1PGDG.rhel8.x86_64 from pgdg17
- nothing provides libcrypto.so.1.1()(64bit) needed by postgresql17-17.2-1PGDG.rhel8.x86_64 from pgdg17
- nothing provides libcrypto.so.1.1(OPENSSL_1_1_0)(64bit) needed by postgresql17-17.2-1PGDG.rhel8.x86_64 from pgdg17
- nothing provides libreadline.so.7()(64bit) needed by postgresql17-17.2-1PGDG.rhel8.x86_64 from pgdg17
- nothing provides libcrypto.so.1.1()(64bit) needed by postgresql17-17.3-1PGDG.rhel8.x86_64 from pgdg17
- nothing provides libcrypto.so.1.1(OPENSSL_1_1_0)(64bit) needed by postgresql17-17.3-1PGDG.rhel8.x86_64 from pgdg17
- nothing provides libreadline.so.7()(64bit) needed by postgresql17-17.3-1PGDG.rhel8.x86_64 from pgdg17
- nothing provides libcrypto.so.1.1()(64bit) needed by postgresql17-17.4-1PGDG.rhel8.x86_64 from pgdg17
- nothing provides libcrypto.so.1.1(OPENSSL_1_1_0)(64bit) needed by postgresql17-17.4-1PGDG.rhel8.x86_64 from pgdg17
- nothing provides libreadline.so.7()(64bit) needed by postgresql17-17.4-1PGDG.rhel8.x86_64 from pgdg17
(try to add '--skip-broken' to skip uninstallable packages)
sudo yum update
tells me it's updated to the current version already.
I tried sudo amazon-linux-extras list | grep postgresql
but it gave me sudo: amazon-linux-extras: command not found
Samantha Chan
Mar 18, 2025, 03:29 PM
• Last activity: Mar 23, 2025, 10:10 PM
0
votes
1
answers
29
views
Unable to change firewall active zone
I am trying to update my firewall but now i want to revert it back to public so basically the firewall is running and it was ``` public (active) target: default icmp-block-inversion: no interfaces: eth0 ``` after adding some ports and services, i read in the documentation that the inbound traffic sh...
I am trying to update my firewall but now i want to revert it back to public
so basically the firewall is running and it was
public (active)
target: default
icmp-block-inversion: no
interfaces: eth0
after adding some ports and services, i read in the documentation that the inbound traffic should be blocked except for http and https thus leading me to change the zone from public to drop suing
firewall-cmd --set-default-zone=drop
turns out it was a wrong documentation and thus i revert it back using the same command
firewall-cmd --set-default-zone=public
reload it and still stays the same even though when i run
firewall-cmd --list-all
it now shows **public** instead of **drop** but it is like this
public
target: default
icmp-block-inversion: no
interfaces:
i checked the active zone and it is still giving me drop as the active zone
firewall-cmd --get-active-zones
drop
interfaces: eth0
i make sure to run firewall-cmd --reload
all the time after changing but is keeps drop
as the active zone. i even did a reboot and it still stays the same how do i change the active zone from drop to public like it was?
I am running linux on amazon linux 2
Devs
(1 rep)
Mar 14, 2025, 08:34 AM
• Last activity: Mar 14, 2025, 09:19 AM
0
votes
1
answers
27
views
Checking if service is running, Service is installed already
So basically i installed an Automation Anywhere product in Amazon Linux 2, when i checked the `netstat -tulnp | grep LISTEN` i didn't found the Listener that's supposed to be there exist. Thus leading me to check if the service is running properly or not. I checked it using `systemctl status control...
So basically i installed an Automation Anywhere product in Amazon Linux 2, when i checked the
netstat -tulnp | grep LISTEN
i didn't found the Listener that's supposed to be there exist. Thus leading me to check if the service is running properly or not. I checked it using systemctl status control*
i already did sudo su -
if it's matter.
However the response was the "unit 'module' not found" i did some digging and turns out it appears that the systemd is not recognizing the service file as it is installed in out the etc/systemd
Some solution i tried are
- running systemctl daemon-reload
- running reboot
While there is a solution i haven't tried like creating the service file inside etc/systemd
i wonder if it's truly the solution or not as i am not familiar with linux. If i indeed needed to write the service file inside the etc/systemd
do i just copy the service file inside the installation path and copy it in the etc/systemd
path? Or is there anything i supposed to know/do beforehand?
Devs
(1 rep)
Mar 12, 2025, 01:02 PM
• Last activity: Mar 14, 2025, 08:24 AM
1
votes
1
answers
435
views
Using and debugging `overlayroot` in Ubuntu 24.04 EC2
I'm trying to use the overlayroot package in ubuntu 24.04 to boot into a read only root filesystem but have a writable overlay. Everything I see online says to update the `/etc/overlayroot.conf` file and then reboot. Here's what I have configured: ``` overlayroot=tmpfs:recurse=1,debug=1 overlayroot_...
I'm trying to use the overlayroot package in ubuntu 24.04 to boot into a read only root filesystem but have a writable overlay. Everything I see online says to update the
/etc/overlayroot.conf
file and then reboot. Here's what I have configured:
overlayroot=tmpfs:recurse=1,debug=1
overlayroot_cfgdisk="disabled"
But when I reboot and log in via SSH my /
isn't overlayfs
and there seems to be no logs indicating what the issue might be. The only thing I can think of is if the fact I'm doing this in EC2 making a difference.
nopcorn
(9379 rep)
Feb 7, 2025, 05:44 PM
• Last activity: Feb 15, 2025, 10:22 AM
0
votes
0
answers
45
views
When I do tomcat restart in amazon ec2 linux then EBS space increases to 3-4GB
There are 5 servers in our autoscaling which are our live servers. Out of them 2 server facing out of storage issue related to Elastic block storage (EBS). So I have done research on which directory taking space what was the initial space just after initialization then till the out of memory issue c...
There are 5 servers in our autoscaling which are our live servers. Out of them 2 server facing out of storage issue related to Elastic block storage (EBS). So I have done research on which directory taking space what was the initial space just after initialization then till the out of memory issue come.
Then again checked dir struc where space is gone ...Same struc is there not visible that any dir have taken 3 4 gb. but when one day I restarted my tomcat space increased to 3 4GB.
I dont have any idea why its happening ? my tomcat service file location is /etc/system/systemd/tomcat.service. Then tomcat dir location is /usr/share/tomcat/ . I have removed unwanted files, packages to get 5-6GB out of 12gb of EBS.
Then I used that LT to my autoscaling. Still after 4 5 or 7 days space becomes zero. Then I need to do manual autoscaling to get the new server with 4-5GB of space. I want its root cause of storage issue. Please help me.
I tried to get the details of whole dir struc and space using df -h and du -h command. Then also noted down those dir struc with space after new initialization using command sudo du -h --max-depth=1 /opt/ | sort -rh* then again checked after 4 5 days but space not increased in any of the dir in whole ec2. Means there might be no physical files are accumulating on my server. For example at the start When i do check space
Filesystem Size Used Avail Use% Mounted on
devtmpfs 3.9G 0 3.9G 0% /dev
tmpfs 3.9G 0 3.9G 0% /dev/shm
tmpfs 3.9G 488K 3.9G 1% /run
tmpfs 3.9G 0 3.9G 0% /sys/fs/cgroup
/dev/nvme0n1p1 12G 6.4G 5.7G 53% /
/dev/nvme0n1p128 10M 3.8M 6.2M 38% /boot/efi
tmpfs 793M 0 793M 0% /run/user/1000
then after space becomes zero I am able to see only
Filesystem Size Used Avail Use% Mounted on
devtmpfs 3.9G 0 3.9G 0% /dev
tmpfs 3.9G 0 3.9G 0% /dev/shm
tmpfs 3.9G 488K 3.9G 1% /run
tmpfs 3.9G 0 3.9G 0% /sys/fs/cgroup
/dev/nvme0n1p1 12G 12G 20K 100% /
/dev/nvme0n1p128 10M 3.8M 6.2M 38% /boot/efi
tmpfs 793M 0 793M 0% /run/user/1000
and same dir struc i got when sapce was 5.6 GB arround . I am not able to find that any dir has taken that much space all were at the same size but the space was gone. But when i do tomcat restart space increases to 4-5GB again.
Nandkishor Bobade
(1 rep)
Feb 11, 2025, 09:52 AM
• Last activity: Feb 11, 2025, 12:23 PM
0
votes
1
answers
27
views
Collecting memory-intensive data across different machines
I have an EC2 instance that I am using to subscribe to live data. I want to collect the data from several feeds and store it into a postgres database. On average, I get around 10000 updates every 15 seconds (roughly one update every 1.5 milliseconds) for one feed. The application that collects data...
I have an EC2 instance that I am using to subscribe to live data. I want to collect the data from several feeds and store it into a postgres database. On average, I get around 10000 updates every 15 seconds (roughly one update every 1.5 milliseconds) for one feed. The application that collects data is multithreaded. The distribution for the number of updates that I am expecting is pretty tight: the 99th percentile for the load is likely one update every one millisecond.
I am afraid of collecting too many feeds on one EC2 instances because it could cause some queueing and/or congestion in the data that I am collecting. I am already batching the updates I receive so that I don't need to update the database as frequently.
After doing some research, I believe the following two options are viable solutions. I was wondering whether anyone can please advise which of the two might be better because my Unix knowledge is limited.
1. Subscribe to the different feeds on isolated cores so that no one core is doing too much work. I believe this will require using
isolcpu
, and I can allocate a single CPU core to a set of websocket streams. The default settings seemingly permit the process to run on whichever cores the scheduler prefers.
2. Do not perform CPU isolation. Start other EC2 instances and perform the collection on different EC2 instances entirely.
Is one of these two options much better than the other, and is there any easier option that I am missing? If #1 happens to be better, is there a good way to determine how many streams a single core can handle?
Thank you.
Joey
(107 rep)
Jan 6, 2025, 02:05 AM
• Last activity: Jan 6, 2025, 07:26 PM
9
votes
3
answers
13881
views
How to get GNU parallel on Amazon Linux?
Preferably without having to compile it from source. I tried adding repositories I found on Google: [CentOS 6][1] and [CentOS 5][2], but both give me: [ec2-user@ip-10-0-1-202 yum.repos.d]$ sudo yum install parallel -y Loaded plugins: priorities, update-motd, upgrade-helper amzn-main/2016.03 | 2.1 kB...
Preferably without having to compile it from source. I tried adding repositories I found on Google: CentOS 6 and CentOS 5 , but both give me:
[ec2-user@ip-10-0-1-202 yum.repos.d]$ sudo yum install parallel -y
Loaded plugins: priorities, update-motd, upgrade-helper
amzn-main/2016.03 | 2.1 kB 00:00
amzn-updates/2016.03 | 2.3 kB 00:00
952 packages excluded due to repository priority protections
Resolving Dependencies
--> Running transaction check
---> Package parallel.noarch 0:20160522-1.1 will be installed
--> Processing Dependency: /usr/bin/fish for package: parallel-20160522-1.1.noarch
--> Processing Dependency: /usr/bin/ksh for package: parallel-20160522-1.1.noarch
--> Processing Dependency: /usr/bin/zsh for package: parallel-20160522-1.1.noarch
--> Processing Dependency: /bin/pdksh for package: parallel-20160522-1.1.noarch
--> Processing Dependency: /usr/bin/ksh for package: parallel-20160522-1.1.noarch
--> Processing Dependency: /usr/bin/zsh for package: parallel-20160522-1.1.noarch
--> Processing Dependency: /usr/bin/fish for package: parallel-20160522-1.1.noarch
--> Processing Dependency: /bin/pdksh for package: parallel-20160522-1.1.noarch
--> Finished Dependency Resolution
Error: Package: parallel-20160522-1.1.noarch (home_tange)
Requires: /bin/pdksh
Error: Package: parallel-20160522-1.1.noarch (home_tange)
Requires: /usr/bin/fish
Error: Package: parallel-20160522-1.1.noarch (home_tange)
Requires: /usr/bin/zsh
Error: Package: parallel-20160522-1.1.noarch (home_tange)
Requires: /usr/bin/ksh
You could try using --skip-broken to work around the problem
You could try running: rpm -Va --nofiles --nodigest
Matt Chambers
(241 rep)
Jun 15, 2016, 10:36 PM
• Last activity: Sep 5, 2024, 05:42 PM
Showing page 1 of 20 total questions