Questions tagged [lockfile]
The lockfile tag has no usage guidance.
lockfile
107
questions
2481
votes
15
answers
1.1m
views
Do I commit the package-lock.json file created by npm 5?
npm 5 was released today and one of the new features include deterministic installs with the creation of a package-lock.json file.
Is this file supposed to be kept in source control?
I'm assuming it'...
401
votes
27
answers
239k
views
Waiting for another flutter command to release the startup lock
When I run my flutter application it show
Waiting for another flutter command to release the startup lock
this messages and not proceed further.
212
votes
43
answers
144k
views
Quick-and-dirty way to ensure only one instance of a shell script is running at a time
What's a quick-and-dirty way to make sure that only one instance of a shell script is running at a given time?
138
votes
14
answers
150k
views
What is the best way to ensure only one instance of a Bash script is running? [duplicate]
What is the simplest/best way to ensure only one instance of a given script is running - assuming it's Bash on Linux?
At the moment I'm doing:
ps -C script.name.sh > /dev/null 2>&1 || ./...
35
votes
1
answer
1k
views
NPM lockfiles/shrinkwrap get random "dl" parameter tacked on to the "resolved" URL
Our company uses an Artifactory repository for storing internally-published packages and as a proxy for the NPM registry. Sometimes the resolved field in lockfiles/shrinkwrap files is as expected, ...
30
votes
1
answer
65k
views
Is 'lockfileVersion: 2' in package-lock.json from npm 7 compatible with older versions of npm?
I was wondering if the new lockfileVersion 2 was backwards compatable with older versions of NPM.
Now since NPM 7 is released, a new package-lock.json file is regenerated to a different structure. ...
28
votes
7
answers
24k
views
Python: module for creating PID-based lockfile?
I'm writing a Python script that may or may not (depending on a bunch of things) run for a long time, and I'd like to make sure that multiple instances (started via cron) don't step on each others ...
20
votes
1
answer
1k
views
Server-side custom git merge driver on GitHub/Azure Repos
I have a custom merge driver for git that helps merge lockfiles in a large monorepo shared by hundreds of engineers. Because lockfiles churn quite frequently, it's not uncommon for these files to ...
13
votes
4
answers
55k
views
Inconsistent dependency when i do terraform apply from plan -out=file
I am attempting to create new resources on GCP with a remote backend
After doing terraform init plan -out=tfplan and then terraform apply tfplan I get the following error:
Error: Inconsistent ...
12
votes
4
answers
40k
views
Why is my program creating empty .lck files?
I am trying to use Java Logger. I get my logger file (name.log) with the content, it works and I also get an empty name.log.lck file.
Why does this file appear, what program is creating them and ...
11
votes
1
answer
6k
views
npm equivalent of yarn install --check-files (or yarn check)
Update for 2020
This question originally referred to the yarn check command, but the docs state that this is deprecated in v1, and removed in v2, and yarn install --check-files should be used instead.
...
9
votes
2
answers
2k
views
Git: do not create index.lock for read-only operations
Is there a way to force git not to create index.lock for read-only operations like git status?
I'm displaying the status of my working tree in tmux, being updated every couple of seconds. Basically I ...
9
votes
2
answers
6k
views
Should bun.lockb file be versioned?
I'm migrating a Laravel+Sail project to use bun instead nodejs.
According the Bun docs, after run bun i, a binary lockfile named bun.lockb (similar to yarn.lock) is created to increase performance. ...
8
votes
2
answers
1k
views
Implementing a portable file locking mechanism
I have implemented a file locking mechanism along the lines of the suggestion from the linux man page for "open", which states:
Portable programs that want to perform atomic file locking using a
...
7
votes
3
answers
4k
views
In Makefile, how to cleanup lockfile files?
In GNU Make 3.81, I need to remove a lockfile in the event of an error in any part of the toolchain. Is there a special target that will allow me to do this? Do I need to write a wrapper script?
In ...
7
votes
0
answers
1k
views
Unable to install packages via renv::restore() ("R was unable to find one or more FORTRAN libraries during compilation.")
I've downloaded an old repo on a new laptop (running on MacOS Catalina) and attempted to run a R script.
The repo has a renv lock file - meaning, I should be able to restore all dependencies as they ...
6
votes
1
answer
3k
views
In Bash when creating a mutex, should I use `flock` or `mkdir`?
I searched for Bash how to create a mutex. I came across two different ways to create a mutex in Bash. Both are stackoverflow answers and both have >100 upvotes: one answer uses mkdir and the other ...
6
votes
1
answer
1k
views
Updating an indirect dependency in shrinkwrapped project
Is there a good way with npm (I'm on npm@5) to do a version bump for a nested dependency in a shrinkwrapped/lockfiled project?
Doing an npm install package@latest --save will update the shrinkwrap ...
5
votes
1
answer
7k
views
Yarn: use yarn.lock of dependencies
I use yarn to install packages directly from the companies' GitLab:
yarn add git+ssh://<user>@<host>:<repo>
For first-level dependencies, I use yarn --pure-lockfile to reconstruct ...
5
votes
2
answers
25k
views
Get the pid of the shell script and save it into a lockfile
I do my backups with rsnapshot which creates a lockfile with the process pid inside. Now I would like to make a backup from the rsnapshots backup, so I´m looking for a way to create this lockfile for ...
5
votes
1
answer
461
views
How to enforce only one running instance of a process in python Django framework?
I have a python Django manage command that should be called upon receiving an input file but this command is not safe for parallel calls. So an input file should be processed only and only when there ...
5
votes
1
answer
3k
views
lockfile-create does not work in bash script
This can be a very simple question but I don't understand why it behaves that way. When I invoke
lockfile-create --use-pid --retry 0 /tmp/my_lock_file
it returns 0, and next time it runs it returns ...
5
votes
1
answer
8k
views
Python: Daemonizing process with PID file
I am trying to daemonize a process using the daemon module. Code looks something like this
import sys
import time
import daemon
import lockfile
def do_things():
while True:
print "hello"...
5
votes
1
answer
8k
views
yarn.lock file is not updating after I update the version of a dependency in package.json and run yarn install or just yarn
In the repository of a project, I already have package.json and yarn.lock files. I'm updating the version of a particular package from version 2.0.14 to version 2.0.16.
When I do yarn install or just ...
4
votes
2
answers
5k
views
How to effectively lock a text file while using it in NodeJS?
I have several independent scripts reading and writing from the same text files. I'm trying to lock the text files while a module is reading/writing from them. At the moment I am using the lockfile ...
4
votes
7
answers
6k
views
memcached dead but subsys locked
service memcached restart yields:
stopping memcached: [failed]
starting memcached: [ ok ]
service memcached status yields:
memcached dead but subsys locked
ls inside /var/lock/subsys/ ...
4
votes
2
answers
8k
views
I don't understand the results from #service tomcat6 status
I'm trying to get Tomcat 6 running on Fedora 14. I'm quite new to this sort of thing, though I have managed to get Apache running before.
I suspect I've made mistakes on some quite basic levels, ...
3
votes
1
answer
2k
views
Lockfile in PHP
I have PHP script that should be run only once at the moment. If someone else tries to launch it again while it is already working, the second process should immediately die with error message.
...
3
votes
1
answer
5k
views
C++ Lock File Windows Blocking Mode
How can I block a file on Windows using C++ in a blocking fashion? By blocking I mean... a lock is requested and if the file is locked it will wait until it is unlocked, once the file is unlocked by ...
3
votes
4
answers
3k
views
What is the best way to lock a file to prevent multiple users from accessing it
I have a windows form app in which users can open, create and save xml files. Files are typically saved to a network folder. I need to make sure a given file can only be opened by one user at a time. ...
3
votes
1
answer
1k
views
How can I optionally add a lockfile to a docker container?
I'm trying to build a docker image that optionally adds a yarn (or npm lockfile) while building. I'd like to add it explicitly, but also not fail the build if it isn't included.
The intent is to ...
3
votes
1
answer
13k
views
How to have yarn fail on yarn install when package.json and yarn.lock are out of sync?
On a project I have replaced npm with yarn to get the benefits of it, and also enforce our dependencies are locked in via the yarn.lock.
Now, a developer added a library with npm@4, which only changed ...
3
votes
0
answers
4k
views
prometheus 2.0.0 error msg="Opening storage failed" err="open DB in /home/prometheus: Lockfile created, but doesn't exist"
Context : Trying to use prometheus on k8s 1.10.2 and using azure file storage as persistent storage medium
Problem : using azurefile storage with prometheus gives me the following error :
level=info ...
3
votes
1
answer
465
views
RSpec tests failing - Display socket is taken but lock file is missing
I'm trying to run RSpec tests in my Rails application and keep getting the following error:
:> rspec spec/controllers/api/v0/buying_strategies_controller_spec.rb
WARN: Unresolved specs during ...
3
votes
1
answer
2k
views
Sonarqube: Job fails with Couldn't delete lock file: .././.sonar_lock java.nio.file.NoSuchFileException
I am running command 'gradle sonarqube --stacktrace" which started resulting in the following:
Analysis report generated in /Users/shashank.devan/dev/myproject/build/sonar/batch-report
23:38:14.994 ...
3
votes
2
answers
3k
views
Why does cargo build ignore the lock file when lock changed by git?
I'm confused about the behavior of cargo build when the lock file changes between builds:
Run cargo clean
Run cargo build
Change the lock file to a previous version using git
Now rerun cargo build
...
2
votes
4
answers
1k
views
Detecting that files are being copied in a folder
I am running a script which copies one folder from a specific location if it does not exist( or is not consistent). The problems appears when I run concurently the script 2+ times. As the first script ...
2
votes
1
answer
4k
views
devtools::check - System command 'Rcmd.exe' failed, exit stauts:1, stdout + stderr:
I am currently developing a package for my PhD containing functions for the data analysis for my project. The setup is windows 10 and all files are saved locally on the PC and synchronised to One ...
2
votes
2
answers
97
views
Is lockfile necessary for reading and writing the same file of two processes
I'm working with Bash script and meeting such a situation:
one bash script will write things into a file, and the other bash script will read things from the same file.
In this case, is lockfile ...
2
votes
3
answers
2k
views
What is the best exception type to use for an I/O timeout?
I've written a Java class that implements a "lock file" to prevent a period job from running more than once concurrently. It's based upon java.nio.channels.FileChannel.tryLock and works quite well.
...
2
votes
1
answer
1k
views
renv 0.12.0 was loaded from project library, but renv 0.11.0 is recorded in lockfile
Upon opening a project on rstudio i have the following Warning:
Warning message:
renv 0.12.0 was loaded from project library, but renv 0.11.0 is recorded in lockfile.
Use `renv::record("[email protected]....
2
votes
1
answer
1k
views
procmail lockfile utility and NFS
Has anyone used the lockfile utility that ships with procmail in conjunction with NFS mounted directories?
The lockfile man page states that "Lockfile is NFS-resistant and eight-bit clean."
2
votes
3
answers
2k
views
Error: Inconsistent dependency lock file using Gitlab CICD file
I am using gitlab cicd to deploy aws services into AWS using terraform. I have tested out the deployments from local to machine to AWS and the deployment has been successful. When code is pushed to ...
2
votes
1
answer
1k
views
Proper way to handle a lock file on rebase conflict
Hi I am not sure if I am doing things correctly. Whenever I rebase an hit an issue with package.json and the lock file. I fix the package.json, but then delete the lockfile and just run pnpm i again.
...
2
votes
1
answer
3k
views
FileHandler creation gives NoSuchFileException cause missing .lck
im searching for 2 hours now fo a solution to this:
Im trying to add a FileHandler to a Logger in a JAR. The Log-Directory is outside.
In my IDE (NetBeans) this works:
public static void ...
2
votes
1
answer
2k
views
Cross-platform Pipenv.lock
I am creating a cross-platform Python app, using pipenv (as I understand poetry has the same issue too) for management of dependencies and virtual envs.
While trying to build the app on Windows and ...
2
votes
1
answer
4k
views
fcntl F_GETLK always return true
i'm trying to make a single instance daemon using a lock file but fcntl() doesn't seem to work as expected...
int creat_lock_file (char * pid_fn)
{
struct flock pid_lck = {F_WRLCK, SEEK_SET, 0, ...
2
votes
0
answers
165
views
Is there any implementation or how to implement `lockf()` for Windows?
I am porting some Linux code to Windows that uses lockf()
static string load_bulletin_from_file(const char* cache_filename)
{
int fd = open(cache_filename, O_RDWR); // lockf requires O_RDWR
if ...
2
votes
2
answers
1k
views
Installation of private npm package from CodeArtifact fails with "401 Unauthorized" with yarn and yarn.lock
We have a private npm package in CodeArtifact that we want to install as part of our package.json.
We are using Yarn as a package manager and have a yarn.lock file to control the versions.
When trying ...
2
votes
0
answers
686
views
npm protractor xlsx file wait and retry
I am trying to run protractor with multi capabilities (around 30 browsers with diff versions)
The data sheet is xlsx and is one sheet, which will be consumed. After each run the xlsx row will be ...