1 package SL::System::InstallationLock;
8 return 1 if $::lx_office_conf{debug}->{keep_installation_unlocked};
11 if (!open($fh, ">", $class->lock_file_name)) {
12 die $::locale->text('Lock file handling failed. Please verify that the directory "#1" is writeable by the webserver.', $::lx_office_conf{paths}->{userspath});
23 return 1 if $::lx_office_conf{debug}->{keep_installation_unlocked};
25 my $name = $class->lock_file_name;
26 if ((-f $name) && !unlink($name)) {
27 die $::locale->text('Lock file handling failed. Please verify that the directory "#1" is writeable by the webserver.', $::lx_office_conf{paths}->{userspath});
36 return 0 if $::lx_office_conf{debug}->{keep_installation_unlocked};
37 return -f $class->lock_file_name;
41 $::lx_office_conf{paths}->{userspath} . "/nologin";
54 SL::System::InstallationLock - Handle locking the installation with a
59 SL::System::InstallationLock->lock;
60 # Do important and uninterruptable work!
61 SL::System::InstallationLock->unlock;
66 If the global lock file exists then no user may login. The
67 administration area is not affected.
69 There's a configuration setting
70 C<debug.keep_installation_unlocked>. If it is trueish then all of
71 these commands will always keep the installation unlocked: L</lock>
72 and L</unlock> won't do anything and L</is_locked> always returns 0.
80 Returns 1 or 0 depending on whether or not the installation is currently locked.
84 Creates the lock file. Throws an exception if writing to the lock file
87 =item C<lock_file_name>
89 Returns the file name for the global lock file.
93 Removed the lock file. Throws an exception if the lock exists and
94 removing the lock file fails.
104 Moritz Bunkus E<lt>m.bunkus@linet-services.deE<gt>