R360 Send a stopping signal only to PIDs named one by one
Send a signal that stops processes only to PIDs you name one by one, never through a command that picks the processes it signals by their name, command line or port.
Reason
A name, a command line or a port does not belong to one process alone: a pattern meant for a test server can also match a service that others rely on, or the agent’s own shell, and a command that signals every match stops them too (Art. II §6(1)). This has happened: a pattern meant for a test server also matched a production service and stopped it again and again. A PID named on its own reaches only the process it names.
Verification
This holds for every process, whoever started it; whether an agent may stop a process another task started at all is a matter of rule 336. A signal that stops processes is one meant to end them, such as SIGTERM or SIGKILL. Commands that pick the processes they signal by name, command line or port include pkill, killall, fuser -k, pgrep <pattern> | xargs kill, kill $(pgrep <pattern>) and kill $(lsof -t -i :<port>). Listing processes by a pattern, with pgrep -a or ps, to look at the candidates is not signalling them; signalling a PID taken from such a list is not picking processes by a pattern, and rule 359 says what to check before it. Signalling the process group of a PID the agent named is signalling that PID. Stopping through a tool that resolves the name it is given to the one process or container it manages, such as a container’s ID or name or a service manager’s unit, is not picking processes by name.
Violated when an agent sends a signal that stops processes through a command that picks them by name, command line or port, whether or not it matches anything.