Skip to main content

Questions tagged [lock]

Use for questions regarding the mechanism to prevent concurrent access to shared resources by means of lock files or in-memory synchronization primitives. For the mechanism to prevent access to unattended desktop computers, use "screen-lock" instead. For questions regarding the unresponsive computer programs, use "freeze" instead.

0 votes
1 answer
33 views

Inhibit scheduled job while package installation is in progress

On a Debian-based system I have a scheduled job (e.g. cron job, or systemd timer/service) which runs every 30 minutes. However, I don’t want that to happen concurrently with packages are being ...
user149408's user avatar
  • 1,343
2 votes
1 answer
36 views

How does fnctl provide byte range locks?

fnctl (https://man7.org/linux/man-pages/man2/fcntl.2.html) supports locking a portion of a file (specified by start position and length). Behind the scenes, what does the algorithm look like? I'm ...
Novice User's user avatar
  • 1,399
1 vote
1 answer
54 views

Unix-esque partial-file-locking mechanism

Linux and AFAIK most unixes expose the flock syscall for mandatory file-locking. My experience is admittedly limited with this, however am informed that it is kernel-enforced on the entire resource. ...
J-Cake's user avatar
  • 229
0 votes
0 answers
218 views

Lock icon suddenly appearing on folders in Ubuntu's /dev/sda8 partition

I'm encountering an issue on my Ubuntu system where folders in the /dev/sda8 partition shows a lock icon for some time then it goes away. It happened twice. In that locked state if I try to run any ...
RIR360's user avatar
  • 1
0 votes
0 answers
155 views

What's the best way to lock a directory from remove & edits?

I have a few directories that I want to lock. This lock should provide the following: Disallow anyone (including myself) from removing from that directory without a password Disallow anyone (...
David's user avatar
  • 163
2 votes
0 answers
313 views

elegant atomic distributed locking from bash/python?

In order to ensure non-concurrent execution of some code by multiple processes on a single node, I can implement advisory locking based on some atomic command (e.g. ln or mkdir) or I can use flock. ...
Alexis Huxley's user avatar
3 votes
1 answer
92 views

file locking mandated by OS/filesystem rather than opted into by file accessors?

Is there a way to have the OS (specifically, FreeBSD) or filesystem (specifically, ZFS) enforce that all access (or, at least, all non-root access, I guess) to a certain file must be done while the ...
Bob Vesterman's user avatar
0 votes
1 answer
52 views

Can a program tell whether I have a file open in an editor?

I have a file that I edit by hand (using emacs in a terminal window). I have a script that then reads the file, checks it for errors, and also modifies it by doing things like sorting lists in ...
jsdfhglskjghl's user avatar
5 votes
3 answers
839 views

Lock a bash script based on parameter?

I'm trying to find a way to lock a script based on a parameter given, but was unsuccessful in finding a proper answer. What I'm trying to achieve is prevent another user from running a script based on ...
classicmusiclover's user avatar
3 votes
3 answers
6k views

How To enable/disable "Lock Screen" setting from Linux terminal?

Please, do NOT say how to lock screen, i know how to do it. How To enable/disable Lock Screen service from terminal? Looks it's using xflock4 for locking screen. I can enable or disable it in ...
salto lenin's user avatar
0 votes
1 answer
94 views

How to customize default linux/unix PAM module faillock to lock user in all nodes in a cluster

I have implemented faillock in all nodes in cluster, so If any user failed login attempts three time through ssh he will be locked for certain period.It is working fine on individual node but I wanted ...
akash kumar's user avatar
0 votes
0 answers
1k views

apt-get autoremove --purge -y seems to be stuck

I'm not entirely sure why this is happening, so it seemed wise to ask here before I interfere with it. I'm attempting to install nasm, but I get the message: Waiting for cache lock: Could not get lock ...
Michael Macha's user avatar
2 votes
0 answers
437 views

Automatically lock my Linux computer when I walk away from it

I would like to lock my Linux (GNOME) machine after I walk away from it. Ideally, it should be a small Bluetooth tag / card that I carry in my pocket with a proximity sensor. Is there some software ...
martins16321's user avatar
1 vote
1 answer
2k views

How do I make Linux Mint stop pestering me for passwords all the time?

I run Linux Mint in a VM. Every single time I look at it, it has gone into some sort of "lock screen"-like state where it requires me to enter a password to get back. This is very annoying. ...
Frink Engelage's user avatar
0 votes
1 answer
1k views

Does locking in gnome allow background tasks like uplaoding to keep running?

I am uploading things in the back and want to lock the screen, but am not sure if the lock function in gnome locks the screen while allowing that to continue. So far it seems that the computer is not ...
user avatar

15 30 50 per page
1
2 3 4 5
10