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

learn more… | top users | synonyms (1)

2
votes
1answer
73 views

Apache - add http headers to requests, using script (bash, perl, php etc) to set the headers

I trying to work out the feasibility of a project where I want to be able to have a script run on every request (preferably filtered by mime type), and a script run to set the headers for the ...
2
votes
1answer
98 views

Implementing and testing a Subversion hook

Background I'm trying to implement a number of commit hooks for Subversion. I have done a lot of research to try and get a simple test hook to work, however I have had no luck. For reference I have ...
2
votes
1answer
67 views

How can I detect if I have access to a resource on an FTP server?

I'm trying to write bash script for file copying from local machine to FTP using lftp. Problem is, when someone enter inaccessible path for mkdir or put, then lftp returns: Access failed: 550 /: ...
2
votes
1answer
152 views

init script terminating with ssh session

We need to run pt-stalk on a handful of servers to keep an eye on mySQL, and I was sick of manually starting it every time the server rebooted. A little googling turned up an init script for pt-stalk, ...
2
votes
1answer
1k views

Linux- Permission denied?

I'm installing Neo4j server as a linux service, but when I install it, I get the following message: /sbin/insserv: Permission denied What is this? What should I do? I'm running everything with ...
2
votes
1answer
69 views

Supervisord unable to shutdown fcgi processes

I've managed to set up supervisord with fastcgi on a django project of mine, the problem is that when I make mi program stop, the server keeps running somehow, and my page keeps online. Here is my ...
2
votes
1answer
82 views

IBMi bash upgrade

I am trying to install rvm in PASE on IBMi (v7.1) but it is failing because it states bash version 3.2.25 is required. Running bash --version via CALL QP2TERM states I am running the following ...
2
votes
1answer
692 views

Calculate average of every 5 samples with rrdtool or other languages

I want to make an average of 5 samples and calculate a single value: Current output - I put resolution of 5 minutes but receive 5 samples: $ rrdtool fetch file.rrd AVERAGE -r 300 --start 1200000000 ...
1
vote
1answer
32 views

name of script within a init script

I have a script /etc/init.d/startup, where I do the following: creating a PID file that should look like: /var/run/**startup**.pid executing a screen of a java process, so I will like to create the ...
1
vote
1answer
43 views

crontab truncates file path

I try to run the following command: crontab -u root /root/iss/current/node/bin/installers/nl_brandless_selector_full_hd/nl_brandless_selector_full_hd_cron_file But I got an error like this: ...
1
vote
1answer
128 views

OSX - How can I copy a local users settings/preferences to a new mobile user

We are working on migrating all our local users to mobile accounts that are bound to LDAP. I am working on a script that prompts a user to enter their email and it creates a new mobile user and then ...
1
vote
1answer
143 views

Bash script for updating multiple servers not accepting RSA keys

In my environment I manage about 10 Linux servers that require regular package updates. I have a script written to connect to each individually and run the update. Additionally, I have RSA keys ...
1
vote
1answer
554 views

Dovecot quota-warning.sh not being excecuted

I would like to run a custom script with dovecot once the user reaches certain percents of their quota. The issue is that no matter what I try dovecot does not seem to execute my bash script. ...
1
vote
1answer
93 views

What is the Linux command to get the current PPTP ip address?

I have a Linux script that allows me to route some traffic through a VPN interface, and other traffic (from different IP) through another interface. This is my script: echo "ip route del default via ...
3
votes
0answers
197 views

Ssh issues on Google Compute Engine

I've just updated a few servers to the newer version of the gce stack, and I've started having some ssh issues that I'm not quite sure how to fix. I've already looked into issues with the firewall, ...
3
votes
0answers
146 views

Continuous ping on proxy preventing https requests, why?

I hope someone can help me solve this mystery. I have a small linux box which is configured as a transparent proxy on my network. I'm trying to run a script at startup that does a continuous ping to ...
3
votes
0answers
211 views

How do I download the avatar image from an Active Directory server?

I'm using the ldapsearch.exe binary that was installed along with an Oracle client. It took awhile to tease out the arguments that it wanted, but I'm able to successfully connect to AD and parse out ...
2
votes
0answers
50 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
47 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
102 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 ...
2
votes
0answers
772 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 ...
2
votes
0answers
88 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
116 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 ...
2
votes
0answers
120 views

Trying to script rsync using pam_exec

I'm trying to write a bash script that will execute rsync when called by pam_exec. I've tried a couple different ways, and I'm not sure what I'm doing wrong. When I try to run the script at login by ...
2
votes
0answers
368 views

Running Hudson builds with a higher nice level

I want to run build jobs in Jenkins with minimal cpu usage. I've tried this: Created the directory "jenkinsJdk".Jenkins is configured to use this dir as JDK "testJdk". A sample job uses "testJdk" ...
2
votes
0answers
244 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
29 views

WP-CLI doesn't run from cronjob

I made a bash script that uses WP-CLI and was intended to run from a cronjob. It runs fine from SSH, but fails when run through cron. During debugging I discovered that it was the WP-CLI part that ...
1
vote
0answers
13 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 ...
1
vote
0answers
12 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
33 views

SSH issues: keyfile and host file not working as expected

When I login to server with a key ssh -i /home/me/.ssh/id_rsa server everything goes without glitch. The key is authorized on the server. However if I try to do same from a shell script, I get a ...
1
vote
0answers
51 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
36 views

Script to restart service fails for most of the time

I have created a script that restarts a FTP service (a java program) if this value of below command is not zero: find /home/files_to_send -name "*.pdf" -cmin +10 | wc -l My problem is that while ...
1
vote
0answers
61 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 ...
1
vote
0answers
45 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
89 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
34 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
97 views

lftp mirror leaves empty folders on remote

My script is set up with this for lftp lftp -p 2218 -u $login,$pass sftp://$host << EOF set mirror:use-pget-n 5 mirror -c -P5 --depth-first --Remove-source-files ...
1
vote
0answers
62 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
48 views

mailx command strange behaviour from cron

I have a script that redirect the df output to a file and then send it in an email. The mail command is set up as following: /usr/bin/mail -s "Subject" -r from@nowhere.com toaddress@somewhere.com ...
1
vote
0answers
40 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
63 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 ...
1
vote
0answers
71 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
30 views

different interactive and non-interactive shells

A user account has it's shell defined in passwd file as bash. I would like to change this user account's shell to tcsh for non-interactive jobs (like ssh ), but keep interactive shell to bash. Is ...
0
votes
0answers
27 views

Ctrl-C is ignored by pppd when put in a shell script

I'm trying to connect to GPRS network through a serial port connected GSM modem. When I call /usr/sbin/pppd call <peer_name> from the command line, It correctly receives and handles Ctrl+C from ...
0
votes
0answers
75 views

SSH chroot solution for Mutt

We have an environment tailored for our users to log in via ssh and instead of gaining access directly to a shell, users have a script in place of a shell. The script simply launches Mutt on the ...
0
votes
0answers
86 views

echo or copy file using distributed shell aka dsh

I'd like to copy a text file using distributed shell (aka dsh), but I'm having some trouble getting that done. I could just copy it like a normal file, but I don't want to because I'm trying to create ...
0
votes
0answers
226 views

expect: how to use expect scripts from within a bash subroutine

I want to write a login script in expect. But I want this to be reused in different other scripts. I want to make all the login commands part of a bash subroutine. ie instead of expect_login.sh ...
0
votes
0answers
52 views

bash redirections stalling when used with jstack

I have this command that is not working and I have no idea how to debug. The command it never returns and I have to press CTRL+C. diff <(jstack 13928) <(sleep 10;jstack 13928) I want to make ...
0
votes
0answers
98 views

Get an OpenVZ container's cpuload realtime in a bash script

I have a bash script which uses CPU cores rather intensively. Recently my VPS was suspended due to server load. The main reason is a cron job for a bash script which checks for Wordpress plugins and ...
0
votes
0answers
337 views

Generating jmeter .jmx files with shell and variables

I've been trying to find a way to mass generate jmeter xml config files based on my template and some variables I could define somewhere. Bash didn't work too well, I was trying while read line with ...