11

Add to the end of your cron table entry: >> /home/myuser/myscript.log 2>&1 This will capture the output to a log file. By default, the output is mailed using the local mailer daemon to the user who owns the job, but I am not certain this daemon is running by default on an AWS instance. If it is, try running mail as the user owning the job; ...


6

$ curl http://169.254.169.254/latest/meta-data/local-ipv4 The private IPv4 address of the instance. In cases where multiple network interfaces are present, this refers to the eth0 device (the device for which the device number is 0). https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-metadata.html Alternately: $ ec2metadata --local-...


5

Found this on server fault. https://serverfault.com/questions/798427/what-linux-distribution-is-the-amazon-linux-ami-based-on To sum up: Quote from AWS folks : The Amazon Linux AMI is not based on any one upstream Linux project. That said, one of the goals of the most current Amazon Linux AMI (2013.09) is to be as compatible as possible with RHEL 6. ...


5

The error you're getting suggests you're actually running it via Python. Has some fool overwritten your bash binary with python ? Try running bash --version. Example [steve@centos ~]$ cat x1 #!/usr/bin/env bash if [ -f /home/username/hosts ] then rm /home/username/hosts fi [steve@centos ~]$ ./x1 [steve@centos ~]$ python x1 File "x1", line 3 if ...


5

I'm pretty sure your running into this issue using Ansible 2.8, it want's to blow up now when running YUM Package installs. Easy work around to this is to set the lock_timeout var to 100 + as the default is set to 0. - name: Install yum utils yum: name: - yum-utils - "@Development tools" lock_timeout: 180 Unfortunately the trouble with ...


5

It's better to set universal variables by creating scripts in /etc/profile.d. You want to create it with an extension of your shell name. For example, if it's bash, it will be called script.sh for example. /etc/profile.d/script.sh The syntax inside will be: export SOME_VAR_NAME=some-var-value You will need to start a new shell session to add the ...


4

The message means that the app your .service file started with ExecStart= exited and set the return code to 10 when it did so. There is no single uniform standard (although there are several partial standards and conventions) on result codes, so the only way to find out what the code 10 means is reading the documentation of that specific app... or its ...


3

Amazon Linux 2 If your version of Amazon Linux is >=2.0, it has systemd by default. In this case, you should simply be able to use the same unit file you have been using on CentOS, with the restart directives. Amazon Linux AMI If you are you are running Amazon Linux AMI, you will need to either use a separate supervisor to monitor your process (as poige ...


3

It should be sudo rpm --import linux_signing_key.pub Mind those two dashes.


3

By default, docker will store it's data under /var/lib/docker. Is this path also on the root partition? Also, by default when you create an EC2 instance the root volumes are usually small (around 4GB). It's highly likely that your root partition is also where your docker images are being stored and your root partition is too small. So either, make your ...


3

You apparently have enabled full output logging in sudo(ers). The easiest way to free space, probably deleting the sudo logs, is either logging as root, or using su, if your configurations allow it. Depending on how much /var/log is full, those procedures might or might not be successful. On the worst case, booting in single mode or from a live system ...


3

If you are using mysql/Oracle repos you should select Linux-generic in the Download MySQL Community Server page for AMI boxes and not RedHat/Fedora packages. Last time I checked AMI does not run systemd hence the error. While in past you could somewhat get away with installing RH packages in AMI Linux, nowadays with the convergence of Linux versions to ...


3

/usr/bin/find is a part if findutils package in RHEL and systems based on it (which amazonlinux is). So you have to install findutils to fix your dependency.


3

Short answer Command usermod -a ... adds the group, but the parameter group of the user module "sets the user's primary group". Details User one-username is created with the primary group one-username sudo groupadd -g 2002 one-username sudo useradd -u 2002 -g 2002 ... one-username Members of the group one-username are allowed to sudo User_Alias ...


3

To extend on my comment, in most cases you want to select a city which corresponds to your timezone. It is likely that you do not live in that city. In most cases, it will be one of the largest city of your state, country, or timezone. For example, in California we use Los_Angeles (full name is America/Los_Angeles). The plain timezones, such as EST will ...


2

[myuser@mymachine ~]$ ls -al /etc/rc3.d/*httpd* lrwxrwxrwx 1 root root 15 Oct 18 22:03 /etc/rc3.d/K15httpd -> ../init.d/httpd That is your problem. Script that start with K, which stands for kill, in /etc/rc3.d will not start at boot time, scripts that start with S will. If you do: [myuser@mymachine ~]$ mv /etc/rc3.d/K15httpd /etc/rc3.d/S15httpd Your ...


2

You're trying to install just the poppler-utils subpackage. That requires a poppler package of the matching version. You'll need to install those both. This may work (it often does on RHEL7 based systems), but may end up being a rabbithole of dependency chasing, which even if successful will result in a frankenstein's monster of a system. Why not just use ...


2

Issue solved. I had included requiretty in my LDAP. cn=defaults,OU=SUDOers sudoOption requiretty changed to !requiretty and all works properly. I will now limit !requiretty to just the affected user.


2

Most likely your hand-built libraries are built with debugging information, that's why they are so big. You can try strip libQuantLib.so.0.0.0 and see how much smaller it will get. You can try to rebuild the official RPM for Amazon Linux 2 like this: Download the source RPM (QuantLib-1.4-7.el7.src.rpm) Install rpm-build package (or rpmbuild? not quite sure ...


2

$aws sts get-session-token --duration-seconds 129600 Here 129600 can be any time you want to specify after which the keys will expire. This command will give the output like below. { "Credentials": { "SecretAccessKey": "Sb5pXXXXXQY3/qPoL/jUjMyXXXXXuev/0j3vXs", "SessionToken": "FQoGZXIvYXdzENv//////////...


2

You can use: yum install $(awk -F ',' 'BEGIN {ORS=" "} {for(i=1;i<=NF;i++) {print $i}}' filename) awk command will give packages names separated by space as input to yum.


2

Given the situation you've demonstrated, I would rm /etc/yum.repos.d/msprod.repo, as it is a duplicate of /etc/yum.repos.d/microsoft-prod.repo, and is also not owned by any package. To programmatically determine whether a file is owned by a package, check the return code of rpm: if rpm -qf /the/file > /dev/null 2>&1 then : the file is owned by ...


2

If you have GNU grep(1), and your version supports options -P or --perl-regexp, then its possible to use a positive lookbehind assertion grep -Po "(?<=UUID: ).*$" <(wipefs /dev/sd) Tests $ cat file offset type ---------------------------------------------------------------- 0x111 ext4 [filesystem] ...


1

You could use xargs to feed comma separated values to a command: xargs -d',' yum install < inputfile.csv If you want to install the packages one by one, you could pass the -n 1 flag to xargs: xargs -n1 -d',' yum install < inputfile.csv < sends the input file to xargs xargs -d',' takes ',' as delimiter to generate a list of arguments from the ...


1

I dont have a rpm based system in front of me to test that out but assuming your list is called rpmlist.txt and you want to install it with rpm and not yum. First do: for i in `cat rpmlist.txt | tr ',' '\n'`; do echo $i ; done if the output shows a the packages now line by line it should work with: for i in `cat rpmlist.txt | tr ',' '\n'`; do rpm -i $i ; ...


1

From your comment the default shell is set to /bin/false As the user jenkins you can use chsh to change this permanently. Alternatively if you don't want to perminantly change it you can just run bash as jenkins with: sudo -u jenkins /bin/bash -l


1

rpmbuild --rebuild QuantLib-1.4-7.el7.src.rpm will "just" extract the source package to ~/rpmbuild/{SPEC,SOURCES}/ and run rpmbuild -ba ~/rpmbuild/SPEC/QuantLib. Nothing else. You want to rebase to new version, which can be easy or tricky. Hard to say in advance. The easy version is that you rpm -Uvh QuantLib-1.4-7.el7.src.rpm cd ~/rpmbuild/SOURCE create ...


1

As @Kusalananda said there were multiple versions of pip in /usr/bin and /usr/local/bin. I solved this by creating a symbolic link from /usr/bin to the version in /usr/local/bin which is the latest version: sudo ln -s /usr/local/bin/pip /usr/bin/pip


1

I saw this happen two or three years ago, and I'm aware there are different AWS setups, so this might be doable or might not be. The machine could no longer be reached through SSH (it did allow login, but the shell would not start). There was no "hardware" terminal available as there is on other services. If your machine can fire up a root shell, then the ...


Only top voted, non community-wiki answers of a minimum length are eligible