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	2013-12-05 01:17:08.000000000 +0900
--- b/src/bin/pg_ctl/pg_ctl.c	2013-12-05 20:53:52.004000000 +0900
*************** 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,913 ----
  
  		for (cnt = 0; cnt < wait_seconds; cnt++)
  		{
! 			if (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"));
  
--- 916,922 ----
  				break;
  		}
  
! 		if (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 */
--- 997,1003 ----
  
  		for (cnt = 0; cnt < wait_seconds; cnt++)
  		{
! 			if (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"));
  
--- 1006,1012 ----
  				break;
  		}
  
! 		if (postmaster_is_alive((pid_t) pid))
  		{
  			print_msg(_(" failed\n"));
  
