All Questions

Tagged with
Filter by
Sorted by
Tagged with
21
votes
3answers
2k views

How does this script ensure that only one instance of itself is running?

On 19 Aug 2013, Randal L. Schwartz posted this shell script, which was intended to ensure, on Linux, "that only one instance of [the] script is running, without race conditions or having to clean up ...
1
vote
0answers
32 views

About `page_table_lock` in Linux process address space

I'm reading a tutorial about Linux page table, in the linked page Each process has its own page tables (threads share them). The pgd field of the memory descriptor points to the process's page ...
0
votes
2answers
40 views

Getting Information about locks associated with a process

I am unable to list the locks associated with a process and information about the locks i.e How many threads share this lock etc. Kindly tell my how to extract this information from a process ID. My ...
-1
votes
3answers
55 views

Locking user account in a specific way

I've been tasked with performing a lockdown on a user account (making it impossible to properly login-in to) in a very specific way. Im prohibited from: a) Altering his password (so passwd -l is out ...
0
votes
1answer
162 views

Duplication of a file descriptor associated with an fcntl lock?

According to the man page of dup2, this syscall make a new copy of the old file descriptor. The two descriptors do not share (the close-on-exec flag). However in case the file descriptor we are ...
0
votes
1answer
5k views

use of lockfile in script and it significance

I have a code in which below line is used due to which i got stuck.I have hunted the web but did not understand well.just got to know the basic set of info as below lockfile can be used to create one ...
4
votes
2answers
2k views

Linux file hierarchy - what's the best location to store lockfiles?

I want to synchronize processes based on lock files (/ socket files). These files should only be removable by their creator user. There are plenty of choices: /dev/shm /var/lock /run/lock /run/...
0
votes
1answer
712 views

Mandatory Locking in Unix

In Unix record locking is the technique used to lock the portion of a file for certain amount of time to maintain consistency of the data from concurrent access to the file. On this mechanism, ...
2
votes
1answer
1k views

Does linux have file locking protection when trying to rename/deleting files

I have a cron job that kicks off a new process every day. The process runs every 5 minutes and appends to a log file. Another cron job runs every 60 minutes. It takes some of the data in the log file,...
2
votes
1answer
3k views

Generic shared resource locking techniques - is flock the solution?

I need to implement a locking scheme so that multiple processes can share a set of resources, while a "special" process can obtain exclusive access to that set of resources. These are batch ...
6
votes
1answer
957 views

How to make sure only one instance accessing the file at a time in a folder?

I have a shell script which will be executed by multiple instances and if an instance accessing a file and doing some operation how can I make sure other instances are not accessing the same file and ...
5
votes
2answers
2k views

file corresponds to /proc/locks

$ cat /proc/locks 1: POSIX ADVISORY WRITE 458 03:07:133880 0 EOF 2: FLOCK ADVISORY WRITE 404 03:07:133879 0 EOF The fields are: ordinal number(1), type(2), mode(3), type(4), pid(5), maj:min:inode(6)...
29
votes
6answers
26k views

Gedit won't save a file on a VirtualBox share: Text file busy

I have a text file that I can change using other applications (for example openoffice). But when I try to change and save it using gedit, I am getting error from gedit: Could not save the file /...
26
votes
11answers
21k views

How to make sure only one instance of a bash script runs?

A solution that does not require additional tools would be prefered.
30
votes
5answers
48k views

What is a spinlock in Linux?

I would like to know about Linux spinlocks in detail; could someone explain them to me?