Questions tagged [lock]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1 vote
0 answers
35 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 ...
user avatar
0 votes
0 answers
20 views

libgnat-7 : Depends: gcc-7-base (= 7.5.0-6ubuntu2) but it is not going to be installed

I'm trying to install libgnat-7 but I get the following errors when I call 'sudo apt install libgnat-7': libgnat-7 : Depends: gcc-7-base (= 7.5.0-6ubuntu2) but it is not going to be installed ...
user avatar
0 votes
1 answer
60 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. ...
user avatar
0 votes
1 answer
44 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
  • 135
2 votes
0 answers
49 views

Debug & analyze pthread_mutex_lock issues

I've being recently facing some hardcore issues with Mutex lock for Linux, notably MySQL, memcache & APCu. Example: SQLSTATE[HY000]: General error: 1205 Lock wait timeout exceeded; try restarting ...
user avatar
  • 121
0 votes
0 answers
15 views

Autolock screensaver issues

I have a problem on my new laptop where it won't autolock after 15 minutes. The settings I could find seem to be correct. It's KDE on kubuntu 20.04, same as my PC which works as it should. Settings ...
user avatar
0 votes
0 answers
20 views

System locking up upon shutting down

Today upon shutting down my System I was greeted with loads of errors and informations i do not understand. This happened yesterday also and it didn't seem to continue to shut down "normally"...
user avatar
  • 13
1 vote
0 answers
19 views

Need utility to measure lock contention and thread Migration Rate

I Know it is trivial question but I searched several days for a utility to measure lock contention and thread migration rate but no luck.
user avatar
3 votes
1 answer
159 views

Code works in bash, not in zsh -- flock on arbitrary fd

Am new to shell scripting, and it makes me wonder why the following snippet does not work in zsh but does in bash? Is there a zsh equivalent of the same snippet? I get error parse error near `200' ( ...
user avatar
0 votes
1 answer
293 views

Watchdog message about CPU soft lockup in Fedora

I am running Fedora 34 KDE on my ASUS ZenBook Flip 14 with an Intel 11th Gen i7. It seems like every few minutes, I get this error message: watchdog: BUG: soft lockup - CPU#7 stuck for 22s! [swapper/7:...
user avatar
1 vote
0 answers
51 views

How to specify which display i3-lock starts showing the image on?

I sometimes use a monitor with my laptop. I use i3lock -t -i /path as my locking command and the image I use is of the resolution of my laptop screen. Running this with the monitor connected the puts ...
user avatar
  • 111
1 vote
1 answer
65 views

laptop keyboard locks up after closing lid

I have a Dell Latitude 5500 and a Dell Latitude 7550. The 5500 has Debian 10 and KDE, and the 7550 has Ubuntu 20.04 with KDE. In both laptops, if I close the lid, when I open it later the built-in ...
user avatar
  • 519
1 vote
2 answers
2k 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 ...
user avatar
0 votes
2 answers
1k 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 ...
user avatar
  • 135
0 votes
0 answers
51 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 ...
user avatar
  • 297
-2 votes
2 answers
422 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/. ...
user avatar
2 votes
1 answer
787 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 ...
user avatar
-1 votes
1 answer
73 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 &...
user avatar
  • 895
0 votes
1 answer
599 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 ...
user avatar
0 votes
1 answer
214 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), ...
user avatar
4 votes
3 answers
2k 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 ...
user avatar
  • 81
0 votes
1 answer
586 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 ...
user avatar
0 votes
1 answer
2k 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 ...
user avatar
  • 995
2 votes
3 answers
11k views

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

(base) rusiru@rusiru-X556UV:~$ sudo apt-get upgrade Reading packages lists... Done Building dependency tree Reading state information... Done E: The package packettracer needs to be installed, but I ...
user avatar
0 votes
3 answers
2k 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.
user avatar
4 votes
2 answers
2k 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 ...
user avatar
  • 1,625
1 vote
1 answer
1k 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: ...
user avatar
2 votes
1 answer
3k 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 ...
user avatar
1 vote
0 answers
216 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 ...
user avatar
0 votes
0 answers
295 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 ...
user avatar
2 votes
2 answers
594 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 ...
user avatar
24 votes
3 answers
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 ...
user avatar
1 vote
0 answers
171 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 ...
user avatar
  • 254
4 votes
2 answers
335 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 ...
user avatar
  • 376
0 votes
0 answers
301 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 ...
user avatar
  • 89.7k
0 votes
2 answers
69 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 ...
user avatar
  • 89.7k
4 votes
1 answer
689 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 ...
user avatar
-1 votes
1 answer
174 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: ...
user avatar
  • 89.7k
0 votes
1 answer
294 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 ...
user avatar
1 vote
2 answers
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 ...
user avatar
  • 2,646
1 vote
1 answer
155 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 ...
user avatar
0 votes
2 answers
232 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 ...
user avatar
-1 votes
3 answers
144 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 ...
user avatar
1 vote
2 answers
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 ...
user avatar
  • 10.7k
1 vote
1 answer
925 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 ...
user avatar
0 votes
2 answers
1k 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 ...
user avatar
1 vote
1 answer
346 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 ...
user avatar
1 vote
1 answer
375 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 ...
user avatar
  • 155
0 votes
1 answer
114 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 ...
user avatar
  • 173
6 votes
2 answers
32k 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 ...
user avatar