Do flock locks reset after a system restart?

dajon

Let's say the system powers down unexpectedly due to a power outage.

Are flock locks always considered to be "unlocked" when the system starts up?

On Linux, flock relies on fcntl(...) (file descriptors).

Asked another way: Is it unnecessary to manually call flock -u <lock_filename> when the system first starts up? (i.e. from cron @reboot)?

Update:

BSD flock man pages says:

Locks are on files, not file descriptors.   That is, file descriptors
duplicated  through dup(2) or fork(2) do not result in multiple instances
of  a lock, but rather multiple references to a single lock.
dajon

My Linux guru friend here mentions that there is a kernel locks table (for file locks) (usually stored in memory) which disappears on a reboot.

And that the file lock is just there for as long as the process is running.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Eclipse Syntax Coloring reset after restart

From Dev

Bridge Configs Reset After systemctl restart network

From Dev

Mouse Button Order Gets Reset after Restart

From Dev

How do I release file system locks after cloning repo via JGit

From Dev

Do I need to restart my system after setting JAVA in system environment's path variable?

From Dev

Monitoring file locks, locked using flock

From Dev

Xampp Apache Not Starting After System Restart

From Dev

Restart a command after it gets killed by the system

From Dev

Suspend a running task then resume it AFTER a system restart

From Dev

Should I restart after updating my system?

From Dev

Reset a user's password each time after restart in ubuntu 18.04

From Dev

MySQL time_zone gets reset after restart

From Dev

GNU/Linux flock command: how to atomically take several locks

From Dev

Is it possible to reset or restart the GPU

From Dev

Why does a named pipe not get deleted after system restart?

From Dev

Win 8 system font turns into gibberish after each restart

From Dev

Restart monit automatically after it has been killed by the system

From Dev

After system repair, snapd service is not running/fails to restart

From Dev

How can I make windows reset the power plan to a chosen one after each restart?

From Dev

Windows "disappeared" after Ubuntu istalled and system setup reset

From Dev

Do I need to restart NginX after reconfigure for passenger to work

From Dev

Do you need to restart Heroku after every migration?

From Dev

How to make a do while loop restart after certain amount of iterations

From Dev

Do I need to restart NginX after reconfigure for passenger to work

From Dev

Do we have to restart git after updating .gitignore?

From Dev

How do I resolve inconsistent Windows 10 DPI after a restart?

From Dev

do you have to restart services after running sysctl -p?

From Dev

How do I prevent "standard folders" from recreating after restart?

From Dev

How do I get the menu program to restart after completing a selection?

Related Related

  1. 1

    Eclipse Syntax Coloring reset after restart

  2. 2

    Bridge Configs Reset After systemctl restart network

  3. 3

    Mouse Button Order Gets Reset after Restart

  4. 4

    How do I release file system locks after cloning repo via JGit

  5. 5

    Do I need to restart my system after setting JAVA in system environment's path variable?

  6. 6

    Monitoring file locks, locked using flock

  7. 7

    Xampp Apache Not Starting After System Restart

  8. 8

    Restart a command after it gets killed by the system

  9. 9

    Suspend a running task then resume it AFTER a system restart

  10. 10

    Should I restart after updating my system?

  11. 11

    Reset a user's password each time after restart in ubuntu 18.04

  12. 12

    MySQL time_zone gets reset after restart

  13. 13

    GNU/Linux flock command: how to atomically take several locks

  14. 14

    Is it possible to reset or restart the GPU

  15. 15

    Why does a named pipe not get deleted after system restart?

  16. 16

    Win 8 system font turns into gibberish after each restart

  17. 17

    Restart monit automatically after it has been killed by the system

  18. 18

    After system repair, snapd service is not running/fails to restart

  19. 19

    How can I make windows reset the power plan to a chosen one after each restart?

  20. 20

    Windows "disappeared" after Ubuntu istalled and system setup reset

  21. 21

    Do I need to restart NginX after reconfigure for passenger to work

  22. 22

    Do you need to restart Heroku after every migration?

  23. 23

    How to make a do while loop restart after certain amount of iterations

  24. 24

    Do I need to restart NginX after reconfigure for passenger to work

  25. 25

    Do we have to restart git after updating .gitignore?

  26. 26

    How do I resolve inconsistent Windows 10 DPI after a restart?

  27. 27

    do you have to restart services after running sysctl -p?

  28. 28

    How do I prevent "standard folders" from recreating after restart?

  29. 29

    How do I get the menu program to restart after completing a selection?

HotTag

Archive