If there is a custom PID location configured for services and a non standard service account other than user "ranger", before finalizing upgrade, Ambari shows Ranger service as stopped.
Confirm that the Ranger process is running:
ps -ef | grep ranger
The pid and the chown values are hard coded in the /usr/bin/ranger*.
From this location, start and stop are called.
The pidf and the chown values are hard coded in the /usr/bin/ranger-admin from where start and stop are called if you invoke the same from ambari UI.
after changing those values to custom parameters ambari reported the service as running from UI.
cat ranger-admin | grep -i pid
Save and quit
After changing these values restart ranger service from ambari