diff -rpcd a/src/bin/pg_ctl/pg_ctl.c b/src/bin/pg_ctl/pg_ctl.c
*** a/src/bin/pg_ctl/pg_ctl.c	Mon Dec  2 09:17:05 2013
--- b/src/bin/pg_ctl/pg_ctl.c	Tue Dec  3 15:48:15 2013
*************** do_stop(void)
*** 907,913 ****
  
  		for (cnt = 0; cnt < wait_seconds; cnt++)
  		{
! 			if ((pid = get_pgpid()) != 0)
  			{
  				print_msg(".");
  				pg_usleep(1000000);		/* 1 sec */
--- 907,914 ----
  
  		for (cnt = 0; cnt < wait_seconds; cnt++)
  		{
! 			if ((pid = get_pgpid()) != 0 &&
! 				postmaster_is_alive((pid_t) pid))
  			{
  				print_msg(".");
  				pg_usleep(1000000);		/* 1 sec */
*************** do_stop(void)
*** 916,922 ****
  				break;
  		}
  
! 		if (pid != 0)			/* pid file still exists */
  		{
  			print_msg(_(" failed\n"));
  
--- 917,924 ----
  				break;
  		}
  
! 		if (pid != 0 &&			/* pid file still exists */
! 			postmaster_is_alive((pid_t) pid))
  		{
  			print_msg(_(" failed\n"));
  
*************** do_restart(void)
*** 997,1003 ****
  
  		for (cnt = 0; cnt < wait_seconds; cnt++)
  		{
! 			if ((pid = get_pgpid()) != 0)
  			{
  				print_msg(".");
  				pg_usleep(1000000);		/* 1 sec */
--- 999,1006 ----
  
  		for (cnt = 0; cnt < wait_seconds; cnt++)
  		{
! 			if ((pid = get_pgpid()) != 0 &&
! 				postmaster_is_alive((pid_t) pid))
  			{
  				print_msg(".");
  				pg_usleep(1000000);		/* 1 sec */
*************** do_restart(void)
*** 1006,1012 ****
  				break;
  		}
  
! 		if (pid != 0)			/* pid file still exists */
  		{
  			print_msg(_(" failed\n"));
  
--- 1009,1016 ----
  				break;
  		}
  
! 		if (pid != 0 &&			/* pid file still exists */
! 			postmaster_is_alive((pid_t) pid))
  		{
  			print_msg(_(" failed\n"));
  
