sudo ignores SIGTERM sent from same script

I'm trying to figure out why this doesn't work:#!/bin/bashsudo sleep 60 &sudo_pid=$!sudo kill $sudo_pidI'd expect that after the kill, the sudo command and its child sleep process would be terminated, but they aren't, as shown by this script:#!/bin/bashsudo sleep 60 &sudo_pid=$!sudo kill $sudo_pidif ps -p $sudo_pid > /dev/null; then sudo kill $sudo_pidelse echo "No sudo process running" exit 1fiif ps -p $sudo_pid > /dev/null; then echo "sudo (pid $sudo_pid) is still running" ps -F $sudo_pidelse echo "sudo successfully killed"fiWhich yields th...

how do i set up local bind server for dev machine to map to vhosts on server

im trying to set up a bind dns controller https://wiki.archlinux.org/index.php/BIND on an arch linux box. The main thing i need out of this is so i will no longer need to edit windows/system32/drivers/etc/hosts file again on my win7 dev box, and can delete every custom entry in it gone, and let bind map the vhost entries for me.here is my current /etc/named.conf http://dpaste.com/1XZ8JJRhere is my /var/named/falcon.local.zone http://dpaste.com/094JGPRi am changing my domain name to ld.pvt, so when you see references to falcon.local those are being upgradedA bit more about ...

How to stop background ssh tunnel automatically along with session?

What I want is like following:I could setup a ssh tunnel at background on a Linux machine(Actually, I'd like to setup it in my .bashrc)I could run process using this tunnel as any user on this machine at any time, only if the ssh tunnel process is active.When I quit from the terminal/session, the ssh tunnel should also quit as well.I know I could establish a background ssh tunnel in Linux as following:ssh -Nf -L 8000:1.2.3.4:8000 username@2.3.4.5While at the time I exit from this terminal/session, this ssh tunnel would still run at background.How to make it also quit automi...

cannot connect to putty and winscp

I have created a new ec2 instance and installed ftop on it i can able to access it through putty and winscp suddenly, once when i try to open through winscp it is giving error as The server rejected SFTP connection, but it listens for FTPconnections. Did you want to use FTP protocol instead of SFTP?Prefer using encryption.and through putty it is showing as CONNECTION REFUSEDi even tried restarting the instance may i know what is the problem it is very important for me kindly help. Make sure the FTP ports that you are trying to access on the machine are enabled by the i...

Not the same font in gnuplot when using command line or gnuplot commands

I have a file containing some commands : $ cat components.plg set terminal png set output output set font "Helvetica,10" unset xtics unset ytics unset border plot "reportGraph_0" with lines title "Component 0", "reportGraph_1" with lines title "Component 1", "aoi.txt" with lines title "Area of interest" $I won't display the contents of reportGraph_# here, but anything with 2 points in them is valid.I then launch gnuplot with this file as parameter, and I get a warning about Arial (I'm not entirely sure why). $ gnuplot -e "output='footprint.png'...

Own DNS server not working (SERVFAIL when trying to find out host's IP)

I've set up a DNS server on VM. When I'm using host with an IP addres, it works well (101.48.168.192.in-addr.arpa domain name pointer s1.home.lan.), but when I try to get domain's IP (eg. host s1.home.lan), I get Host s1.home.lan not found: 2(SERVFAIL). What has been configured wrong? Config files:named.conf.local:zone "home.lan" { type master; file "/etc/bind/zones/home.lan.db";};zone "48.168.192.in-addr.arpa" { type master; file "/etc/bind/zones/rev.48.168.192.in-addr.arpa";};home.lan.db:$ORIGIN .$TTL 3600home.lan. IN SOA ubuntu.home.lan. hostm...

Streaming bytes to ALSA playback device

I'm having a lot of trouble writing random bytes to an ALSA playback device using libasound. Eventually, my goal is to be able to route playback stream over the network and have it played on a remote device.The code presented in this question reads a WAV file into memory and writes it to the driver via snd_pcm_writei and it works. However, a crucial difference between what this code does and what I'm trying to do is the fact that I don't have all the data available to me right away. I'm looking to stream data as it becomes available.Adapting the above sample code to fit my ...

External user call won't able to run IPFS call

I have followed this guide: Could SLURM trigger a script(implemented by the frontend-SLURM user) when any job is completed? When the job stared on slurm, it triggers a script that I have implemented.I have the following script. It readable and executable by the SlurmUser. Inside script I want to call ipfs and return the hashes that are generated.hello.sh#!/bin/bash export IPFS_PATH="path/to/ipfs_repo/.ipfs"x=$(/usr/local/bin/ipfs add -r path/to/added)Updated this line on the slurm.conf.MailProg=/path/to/my_script.shSo when I run a job through SLURM, this script is able t...

AWS Linux AMI Image - Website offline

I have a PHP based website. I created an AMi image and relaunched it, The website is unreachable and offline. any one has a clue what am i doing wrong ? I tried relaunching another instance . did not work. ip and everything else works fine...any suggestion ? thanks Canyou check this? If it is an Amazon Linux: service httpd status service php-fpm status service mysqld status service nginx statusFirst one is for Apache, if it shows stopped or similar, well you just have to do this: service httpd start chkconfig httpd onSecond is for PHP-FPM, if it shows stopped o...

Setting up bind9 DNS forward lookup

I'm trying to configure a forward lookup zone file to do the followingNS record to my ns.mountains.comCNAME for smtp, www and imapAnd then a A record to my ip, 192.168.0.10Below is my code, but I don't know what I'm doing. I've tried to google and follow the bind9 ubuntu guide. But it's giving me nothing .. ideas? $TTL 604800 @ IN SOA ns.mountains.com. root.mountains.com. ( 2 ; Serial 604800 ; Refresh 86400 ; Retry ...

How to use an own kernel configuration for a raspberry pi in yocto?

I like to remove some unused drivers for my RPI2 + custom board. For that I am creating an own configuration via:bitbake linux-raspberrypi -c menuconfigand save the new kernel preset to the file defconfig.After this I created an append file for the linux-raspberryp recipe.So I created the file linux-raspberrypi%.bbappendand filled it with:FILESEXTRAPATHS_prepend := "${THISDIR}/linux-raspberrypi:"SRC_URI += "file://defconfig"PACKAGE_ARCH = "raspberrypi2"I put the defconfig file to:<meta-mylayer>/recipes-kernel/linux/linux-raspberrypi/raspberrypi2/defconfigWhen recompil...

How do I configure multiple ssh access to an EC2 instance

I've been trying to setup access to my Amazon instance to my development team and have hit a bit of a brick wall. I've tried a bunch of different tutorials online & none seem to work. Here's my config:I have access to the AWS Management Console & I'd rather that I be the central administrator of that account, they don't need to setup new instances.I have a t1.micro instance setup Running 32 bit Amazon Linux AMIMy developer and I both use Macs. I am able to ssh in to the machine using my key pair that is assigned to the boxI've previously tried to ssh into the machin...

awk triple files input

I have 3 files, as below: File1: 5372,5372,0,0,,1,0,1,1,0,1,0,0,0,0,0,0,1107,1107,,1.620000,1,2015-08-12,,,,,,,,,,,,,,,,,,,,,,,,2110,2110,0,0,,0,0,1,0,0,0,0,1,1,1,1,1,1601,1601,,9.500000,1,2015-05-29,,,,,,,,,,,,,,,,,,,,,,,,6900,6900,0,0,,1,0,1,1,0,0,0,0,0,0,0,0,1107,1107,,1.369000,1,2025-09-23,,,,,,,,,,,,,,,,,,,,,,,,8755,8755,0,0,,1,0,1,1,0,0,0,0,0,0,0,0,1107,1107,,3.232000,1,2025-05-22,,,,,,,,,,,,,,,,,,,,,,,,File2:5372,4074,,,,,2,,,2110,4100,,,,,0,,,6900,5246,,,,,0,,,8755,5270,,,,,0,,,File3:2187,25002188,15004227,20005270,3000Noting that the NF for File1, File2 and File3 r...

How to fetch Java version using single line command in Linux

I want to fetch the Java version in Linux in a single command. I am new to awk so I am trying something like java -version|awk '{print$3}' But that does not return the version. How would I fetch the 1.6.0_21 from the below Java version output?java version "1.6.0_21"Java(TM) SE Runtime Environment (build 1.6.0_21-b06)Java HotSpot(TM) 64-Bit Server VM (build 17.0-b16, mixed mode) Redirect stderr to stdout. Get first line Filter the version number.java -version 2>&1 | head -n 1 | awk -F '"' '{print $2}' [XXX]This is a slight variation, but PJW's solution didn't ...

gnuplot load does not work in a bash script

I have a bash script to automate plotting using gnuplot, however the load command within gnuplot does not work in the bash script. The command simply gets stuck.Here is my bash script:#!/bin/bashfor k in _1 +1 _2 +2 _3 +3 _4 +4 _5 +5 _6 +6do cd $k/surface for i in s ss do cd $i for j in `ls -d */` do if [ "$j" != "unrelax/" ]; then cd $j/spin echo $k$i$j gnuplot load 't-dos.plt' exit cd ../../ fi done c...

Expected 'trust-anchor' error message when install Bind DNS Server on Centos 5.9

I'm about installing DNS Server on VPS with Centos 5.9 operating system, I have followed step by step from this website https://www.digitalocean.com/community/articles/how-to-install-the-bind-dns-server-on-centos-6when i try to restart the service with: service named restart there is following error:Stopping named: [ OK ] Starting named: Error in named configuration:/etc/named.conf:23: unknown option 'dnssec-validation' /etc/named.conf:24: expected 'trust-anchor' near ';'any solution to solve this problem? Thank you very much. finally i remove these lines:dnssec-vali...

Page 1 of 248  |  Show More Pages:  Top Prev Next Last