Zymonic Toolkit Locking

This page contains all of the options for: sudo zymonic_toolkit.pl Locking

See the manual page for the locking toolkit for further details.

=Quickly Fixing 'locked by ...' When the User Can't Find the Actual Block=

First get the process zname and id using the debug icon:

sudo /usr/local/bin/zymonic_toolkit.pl Locking process_required_locks --system [system] --process [process zname] --process_id [process id]

to show if it is open in a block (near the top will be something like):

'current_lock_details' => { 'authenticated_user' => 'croberts', 'block' => { 'block_id' => '44885', 'block_title' => 'Ticket', 'page_id' => 11, 'page_name' => 'Scat', 'page_zname' => 'svz_scat' }                                   },

If it is then it suffices to delete that block from the DB e.g.

delete from zz_blocks where blockid = 44885;

If not then [TODO!!]

=Introduction=

Interpretting Results Examples:

06-09-2017 13:58:51 - $VAR1 = { 'current_lock' => '', 'is_valid' => 'false', 'key' => 'ZZLOCK.record.randomkey.6957', 'record_id' => 'randomid=6957', 'record_ident' => '6957', 'records' => [ {                          'amount' => '77080.00', 'autocreated' => 51187, 'catalogue_code' => '140', 'deleted' => undef, 'dept_id' => undef, 'has_field_permissions' => '', 'parent_process_id' => 51187, 'payment_type_id' => undef, 'posix_process_id' => 30238, 'reserved_amount' => '24710', 'rounding_difference' => undef, 'sec_id' => 'randomid', 'short_code' => 2, 'stock_holding_id' => 6957, 'sub_dept_id' => undef, 'tillsafe_id' => 180, 'zz_remote_keyfields' => undef, 'zz_source' => undef, 'zzlu' => '2017-09-05 09:09:19', 'zzluts' => '1504595983.89205' }                      ],          'table_name' => 'randomname', 'type' => 'record', 'zname' => 'randomzname' };

06-09-2017 13:51:41 - $VAR1 = { 'current_lock' => '', 'is_valid' => 'false', 'key' => 'ZZLOCK.process.12868', 'process_id' => '12868', 'type' => 'process', 'zname' => 'randomzname' };

Lock Data

Managing Locks Locks found using this toolkit module can also be managed by using the 'manage_locks' option.

=Action Required Locks= Returns list of locks which would be required to run the action. sudo zymonic_toolkit.pl Locking action_required_locks

 

System
The system to be inspected. This is required for the command to work. sudo zymonic_toolkit.pl Locking action_required_locks --system SYSTEM 



Configuration Directory
The name of the directory in which Zymonic definitions are stored; defaults to "/etc/zymonic". sudo zymonic_toolkit.pl Locking action_required_locks --configdir FOLDERPATH 



Username
The username of the person that the command is being run for. sudo zymonic_toolkit.pl Locking action_required_locks --username USERNAME 



Password
The password of the person that the command is being run for. Entering ! instead of the password will cause a password prompt to appear once the command has been started. sudo zymonic_toolkit.pl Locking action_required_locks --password PASSWORD 



IP Address
The IP address of the person that the command is being run for. This is only needed in the few cases when the permissions being checked rely on IP address. The majority of permissions do not use IP address, as such this field can generally be ignored. sudo zymonic_toolkit.pl Locking action_required_locks --ip_address IP 



Process ZName
The ZName of the Process. This is required for the command to work. sudo zymonic_toolkit.pl Locking action_required_locks --process ZNAME 



Process ID
Process ID to use for the command being run. This is required for the command to work. sudo zymonic_toolkit.pl Locking action_required_locks --process_id PROCESSID 



Transition ZName
The ZName of the Transition. This is required for the command to work. sudo zymonic_toolkit.pl Locking action_required_locks --transition ZNAME </li>



Action ZName
The ZName of the Action. This is required for the command to work. sudo zymonic_toolkit.pl Locking action_required_locks --action ZNAME </li>



Current Only
Only show locks currently in use. sudo zymonic_toolkit.pl Locking action_required_locks --current_only yes </li>



Lock Values Only
Only shows unique lock values. sudo zymonic_toolkit.pl Locking action_required_locks --lock_values_only yes </li>



Manage Locks
For each current lock encountered perform an action on it. Not applicable if using lock_values_only. Options are: V = Verify each lock found, R = Remove each lock found, Y = Prompt for each lock, N = No action for each lock. sudo zymonic_toolkit.pl Locking action_required_locks --manage_locks ARGUMENT </li>



Show Full Records
By default only record ids are shown for locks, set this flag to show the full record details. WARNING: No security checks are done in this lookup, all data within the DB records will be shown. sudo zymonic_toolkit.pl Locking action_required_locks --show_full_records yes </li> </ul>

Example
$ zymonic_toolkit.pl Locking action_required_locks --system SYSTEM --username USER --password PASSWORD --transition icedc_p_order_t_unpack --process rand_process --process_id 56583  --action rand_action 06-09-2017 13:52:53 - Process: Name (rand_process) 06-09-2017 13:52:53 - Current State: Name (rand_state) 06-09-2017 13:52:53 - Transition: Name (rand_transition) 06-09-2017 13:52:53 - Action: Name (rand_action) 06-09-2017 13:52:53 - Found 4 lock(s) needed to run this action 06-09-2017 13:52:54 - 4 Lock(s) 06-09-2017 13:52:54 - $VAR1 = { 'current_lock' => '', 'is_valid' => 'false', 'key' => 'ZZLOCK.record.rand_zname.6868', 'record_id' => 'stock_holding_id=6868', 'record_ident' => '6868', 'table_name' => 'rand_table', 'type' => 'record', 'zname' => 'rand_zname' };

06-09-2017 13:52:54 - $VAR1 = { 'current_lock' => '', 'is_valid' => 'false', 'key' => 'ZZLOCK.record.rand_zname.6894', 'record_id' => 'ID=6894', 'record_ident' => '6894', 'table_name' => 'rand_table', 'type' => 'record', 'zname' => 'rand_zname' };

06-09-2017 13:52:54 - $VAR1 = { 'current_lock' => '', 'is_valid' => 'false', 'key' => 'ZZLOCK.record.rand_zname.6936', 'record_id' => 'ID=6936', 'record_ident' => '6936', 'table_name' => 'rand_table', 'type' => 'record', 'zname' => 'rand_zname' };

06-09-2017 13:52:54 - $VAR1 = { 'current_lock' => '', 'is_valid' => 'false', 'key' => 'ZZLOCK.record.rand_zname.6957', 'record_id' => 'ID=6957', 'record_ident' => '6957', 'table_name' => 'rand_table', 'type' => 'record', 'zname' => 'rand_zname' };

Method action_required_locks completed.

=Process Required Locks= Returns list of locks which would be required to change this process at its current state. sudo zymonic_toolkit.pl Locking process_required_locks

Required Fields
These fields are always required for the command to succeed. <ul> System The system to be inspected. sudo zymonic_toolkit.pl Locking process_required_locks --system SYSTEM </li> Username The username of the person that the command is being run for. sudo zymonic_toolkit.pl Locking process_required_locks --username USERNAME </li> Password The password of the person that the command is being run for. Entering ! instead of the password will cause a password prompt to appear once the command has been started. sudo zymonic_toolkit.pl Locking process_required_locks --password PASSWORD </li> Process ZName The ZName of the Process. This is required for the command to work. sudo zymonic_toolkit.pl Locking process_required_locks --process ZNAME </li> Process ID Process ID to use for the command being run. This is required for the command to work. sudo zymonic_toolkit.pl Locking process_required_locks --process_id PROCESSID </li></ul>

Optional Fields
These fields provide optional extras on the command. <ul>  Configuration Directory The name of the directory in which Zymonic definitions are stored; defaults to "/etc/zymonic". sudo zymonic_toolkit.pl Locking process_required_locks --configdir FOLDERPATH </li> IP Address The IP address of the person that the command is being run for. This is only needed in the few cases when the permissions being checked rely on IP address. The majority of permissions do not use IP address, as such this field can generally be ignored. sudo zymonic_toolkit.pl Locking process_required_locks --ip_address IP </li> Current Only Only show locks currently in use. sudo zymonic_toolkit.pl Locking process_required_locks --current_only yes </li> Lock Values Only Only shows unique lock values. sudo zymonic_toolkit.pl Locking process_required_locks --lock_values_only yes </li> Manage Locks For each current lock encountered perform an action on it. Not applicable if using lock_values_only. Options are: V = Verify each lock found, R = Remove each lock found, Y = Prompt for each lock, N = No action for each lock. sudo zymonic_toolkit.pl Locking process_required_locks --manage_locks ARGUMENT </li> Show Full Records By default only record ids are shown for locks, set this flag to show the full record details. WARNING: No security checks are done in this lookup, all data within the DB records will be shown. sudo zymonic_toolkit.pl Locking process_required_locks --show_full_records yes </li> </ul>

Example
$ zymonic_toolkit.pl Locking process_required_locks --system SYSTEM --username USER --password PASSWORD --process icedc_p_order --process_id 12868 06-09-2017 13:51:41 - Process: Name (rand_process) 06-09-2017 13:51:41 - Current State: Name (rand_state) 06-09-2017 13:51:41 - Found 1 lock(s) needed on this process and its current state 06-09-2017 13:51:41 - 1 Lock(s) 06-09-2017 13:51:41 - $VAR1 = { 'current_lock' => '', 'is_valid' => 'false', 'key' => 'ZZLOCK.process.12868', 'process_id' => '12868', 'type' => 'process', 'zname' => 'rand_zname' };

Method process_required_locks completed.

=Transition Required Locks= Returns list of locks which would be required to run the transition. sudo zymonic_toolkit.pl Locking transition_required_locks

<ul> <li>

System
The system to be inspected. This is required for the command to work. sudo zymonic_toolkit.pl Locking transition_required_locks --system SYSTEM </li>

<li>

Configuration Directory
The name of the directory in which Zymonic definitions are stored; defaults to "/etc/zymonic". sudo zymonic_toolkit.pl Locking transition_required_locks --configdir FOLDERPATH </li>

<li>

Username
The username of the person that the command is being run for. sudo zymonic_toolkit.pl Locking transition_required_locks --username USERNAME </li>

<li>

Password
The password of the person that the command is being run for. Entering ! instead of the password will cause a password prompt to appear once the command has been started. sudo zymonic_toolkit.pl Locking transition_required_locks --password PASSWORD </li>

<li>

IP Address
The IP address of the person that the command is being run for. This is only needed in the few cases when the permissions being checked rely on IP address. The majority of permissions do not use IP address, as such this field can generally be ignored. sudo zymonic_toolkit.pl Locking transition_required_locks --ip_address IP </li>

<li>

Process ZName
The ZName of the Process. This is required for the command to work. sudo zymonic_toolkit.pl Locking transition_required_locks --process ZNAME </li>

<li>

Process ID
Process ID to use for the command being run. This is required for the command to work. sudo zymonic_toolkit.pl Locking transition_required_locks --process_id PROCESSID </li>

<li>

Transition ZName
The ZName of the Transition. This is required for the command to work. sudo zymonic_toolkit.pl Locking transition_required_locks --transition ZNAME </li>

<li>

Current Only
Only show locks currently in use. sudo zymonic_toolkit.pl Locking transition_required_locks --current_only yes </li>

<li>

Lock Values Only
Only shows unique lock values. sudo zymonic_toolkit.pl Locking transition_required_locks --lock_values_only yes </li>

<li>

Manage Locks
For each current lock encountered perform an action on it. Not applicable if using lock_values_only. Options are: V = Verify each lock found, R = Remove each lock found, Y = Prompt for each lock, N = No action for each lock. sudo zymonic_toolkit.pl Locking transition_required_locks --manage_locks ARGUMENT </li>

<li>

Show Full Records
By default only record ids are shown for locks, set this flag to show the full record details. WARNING: No security checks are done in this lookup, all data within the DB records will be shown. sudo zymonic_toolkit.pl Locking transition_required_locks --show_full_records yes </li> </ul>

Example
$ zymonic_toolkit.pl Locking transition_required_locks --system SYSTEM --username USER --password PASSWORD --transition rand_transition --process rand_process --process_id 12868 06-09-2017 13:48:22 - Process: Name (rand_process) 06-09-2017 13:48:22 - Current State: Name (rand_state) 06-09-2017 13:48:23 - Transition: Name (rand_transition) 06-09-2017 13:48:29 - Found 12 lock(s) needed to run this transition 06-09-2017 13:48:31 - 12 Lock(s) 06-09-2017 13:48:31 - $VAR1 = { 'current_lock' => '', 'is_valid' => 'false', 'key' => 'ZZLOCK.record.rand_zname.1008', 'record_id' => 'stock_holding_id=1008', 'record_ident' => '1008', 'table_name' => 'rand_table', 'type' => 'record', 'zname' => 'rand_zname' }; ...

Method transition_required_locks completed.

=User Locks= Returns list of locks which would be required to run the action. sudo zymonic_toolkit.pl Locking user_locks

<ul> <li>

System
The system to be inspected. This is required for the command to work. sudo zymonic_toolkit.pl Locking user_locks --system SYSTEM </li>

<li>

Configuration Directory
The name of the directory in which Zymonic definitions are stored; defaults to "/etc/zymonic". sudo zymonic_toolkit.pl Locking user_locks --configdir FOLDERPATH </li>

<li>

Username
The username of the person that the command is being run for. sudo zymonic_toolkit.pl Locking user_locks --username USERNAME </li>

<li>

Password
The password of the person that the command is being run for. Entering ! instead of the password will cause a password prompt to appear once the command has been started. sudo zymonic_toolkit.pl Locking user_locks --password PASSWORD </li>

<li>

IP Address
The IP address of the person that the command is being run for. This is only needed in the few cases when the permissions being checked rely on IP address. The majority of permissions do not use IP address, as such this field can generally be ignored. sudo zymonic_toolkit.pl Locking user_locks --ip_address IP </li>

<li>

Lock Values Only
Only shows unique lock values. sudo zymonic_toolkit.pl Locking user_locks --lock_values_only yes </li>

<li>

Manage Locks
For each current lock encountered perform an action on it. Not applicable if using lock_values_only. Options are: V = Verify each lock found, R = Remove each lock found, Y = Prompt for each lock, N = No action for each lock. sudo zymonic_toolkit.pl Locking user_locks --manage_locks ARGUMENT </li>

<li>

Show Full Records
By default only record ids are shown for locks, set this flag to show the full record details. WARNING: No security checks are done in this lookup, all data within the DB records will be shown. sudo zymonic_toolkit.pl Locking user_locks --show_full_records yes </li> </ul>

Example
$ zymonic_toolkit.pl Locking user_locks --system SYSTEM --username USERNAME --password PASSWORD 07-09-2017 07:45:14 - Found 18 lock(s) this user currently holds 07-09-2017 07:45:14 - 18 Lock(s) 07-09-2017 07:45:14 - $VAR1 = { 'current_lock' => 'user:::11584', 'current_lock_details' => { 'authenticated_user' => 'user', 'block' => { 'block_id' => '11584', 'block_title' => 'rand_block', 'page_id' => 4, 'page_name' => 'Name', 'page_zname' => 'rand_zname' }                                   },          'is_valid' => 'true', 'key' => 'ZZLOCK.process.120717', 'process_id' => '120717', 'type' => 'process' };

07-09-2017 07:45:14 - $VAR1 = { 'current_lock' => 'user:::11584', 'current_lock_details' => { 'authenticated_user' => 'user', 'block' => { 'block_id' => '11584', 'block_title' => 'rand_block', 'page_id' => 4, 'page_name' => 'Name', 'page_zname' => 'rand_zname' }                                   },          'is_valid' => 'true', 'key' => 'ZZLOCK.record.rand_zname.3051', 'record_ident' => '3051', 'table_name' => 'rand_table', 'type' => 'record' };

...

Method user_locks completed.

=Help= When using a terminal to run zymonic_toolkit.pl the user will see prompts that contain the same information that is found within this manual. sudo zymonic_toolkit.pl Locking help

<ul> <li>

Command
The specific command to show help for. If not set then shows help for all commands. sudo zymonic_toolkit.pl Locking help --command COMMAND </li> </ul>