Bash is the Bourne Again SHell, the successor to the classic Unix sh (shell).

learn more… | top users | synonyms (1)

5
votes
0answers
211 views

grep is inconsistently defaulting to grep -P?

I have a script that does some housekeeping that works perfectly well when invoked from an interactive shell, but did nothing when invoked by cron. To troubleshoot this I started a shell with a 'blank'...
5
votes
0answers
2k views

Can't write to other users “you have write permission turned off”

For some reason I'm not able to write to other users on my system. [root@hostname ~]# write write: you have write permission turned off. [root@hostname ~]# mesg y [root@hostname ~]# mesg is y [root@...
2
votes
0answers
340 views

pg_basebackup automatic password

I have a master and slave database setup. The master database is on a secure network and only the postgres port is allowed through to the slave database server. The database needs to be secured and ...
2
votes
0answers
138 views

yum-complete-transaction in a crazy loop

I was trying to update a server that I have with yum update and it aborted because the server ran out of memory. I killed off a few processes that were not needed and ran yum-complete-transaction but ...
2
votes
0answers
98 views

SNMPget and bash gives strange results (gauge32 values incorrect)

Reallly strange to me but here is the problem. If I use an SNMP client such as ManageEngineMibBrowser to query the appliance I get what look like reasonable Numbers: dpStatusMemoryStatusUsage.0 97 ...
2
votes
0answers
181 views

use socat to provide password to bsign

I have many servers, where I deploy various binaries. For this purpose I use a script that packs them into archives, publishes to the local repository and then ssh-es to the target servers and ...
2
votes
0answers
289 views

error in killing tshark from shell script

I'm getting this error: *** glibc detected *** /usr/sbin/tshark: double free or corruption while doing as below, any idea why? #!/bin/bash trap 'my_exit; exit' SIGINT SIGQUIT count=0 /usr/sbin/...
2
votes
0answers
308 views

How to run script only if load balancer is NOT routing requests to it via bash script?

I have 4 cloud instances. First is a load balancer (LB), and then 2 instances with the identical setup holding the application code (APP1 & APP2). And finally, I have a database instance (DB). ...
1
vote
0answers
89 views

Bash: Running a background service for the duration of another process

I am running some automated scripts. For some tasks I sometimes need a ephemral background "service" to run. For example, I want to setup an ssh tunnel, run a test, and then have the tunnel removed. ...
1
vote
0answers
48 views

Why my profile looks for /usr/local/etc/profile.global (NIS)

My Ubuntu ID is manged by NIS/yellowpage. For some reason, when I log in, I'm getting this message. cat@local:~$ ssh catserver cat@catserver's password: Welcome to Ubuntu 15.10 (GNU/Linux 4.2.0-25-...
1
vote
0answers
51 views

How to display init output to tty7 (or main tty)

I have created my first init script in a linux server (ubuntu if that adds any information) that checks for an update, downloads it and executes it in each hour. The init file is as follows: /etc/...
1
vote
0answers
18 views

Generating and testing variable from a MAC vs PC in Linux Bash script

I am supporting two groups. I have one script, and I would like to keep it at one. I am having trouble with a test function: convtype=./Sample*/ if [[ -n convtype ]]; then where it runs fine for ...
1
vote
0answers
68 views

How to write a bash script that traps SIGTERM and kills the process and all sub-processes immediately

I have this script: #!/bin/bash set -e #WHAT SHOULD I WRITE HERE? sleep 60 # this is for testing #java ... | logger # this is what will be in the real script I want to be able to kill myscript and ...
1
vote
0answers
22 views

io error on no-match glob within cifs OSX -> debian jessie mount

Using a wildcard/glob (at least * and ?) in bash causes an input/output error when there are no matches on a samaba cifs mount in Debain Jessie 8.2. On other filesystems, the expected No such file ...
1
vote
0answers
57 views

mysql-cli - force quit on timeout / connection drop

I have set timeouts in /etc/profile.d/ to disconnect inactive users using TMOUT and this works great however now I am seeing users just holding their connection open by keeping some foreground process ...
1
vote
0answers
101 views

how to filter sar -d disk output tidily

sar -D output-I would like a suitable command to run alongside stress -hdd but this is the output which sar -D 1 10 gives. I have filtered it using both awk |'NR > 1 {printf "%4s%8s%8s\n",$13,$14,$...
1
vote
0answers
136 views

Linux: What could be the reason for random fails in updating passwd.byuid by running yppasswd?

In order to allow NOC users in my company to manage users through NIS I've created the following script: #!/bin/bash # This script will simplicate NIS user management. # You will not be able to ...
1
vote
0answers
120 views

Git Pull on CGI and Command Line have different results

I have an "after push" webhook on GitHub that calls a CGI script to update a Jekyll website. The script: user@server [~/_repo]# cat cgi-bin/githook.cgi #!/bin/bash echo Content-type: text/plain echo ...
1
vote
0answers
305 views

How to package shell script file with license key file

I am working on automated shell script for specific task . Before executing task steps I want to validate the license key provided to the customer with a webservice call. Please help me in making ...
1
vote
0answers
119 views

Is rbash secure if user login and ssh passwords are disabled?

I've got a server that I want to use as an SSH gateway for remote and local port forwarding. I don't want arbitrary commands to be able to be executed on it, only my scripts. I keep reading about how ...
1
vote
0answers
383 views

Running inotifywait on startup of machine

I want to start this inotifywait script on startup of the machine, in order to monitor the folders from the moment of booting: #!/bin/bash while inotifywait -r -e modify,attrib,close_write,move,...
1
vote
0answers
112 views

Load OpenMPI module for Apache httpd

How can I tell Apache httpd which version of MPI to use? I'm trying to run a Django web application under Apache httpd, and some of our pages make MPI calls with mpi4py. The problem is that I get an ...
1
vote
0answers
137 views

How best to maintain a recent bash version on amazon linux?

I require Bash 4.2 or higher. Amazon Linux default repositories only provide Bash 4.1. I have done some searches and can not find a yum repository for recent versions of Bash. I don't want to compile ...
1
vote
0answers
744 views

Barnyard2 error on start

Been setting up a snort box with barnyard2, run into the error below. Can someone please help? $Starting Snort Output Processor (barnyard2): ./barnyard2: 35: ./barnyard2: barnyard2: not found /etc/...
1
vote
0answers
213 views

What is a safe alternative to wildcards in /etc/sudoers?

In the /etc/sudoers file on my Red Hat server, I have this line: %webdevgroup ALL=NOPASSWD: /bin/chmod * /home/http/* This is clearly a bad idea, since someone could do something like this: sudo /...
1
vote
0answers
473 views

AD Authentication with SAMBA, Winbind and SSS

I'm having trouble authentication with AD to a SAMBA share on a linux server. Authentication appears to be working, but only halfway... [root@myserver ~]# wbinfo -a my_ad_user%password123 ...
1
vote
0answers
115 views

Linux: Process ignores signals

Processes running in Linux ignores signals (INT,QUIT,TERM) except KILL. Programs such as top, tail -f, sleep and etc, do not respond when pressing Ctrl+C and thus have to stop them from another ...
1
vote
0answers
309 views

Bash and background processes PGID and receiving signals

My actual problem is that a process I run in an rcfile in docker as docker run container bash --rcfile rcfile remains attached to the bash session by sharing the PGID which means that when I Ctrl-C an ...
1
vote
0answers
61 views

Odd behaviour with varnishlog and stream redirecting

I wrote a helper to debug varnish installation and have used it on both production and development server. The odd thing is, I encountered different behaviour even though the setup is nearly identical ...
1
vote
0answers
165 views

pam_exec not working? cannot allocate 2 bytes?

I am trying to run a script during the login process using PAM and libpam_exec; I have added this line to the desired file under /etc/pam.d/: auth required pam_exec.so debug log=/var/log/debug /usr/...
1
vote
0answers
117 views

Wrong PATH in init script on boot

Since the update of the System on my Synology NAS (x86), I have some problems with my startup scripts. The Bash scripts are stored in /usr/local/etc/rc.d. The scripts were executed for sure, because ...
0
votes
0answers
12 views

parallize postgres queries with bash and psql?

I'm trying to run a series of postgres functions/stored-procedures that operate on separate tables in parallel using bash + psql as follows: psql -d samples_20160612_0616 -c "select insert_function('...
0
votes
0answers
97 views

Install Bash + openSSH on Windows Server 2012

I had to create a Virtual Machine with Windows Server 2012. Now I want to connect to it via OpenSSH and Bash, installing OpenSSH is successful, however when I connect to the server via ssh ...
0
votes
0answers
27 views

If I know the inode of directory, is it possible to recover it after deleting?

More specifically, say I have a directory with lots of files in it. Suppose I know the inode of the directory. Now, if I delete the directory, is it possible to recover the files inside that directory ...
0
votes
0answers
12 views

ubuntu script - switching users in script and deleting previous user

On an AWS EC2 Ubuntu Instance I want to run a setup script that creates a new system admin (let's call it deploy) delete the default ubuntu user and continue the setup as the new deploy user. ...
0
votes
0answers
48 views

How run script after spamc, use args in script and redirect spamc output to sendmail?

I'm trying to perform custom actions after spamassassin. I have working line in postfix master.cf spamassassin unix - n n - - pipe user=spamd argv=/usr/bin/spamc -e /usr/sbin/sendmail -oi -f ${sender}...
0
votes
0answers
23 views

Add Filters to Users

I am running OpenVPN on Ubuntu 14.04 (dev tun) and I can't seem to get my learn-address script to run below I would like to run the learn-address script each time a user connects to OpenVPN that ...
0
votes
0answers
50 views

IP not showing in /var/log/secure under rhost

I'm trying to get Fail2Ban to block failed sudo -i commands, but the IP is not showing up in the logs. For example when I log into the server with: ssh -i ~/.ssh/id_rsa USER@1.2.3.4 I then use: ...
0
votes
0answers
9 views

Check files since latest git fetch/git pull

When command git fetch --tags --progress ssh://mygit/repos/repo.git +refs/heads/*:refs/remotes/origin/* is done, there is a following output detected: remote: Counting objects: 21, done. remote: ...
0
votes
0answers
24 views

Find Unknown Predicate JailedShell

Well, after months experimenting with ', ", and \" it seems i cant find the right pattern that could generate the correct code for a cron job on a jailed shell. I got this code below works on jailed ...
0
votes
0answers
26 views

Cacti poller runs but not full script

I'm using Cacti and the poller calls a bash script to get some data. At the end of this script I have a logical test and then an email is sent if true. The issue I have is when the poller is running ...
0
votes
0answers
32 views

“-bash: fork: retry: …” on SSH connection

When I'm connecting via ssh to my useraccount of my server, I'm getting the following error: -bash: fork: retry: No child processes -bash: fork: Resource temporarily unavailable Does anyone ...
0
votes
0answers
10 views

su rails session mysteriously closes by itself

I need help troubleshooting a strange problem. When I ssh into a server I have and do an su rails from root user the session closes by itself: root@ubuntu-server:/4# su rails rails@ubuntu-server:/4$ ...
0
votes
0answers
70 views

Python script to delete HPSA RHEL software policy items(rpms)

I'm looking to script the deletion of HPSA software policy items (RHEL RPMs) from HP Server Automation server. In our environment we have "HP Server Automation 10.22", using rhn_import command we ...
0
votes
0answers
72 views

Interpolating bash variable containing quotes into a command breaks it

I'm trying to split out some parts of a docker command that I have into bash variables. What I had previously, works fine: DOCKER_ID=$(docker run -e CGO_ENABLED=true -e LDFLAGS='-extldflags "-...
0
votes
0answers
35 views

how to execute bash script with args in parallel on all the remote server if the remote server in the from of pair

Please read carefully problem first and then give solution................... we are having 3 files in directory myscript.sh (the myscript.sh file contain many function and starts/stop to all-...
0
votes
0answers
24 views

fileschanged daemon dies unexpectedly

I'm using fileschanged to monitor files on server1 and run a bash script to synch the files in server1 to server2 if any of the files are changed in server1. to do that I'm running this: fileschanged ...
0
votes
0answers
16 views

Try to install intel cluster studio on centos, but skcript exiting with “binary operator expected”

I am trying to install intels cluster studio 2016 on my centos 7 system. When I try to execute the installation skript I get the following error. install.sh: line 331: [: /tmp/intel.pset hostname....
0
votes
0answers
23 views

SSH client - prompt editable as Windows control

Is there a way to configure PuTTY (or some other SSH client) to be aware of what's currently typed into the prompt and make it editable via the mouse (like in an input box / textfield that shows at ...
0
votes
0answers
39 views

Solaris 10 - after user shell change X won't start

I've created user with default shell bash, after some time I need to change default shell to /bin/sh (default Solaris 10 user shell) for practical reasons. After execution of command: usermod -s /...