The documentation for scan_name is as follows:
This provides an extra check to see if the program is running. Normally we only check that the PID listed in the PID file is running. When given a regular expression, we will also match the name of the program as shown in ps.
As it is in the code, when scan_name is specified, we don't provide extra check - instead name is the only check that tells if the process is running or not.
Something should be changed - either the behavior (preferred, I guess) or the documentation.