The tag has no wiki summary.

learn more… | top users | synonyms

2
votes
1answer
31 views

Controlling bash script concurrency, flock inheritance

I have a bash deployment script that handles deploying updated code to a Tomcat instance on CentOS, however, both Chef and RunDeck may invoke the script, and since Chef runs periodically there is a ...
5
votes
3answers
448 views

Why do package managers need lock files?

dpkg uses a lock file (/var/lib/dpkg/lock), when in use. Why are these lockfiles needed? Why are multiple instances not possible?
9
votes
1answer
315 views

communication between multiple processes

I have a bash script, which runs manager() function as a separate process for x-times. How is it possible to forward messages to all manager() processes from within the script? I've read about ...
-4
votes
1answer
58 views

Run series of command independent of each other

If I have a file with cmd1 cmd2 cmd3 And I want to run them independent of each other, and independent whether it outputs an exit status or not (that means do not expect to end, just keep ...
5
votes
1answer
62 views

Is `ln` atomic and reliable on NFS? Could NFS replace GFS in this use case?

I have a cluster with a bunch of servers with a shared disk containing a GFS global file system that all nodes access simultaneously. Each node in the cluster run the same program (a shell script is ...
2
votes
2answers
33 views

Does time window still exist when the signal is not blocked

Many books say that a time window exists between the generation and delivery of the signal when the signal is not blocked. So I wonder whether the time window still exists when the signal is not ...
1
vote
1answer
33 views

Scanning a file by multiply antiviruses

I start needing to scan for viruses all files uploaded to my website. I've implemented a pretty simple prototype which I tested locally and it seemed work well. However, I need to make it more complex ...
5
votes
1answer
1k views

cannot create regular file 'filename': File exists

I've been getting this strange error message in one of my build scripts - cp fails, returning the error "File exists". I've even tried using cp -f, which should overwrite the file if it exists, but ...
3
votes
1answer
63 views

How can the order of execution in the shell as it relates to redirection be upset about 1 time out of a 1000 on my system? [duplicate]

Considering this Q&A about the order of execution in the shell as it relates to redirection, and despite the fact that if a file doesn't exist it gets created first so that cat example.txt | shuf ...
10
votes
1answer
154 views

Moving a file to a file that is being read

When a file is moved and the destination file already exists and is currently being read, will the operation succeed? Will it depend on how long the reading operation on the destination file lasts?
1
vote
1answer
93 views

2 or more programs in same USB serial converter

Having a network of lets say 10 devices in RS-485, connected to the linux PC with a RS-485 to USB Converter. Already there is a C program interacting with the serial converter at /dev/ttyUSB0. My ...
3
votes
1answer
66 views

Edge cases in filesystem operations during backup and file copy

I have a question about file access in Linux that I cannot sum it up completely. Consider that I have a home directory that I backup it using rsync triggered via cron. My home directory is on an EXT4 ...
2
votes
1answer
354 views

What's the use dirsync option for mount?

Today I stumbled upon this mount's option: dirsync All directory updates within the filesystem should be done synchronously. This affects the following system calls: creat, link, unlink, ...
7
votes
3answers
1k views

tee + cat: use an output several times and then concatenate results

If I call some command, for instance an echo I can use the results from that command in several other commands with tee. Example: echo "Hello world!" | tee >(command1) >(command2) ...
1
vote
1answer
96 views

Will files created under source directory after running `cp` be copied?

Suppose I use cp to copy a directory to another place. If the process takes long, and I create a new file under the source directory, will it be copied, or does it depend on something?
7
votes
4answers
3k views

using parallel to process unique input files to unique output files

I have a shell scripting problem where I'm given a directory full of input files (each file containing many input lines), and I need to process them individually, redirecting each of their outputs to ...
1
vote
0answers
664 views

“No PostgreSQL user name specified” - possible concurrency issues?

For my dissertation I'm running the same cronjob on around 300 machines, which is: 10,25,40,55 * * * * /path/to/db_script.sh 1>/dev/null This script gets some values from the system (whether ...
1
vote
1answer
1k views

Capture user input while doing other things

Is there a way to have the output of a subprocess (something other than 'sleep' below) be dovetailed with the output from a foreground command-loop? For example: while true do echo "updating ...
7
votes
3answers
3k views

How to launch a set of program inside tmux or gnome-terminal within a script?

I wanted to launch a few commands simultaneously in tmux or gnome-terminal or xfterminal , every different tab with a single command running , and close that tab when that command finishes. Any ...
2
votes
1answer
3k views

How do you make a cross-process locking in Linux (C/C++)?

I need to make sure one process executes only in one instance at a time. On Windows you could use named mutex. But I have no idea what to use on Linux. I think I've seen an approach were app creates ...
4
votes
2answers
680 views

rm -rf failing if deleting in parallel

rm -rf will fail if something tries to delete the same file tree (I think because rm enumerates the files first, then deletes). A simple test: # Terminal 1 for i in `seq 1 1000`; do mkdir -p ...
3
votes
2answers
787 views

Can there be multiple kernels executing at the same time?

I know that Linux OS's are typically multi-programmed, which means that multiple processes can be active at the same time. Can there be multiple kernels executing at the same time?