Questions tagged [lock]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0
votes
1answer
77 views

Arch linux: i3wm set lock time out (xss-lock i3lock)

I use arch with i3wm. I have enabled i3lock in my .config/i3/config: exec --no-startup-id xss-lock --transfer-sleep-lock -- i3lock Problem is my computer locks like every 10 minutes. How can I set ...
0
votes
0answers
14 views

LVM operation hangs forever and cannot be killed on QNAP TS-412 with Debian

I have ran into a problem with my LVM. I have 4 drives in RAID 10, each is 14 TB, and on top of that there is LVM. The machine is 32-bit QNAP TS-412 running Debian 10. When installing the system, I ...
0
votes
2answers
204 views

xautolock configuration in Arch i3

After recently switching to i3 in Arch, I need something to manage power. xautolock seemed to be a good choice. Unfortunately, I need it to do both systemctl suspend and i3lock at the same time, but ...
0
votes
0answers
15 views

Get the lock status of an account on Solaris

I do not have root privileges. I wish to get the lock status of a given account say mwss I'm on Sun Solaris uname -a SunOS myhost 5.11 11.4.27.82.1 sun4v sparc sun4v Below is the output from shadow ...
-1
votes
2answers
98 views

is there a really simple and reliable way to create a unique lock (file) on linux? without using `flock` [closed]

EDIT: I learned how to use flock for exclusive lock and how to not mess with it: https://superuser.com/questions/1619940/flock-is-randomly-failing-on-desktop-pc-but-not-on-notebook-could-be-defectiv/. ...
1
vote
1answer
155 views

Trying to use xautolock to suspend activity after a certain amount of time

I'm using manjaro (5.8.18-1-MANJARO) and the i3 window manager. I'm trying to lock the screen then suspend activity after given amounts of idle time. I've found that xautolock should suit my needs ...
-1
votes
1answer
39 views

Locking a file to (over)writing [closed]

I have a poorly designed build script that always overwrites files that it shouldn't; if I edit these files and then run the script, it overwrites their content and, thus, the build fails. How can I &...
0
votes
1answer
95 views

Function Lock. can't disable

I'm using a Feker Machinist 01. On both Manjaro and Linux Mint (both running cinnamon), the function keys are "locked" to those silly laptop features like enabling/disabling wifi, adjusting ...
0
votes
1answer
57 views

What permission does the “lock” group in /etc/group grant?

I'm running Fedora. $ ls -l /dev/ttyACM0 crw-rw----. 1 root dialout 166, 0 Jul 4 10:50 /dev/ttyACM0 I was not able to access /dev/tty/ACM0 (dynamic usb serial with an Arduino on the other end), ...
4
votes
3answers
985 views

Handling of stale file locks in Linux and robust usage of flock

I have a script I execute via cron regularly (every few minutes). However the script should not run multiple times in parallel and it sometimes runs a bit longer, thus I wanted to implement some ...
0
votes
1answer
427 views

“sudo apt autoremove” command doesn't work (“/var/cache/debconf/config.dat is locked by another process”)

I've tried solutions like editing on panasoniclpd.init file and it doesn't work too. This problem keeps shown whenever I try to update or install from the CLI sudo apt autoremove [sudo] password for ...
0
votes
1answer
890 views

A VNC server is already running, but no lock file for that

Although there is no X11 lock on display 12, vncserver can not start that display number due to a "VNC server that is running on 12". # rm /tmp/.X12-lock rm: cannot remove ‘/tmp/.X12-lock’: No such ...
1
vote
3answers
6k views

Unable to acquire the dpkg frontend lock (/var/lib/dpkg/lock-frontend), are you root?

I tried this but didn't work. How can I fix this?
0
votes
3answers
1k views

How to install nfslock daemon

I want to learn the NFS locking mechanism I surfed on net. Using nfslockd or rpc.lockd we can do. But in Debian there is no package. Anyone please help me whether shall we do or not in Debian.
2
votes
2answers
804 views

zsh: locking failed for ~/.cache/zsh/zsh_history: file exists

I have a bind mount ~/.cache/zsh folder between multiple hosts with rw and defaults when doing mount. When I start both machine and zsh trying to lock zsh_history, it gives error zsh: locking failed ...
0
votes
1answer
560 views

Cannot open access to console, the root account is locked after upgrade linux mint kernel

According to pervious question: Halt in Linux mint logo after update and upgrade After changing the GRUB file to: linux /boot/.... ro quiet text When I suspend the OS, I am going to loging page: ...
2
votes
1answer
2k views

file access blocked by a lock - how to remove?

I am trying to run the "check" function of backup program "restic" on one of the backup repositories it's created. No matter what I do, it crashes due to a fatal "already locked" problem. Here is the ...
1
vote
0answers
135 views

My SSD has unexpected inconsistencies showing up after some time of usage

I have Ubuntu installed on my Kingston SSD. 4.15.0-55-generic #60-Ubuntu SMP Tue Jul 2 18:22:20 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux The system itself is quite smooth, but I have a major data ...
0
votes
0answers
262 views

Unable to wake up after locking screen

Just installed Xubuntu 19.04. When I try to lock my screen it does some weird and crashes. Screen turns off and I have to turn the system off manually. Tried xscreensaver and it works just fine, but I ...
2
votes
2answers
413 views

Lock file naming pattern

Whenever I open a LibreOffice document, LibreOffice creates a lock file along the original file. This file has a naming schema like the following: .~lock.MyDocument.odt# Is this a LibreOffice ...
23
votes
3answers
3k 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
119 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 ...
3
votes
1answer
215 views

Lock Virtual Terminals when resuming

Many screen lockers (mine is i3lock) do not block access to other Virtual Terminals. This means that, if I leave a session opened in some VT, then even when the desktop is locked (for example when ...
0
votes
0answers
273 views

Does pid file work by assuming pid is not usable?

To use a pid file for ensuring singleton running instance of a program, I thought that when a process finishes running the program, it should remove the pid file, until I know it doesn't when reading ...
0
votes
1answer
39 views

Can we tell if a command is being run by a process or not, by looking at the flock lock file alone?

Is util-linux's flock implemented based on flock() in Linux C API? Can we tell if a command is being run by a process or not, by looking at the lock file alone? I found that when a command guarded by ...
4
votes
1answer
448 views

Is pseudo terminals ( unlockpt / TIOCSPTLCK ) a security feature?

After having opened the master part of a pseude-terminal int fd_pseudo_term_master = open("/dev/ptmx",O_RDWR); there is the file /dev/pts/[NUMBER] created, representing the slave part of he ...
-1
votes
1answer
95 views

Why “a lock file is the best approach if the resource is not a regular file, so using methods for locking files does not apply”?

Thanks to Mark's comment, pointing me to https://en.wikipedia.org/wiki/File_locking#Lock_files which says Shell scripts and other programs often use a strategy similar to the use of file locking: ...
0
votes
1answer
174 views

Allow DPMS to turn off screen with force when the screen is locked?

I discover that command xset dpms 300 which turn off the screen for example after 5 minutes (300s), and it wonderfully doesn't turn off the screen if a youtube video is actually playing even in a ...
1
vote
2answers
2k views

SELinux - How to avoid it preventing a process from write access on newly created files into folder

I'm hardly trying to correctly use selinux keeping it in enforced mode, but very often I encounter issues with it causing our application to work improperly. Our web application is java backend and ...
1
vote
1answer
99 views

Where is official documentation about locking mechanisms for etckeeper, apt, and/or dpkg?

Context: Want to put a lock on etckeeper/apt hook activity during special backup. Objective is to preserve whole package integrity, e.g., wait until any package installation is complete, and then ...
0
votes
2answers
111 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
102 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 ...
1
vote
2answers
1k views

some other process automatically locks /var/lib/dpkg/lock for few minutes when restarting my system.

I am running Debian buster a.k.a. Debian testing. From the last couple of weeks, whenever I reboot the sytem i.e. going to CTRL+ALT+F1 and run $ sudo reboot it reboots the systems as normally but ...
1
vote
1answer
749 views

Create lock using unix socket/port

Is there a way to hold a lock a unix port using netcat or some other command? I want to do something like this: set -e; nc -lock 8000 & # this needs to fail if another process holds the lock ...
-1
votes
1answer
910 views

How can I simulate locking a file?

I would like to lock a file, run some tests then unlock the file. How can I do this. I could use the command line, perl, or a shell script. The reason I would like to lock the file is occasionally ...
1
vote
1answer
240 views

fcntl delete behaviour

I have a requirement to create locks via fcntl to make a script run only once with a given argument. To achieve this, I create a file with the given argument and acquire lock on it. I have the below ...
1
vote
1answer
336 views

Slackware 14.2 - black screen after waking from sleep/lock - what process controls sleep/lock?

I have had Slackware 14.2 32bit installed on a netbook with LXDE as my main DE for about a month now. My main issue is that sometimes the screen is black on waking from sleep [suspend] and the only ...
0
votes
1answer
104 views

Basic spinlock doubt

I read that in spinlock, process keeps on waiting for the lock continuously in a loop until it receives signal(lock) or release(lock) from other process. This causes busy waiting and hence CPU cycles ...
5
votes
2answers
25k views

How do I kill the process holding the apt lock?

I tried doing sudo apt update but got: Could not get lock /var/lib/apt/lists/lock - open (11: Resource temporarily unavailable) E: Unable to lock directory /var/lib/apt/lists/ I am trying to get ...
0
votes
1answer
2k views

Lock Usb Flash-Drive on Ubuntu Linux

By security request, I need to set up Ubuntu desktops from my network to not allow the use of flashdrives or USB storage devices. But the USB mouse and keyboard should normally be charged. Is there a ...
15
votes
1answer
9k views

Why flock doesn't clean the lock file? [closed]

After process is completed, I see that the lock file isn't deleted? Is there any reason that why flock keeps the file ? Also how does flock knows if there is a lock acquired ? Here is the example ...
2
votes
1answer
1k views

Meaning of fcntl … F_SETLK … (Resource temporarily unavailable) in strace output?

When I use straceon Apache while it acts unresponsive, I get the following output: [pid 13704] fcntl(57, F_SETLK, {type=F_RDLCK, whence=SEEK_SET, start=1073741824, len=1}) = -1 EAGAIN (Resource ...
7
votes
1answer
23k views

NFS mount: Device or resource busy

I referred the following link, the solution works. How to get over "device or resource busy"? The above solution works when you are manually deleting the file. But I have a python script ...
0
votes
1answer
889 views

Arch: safely save and restore pacman databases

I want to backup the pacman sync databases after an execution of pacman -Sy, creating "restore points" which pacman -Suu can use to reverse a failed system upgrade. Further background can be found ...
0
votes
0answers
61 views

atop - how to check what process locked folder during umount?

I have some software which unmounting folder during it's operation. But for some reason it can't do it. When I trying to umount folder manually (almost in same time) it does work. Can someone let me ...
3
votes
1answer
1k views

Check and Test Lock from other Process

I am trying to create a service wrapper (init.d script) around one of my favorite applications. The application creates both a PID and a lock file, and so I'm trying to use those to ensure that I can ...
2
votes
3answers
4k views

Does killing a process close all files opened by that process?

I want to kill a process which has an open connection to a database. If I kill the process, can I make sure that the database is unlocked?
1
vote
1answer
454 views

How to lock non-virtual terminal? Something like “vlock -a”"

There is an option with vlock to lock all pts/tty at a time which is, $ vlock -a But vlock can lock only virtual consoles. There is also an option named TMOUT which will terminate the current ...
2
votes
1answer
1k views

lock screen session suspension in debian jessie

lock screen session suspension in debian jessie I just read of an issue that seemed similar to mine, and as I cannot comment yet and my problem is different I will ask my question outright. the ...
0
votes
1answer
304 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 ...