ajskill
- Organization of this page
Format
ajskill [-F service-name] [-B execution-registration-number] [-R] [-E] [{-T|-J}] [-X {yes|no|auto}] job-name-or-jobnet-name-or-job-group-name...
Description
Kills the execution of a job or jobnet.
If you kill a jobnet, the system aborts all jobs contained in that jobnet (including any nested jobnets). No other jobs in the jobnet will be newly created.
Execution privileges
You must have any of the following JP1 privileges:
-
JP1_AJS_Admin privilege
-
JP1_AJS_Manager privilege
-
JP1_AJS_Operator privilege
Arguments
-F service-name
Specify the name of the target scheduler service.
You can specify a character string of 1 to 30 bytes.
-B execution-registration-number
Specify the execution registration number of the job or jobnet you want to kill, in the YYYYMMDDNNN format. The meaning of YYYYMMDDNNN is as follows:
YYYY: Year of the date of execution
MM: Month of the date of execution
DD: Day of the date of execution
NNN: Execution registration sequence number for the date of execution
For details of the execution registration number, see 4.5.13 Methods of specifying generations when executing commands in the manual JP1/Automatic Job Management System 3 Overview.
-R
Kills all jobs and jobnets contained in the specified unit.
If you specify this option with the -E, -T, and/or -J options, the system kills the jobs or jobnets according to the specification of each option.
-E
Kills registered jobnets.
-T
Kills the root jobnet.
-J
Kills jobs.
-X {yes|no|auto}
Specify whether to automatically select the current unit for operation from the units listed in a planning group. The units in the job group are not, however, automatically selected regardless of the specified value. You cannot omit a root jobnet name.
-
yes
Specify this to automatically select a target unit.
When specifying a unit name in the command, omit a root jobnet name in a planning group.
-
no
Specify this if you do not want to automatically select a target unit.
You must specify a unit for which the command will operate. You cannot omit a root jobnet name in a planning group.
-
auto
Whether a target unit will automatically be selected depends on how the unit name is specified.
-
If you want to automatically select a target unit
Specify a unit name without a root jobnet name in a planning group.
-
If you do not want to automatically select a target unit
Specify a unit name with a root jobnet name in a planning group. The command will operate for the specified unit only. However, if there is a unit having the same name as the path name specified without a root jobnet name in a planning group, a root jobnet name is assumed to be omitted so that a target unit will be selected automatically.
-
job-name-or-jobnet-name-or-job-group-name
Specify the name of the job or jobnet you want to kill. You can also specify a job, jobnet, or job group name with the -R, -E, -T, or -J option.
You can specify a character string of 1 to 930 bytes.
You can specify more than one job, jobnet, or job group name. If you want to specify a jobnet name, however, you can specify only a root jobnet name. You cannot specify a manager job group name or manager jobnet name.
You can specify a logical host name or execution ID as a job, jobnet or job group name. If you specify an execution ID, however, the -B option is disabled. For details about how to specify the execution ID, see 1.1 Command syntax.
Notes
-
Either of the following users can kill a job:
-
A user granted the operation privilege when the job and all jobnets that contain the job were defined or when their attributes were changed
-
A JP1 user mapped to the OS user who has Administrators or superuser privileges
Note, however, that if yes is set after changing the ADMACLIMIT environment setting parameter from its default, even a JP1 user who was mapped to an OS user with Administrators or superuser privileges must have the operation privilege.
-
-
Either of the following users can kill a jobnet:
-
A user granted the operation privilege when the jobs contained in the jobnet and the jobnet were defined or when their attributes were changed
-
A JP1 user mapped to the OS user who has Administrators or superuser privileges
Note, however, that if yes is set after changing the ADMACLIMIT environment setting parameter from its default, even a JP1 user who was mapped to an OS user with Administrators or superuser privileges must have the operation privilege.
-
-
This command terminates abnormally if you execute it when a scheduler service is not running.
-
This command terminates abnormally if you attempt to kill a job or jobnet which is not running.
-
You can kill only processes started by JP1/AJS3. If a process has been started by JP1/AJS3, however, you may not able to kill it depending on the status of the process.
-
You cannot use this command for units subordinate to remote jobnets.
-
This command terminates abnormally if the target job or jobnet is being suspended.
-
When you specify that a target unit automatically be selected from the units in a planning group, an error occurs if you do not have the appropriate operation privilege for the automatically selected unit.
-
When the -X option is omitted, a target unit in a planning group is determined according to the value specified for the AJSAUTOJUDGE environment variable.
-
For an explanation of how to specify the name of a unit in a planning group, see Additional information in ajsplan in 3. Commands Used for Normal Operations.
-
You cannot forcibly terminate a jobnet connector.
-
You can forcibly terminate units that are in any of the following statuses:
-
A job that is queued or running
If the job is a queueless job, you can also forcibly terminate the job in Waiting for execution status.
-
A root jobnet that is in Now running, Running + Warning, Running + Abend, or Now monitoring status
-
-
If this command is executed, communication and database updating take place in JP1/AJS3. Therefore, if this command is executed many times in a short period, the overall JP1/AJS3 system will become heavily loaded and might affect operations. For example, processing might be delayed. If you need to repeat execution of the command, pause for a few seconds between each execution. In particular, you must be careful when you execute the command for event jobs, custom event jobs or for a jobnet that uses event jobs or custom event jobs, because of the limit values for event jobs and custom event jobs. For details about the limit values for event jobs and custom event jobs, see B.8 Limits for the event/action control in the JP1/Automatic Job Management System 3 System Design (Configuration) Guide.
Return values
0 |
Normal end |
Multiple of 4 within the range from 4 to 124 |
Abnormal end |
Additional information
-
If you kill a particular job, other jobs and jobnets in the jobnet containing the killed job, say jobnet A, will be executed as scheduled. To prevent other jobs and jobnets from running, you should stop the execution of jobnet A beforehand. You can use the ajsintrpt command to stop the execution of a jobnet.
-
Under UNIX, the system uses SIGKILL to kill a job or jobnet, so that you can also kill any application which captures a signal.
-
If you kill the generation in the Now monitoring status, that generation enters the Monitor terminated status. The generation in the Now running status or the generation in the Wait for start cond status waiting for the end of the generation in the Now running status is not killed.
-
This command ends when a request is made to the scheduler service to kill the specified unit. The command does not wait for the specified unit to finish.
Example
The following command kills job job1. Assume that this job is contained in the root jobnet, net1, and that the job group name is set in environment variable AJSPATH (if environment variable AJSPATH contains the job group name, you can omit the specification of the job group when executing the command).
ajskill net1/job1