Note book to help you and me remember some tricks

Category shell script

Ansible.builtin.script triggers permission denied on Oracle Linux

You have some Oracle Linux servers targeted by your ansible playbooks. You have your_playbook.yml that contains the following task: (The become and become_user instructions are not required to reproduce the error) If you got an error, just add the -vvv… Continue Reading →

How install and configure Clamav antivirus as a background process notifying you by email when a threat is detected

In the following post we will work on a rocky Linux server (RHEL). Install EPEL Repository The Rocky Linux base repo does not contain packages for installing Clamv. Install Clamav Set SELinux for Clamav freshclam: run Virus database signature update… Continue Reading →

OCI: increase the size of a block volume that is attached to a single instance (not shareable block volume)

Go to the instance where you have attached your block volume. Now go to the ssh terminal of this instance and execute: You can see your block volume has been mounted on /fortest Now in OCI console, increase by 1G… Continue Reading →

OCI: attach a new block volume to a single host

In the OCI console, go to the block volumes menu and create a block volume. Choose in which compartment you want to create your block volume (same compartment as your host), and choose a custom size. Let the other settings… Continue Reading →

Management of permissions on a mount point with Linux SGID and Linux group + ansible example

For the purpose of this article, I give you an existing context. Imagine you have one server share.yourdomain.com that is an NFS server, and that shares a directory that we have named /heapdump Now imagine you have ten other linux… Continue Reading →

Ansible shell execution: no environment variable are loaded

When you execute shell script with ansible module ansible.builtin.shell, bash is invoked as a non-interactive login shell. Consequently, environment variables from the user are not loaded. If you execute man bash, you’ll see: The solution is juste to explicitly load… Continue Reading →

Do not trust chatGPT answers

Just be careful, chatGPT is a black box, you don’t know how it resolves your question. Furthermore on a question when you lack some knowledge, your no able to evaluate the quality of the answer. For instance, I’ve just knock… Continue Reading →

Tomcat start with ansible doesn’t work, tomcat starts but process doesn’t stay active

It happens because when ansible close it’s ssh connection, and when the ssh connection is closed the kernel sends SIGHUP to the controlling process of the ssh connection. But when executing startup.sh, the java process will receive the SIGHUP and… Continue Reading →

How manage background tasks in your CLI and in your shell script application

First: do you know how to run background task not attached to your user session? Running a task attached to your current user session Imagine you establish an ssh connection to your linux host, or you just log into your… Continue Reading →

Shell script function particularities: declare local variables, run in background, …

Run a function in background and get its process ID Instead of creating another script that you call from your primary script you can simply declare a function (inside your primary script or inside another file that you include), and… Continue Reading →

« Older posts

© 2024 Software engineer >> Sysadmin >> Devops >> SRE

Up ↑