Questions tagged [bash]

Most common system shell in Unix/Linux environments. Integrates very well with other softwares having a command line interface. Widely used in CI scripts and buildscripts.

0
votes
1answer
19 views

Add mapping ip and host into /etc/hosts with docker

I am using docker to scale my service. I know there's a command called --add--host for adding host into /etc/host However, I have a bunch of hosts need to be added. It's just too long to launch a ...
1
vote
0answers
10 views

How to launch a docker container from within a GitLab Shell runner?

Situation My CI pipeline needs to do the following: log into a VM and have access to a bash terminal run a bash script that launches a Docker container with parameters (e.g. -it mode or providing ...
1
vote
2answers
28 views

Automatically write new bash history to change-log file

Every time I ssh into a server I might issue some bash commands and then sign off (hup signal?). Is there a way to write the shell commands that I issued on the server to some changelog file? I want ...
0
votes
0answers
20 views

Environment variables inside the container during use “exec”

I want to run a command outside the container through "exec", which would be executed respectively inside the container. The command runs cmake, which uses environment variables that are already ...
0
votes
2answers
47 views

replacing values in shell script using sed [closed]

My shell script looks like this: FAILED_REQUEST_DIRECTORY=/bla/bla2 \ java -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=1234 \ -jar /xyz/abc-service-1.0-SNAPSHOT.jar \ --...
1
vote
4answers
92 views

shell script to pass values properties file in java

I have a properties file that looks like this: mysql.username=USERNAME mysql.pass=PASS I need to change USERNAME and PASS with variable values passed to shell script. I cannot use sed since that ...
1
vote
1answer
36 views

Bash Tokenization Errors on Jenkins JNLP Slave

Why might the below bash commands give me an error on a Jenkins JNLP slave in Kubernetes cluster? Each work on a local machine. Error: Syntax error: redirection unexpected IFS='/' read -r -a branch ...
1
vote
0answers
16 views

echo colon to file in cloud-init

So, I have this part in my cloud-init: runcmd: - echo : RSA 'node.crt' >> /etc/ipsec.secrets I literally can't make it to work. I tried these variations: runcmd: - echo : RSA 'node.crt' ...
0
votes
0answers
61 views

What is the best method to start and stop an application?

I have some scripts to start and stop a java application which using jenkins. First option Check the port and kill pid if java is running. And then start the application. Second Option Write the ...
2
votes
1answer
177 views

Automating the creation of an Apache virtual-host file specifically

When I create new web applications on my up-2-date Ubuntu-LAMP with Apache 2.4.x environment, I create their virtual-host files this way: s_a="/etc/apache2/sites-available/" s_e="/etc/apache2/sites-...
2
votes
1answer
72 views

Running consul in the background using Chef

I am trying to create a Chef cookbook that will run Hashicorp Consul in the background and will continue with the rest of the recipe and not get hung on starting Consul. I have tried the & method ...
1
vote
1answer
24 views

How can I diagnose php cli command execution time inside a docker container

I've recently migrated an event subscription service called by a bash script from Ubuntu, into a Dockerised container. The Docker image I am using is: FROM php:7.1-apache The script itself is pretty ...
2
votes
1answer
84 views

How to make the Jenkins agent build then start the server?

I want the Jenkins agent to build and start the server. I do this by specifying how to build and start the server in the Build step of the project configuration in Bash echo "Installing dependencies"...
6
votes
1answer
457 views

How to keep configuration files automatically during apt-get upgrade or install?

When performing and apt-get update; apt-get upgrade -y on a server I encountered the message: Setting up sudo (1.8.16-0ubuntu1.5) ... Configuration file '/etc/sudoers' ==> Modified (by you or by ...
0
votes
0answers
29 views

Valid use case for environment variable with length of zero?

Are there any valid use cases for allowing an environment variable to have a length of 0? $ FOO="" # why would anyone do this? The use case is that I'm writing a utility that parses environment ...
1
vote
1answer
619 views

Docker exec environment different to container shell

I have a docker image that looks something like this: FROM ubuntu:16.04 # Install packages for building ruby RUN apt-get update && \ apt-get -y install build-essential git curl wget net-...
0
votes
3answers
3k views

Access vault secret from bash script

I am looking for help on a direction on where to go from here. I have a Hasicorp Vault server running and accessible over DNS (local). I need to have a script get a secret from it then use that secret....
3
votes
1answer
257 views

Jenkins hangs on Windows CMD build that has GUI

I am attempting to automate imports and exports of Oracle's PeopleSoft Application Designer. It is a GUI program but it can operate in the windows command line for certain tasks. This project has ...
0
votes
1answer
81 views

The right way to Ansiblically deploy environments directly from Github:

Can one deploy an environment for some Linux OS (say, Ubuntu) from a raw Github playbook in a way similar to this (I wonder if it's the correct syntax)? bash <(curl -s https://raw....
5
votes
2answers
2k views

Interference of Docker CMD with su: works with su-exec but not with su?

In this bash script under Linux Alpine they have (line 8): exec su-exec "$ZOO_USER" "$0" "$@" As far as I know, su-exec is however an Apache httpd dependecy - can I avoid it installing it under ...