Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 178274
Collapse All | Expand All

(-)src/start-stop-daemon.c (-3 / +20 lines)
Lines 962-967 Link Here
962
	if (START_WAIT > 0) {
962
	if (START_WAIT > 0) {
963
		struct timeval stopat;
963
		struct timeval stopat;
964
		struct timeval now;
964
		struct timeval now;
965
		bool retestpid = false;
965
966
966
		if (gettimeofday (&stopat, NULL) != 0)
967
		if (gettimeofday (&stopat, NULL) != 0)
967
			eerrorx ("%s: gettimeofday: %s", progname, strerror (errno));
968
			eerrorx ("%s: gettimeofday: %s", progname, strerror (errno));
Lines 991-1001 Link Here
991
				if (kill (pid, 0) == 0)
992
				if (kill (pid, 0) == 0)
992
					alive = true;
993
					alive = true;
993
			} else {
994
			} else {
994
				if (pidfile && rc_exists (pidfile)) {
995
				if (pidfile) {
995
					if (do_stop (NULL, NULL, pidfile, uid, 0, true, false, true) > 0)
996
					/* The pidfile may not have been written yet - give it some time */
997
					if (get_pid (pidfile, true) == -1) {
996
						alive = true;
998
						alive = true;
999
						retestpid = true;
1000
					} else {
1001
						retestpid = false;
1002
1003
						if (do_stop (NULL, NULL, pidfile, uid, 0, true,
1004
									 false, true) > 0)
1005
							alive = true;
1006
					}
997
				} else {
1007
				} else {
998
					if (do_stop (exec, cmd, NULL, uid, 0, true, false, true) > 0)
1008
					if (do_stop (exec, cmd, NULL, uid, 0, true,
1009
								 false, true) > 0)
999
						alive = true;
1010
						alive = true;
1000
				}
1011
				}
1001
			}
1012
			}
Lines 1006-1011 Link Here
1006
			if (timercmp (&now, &stopat, >))
1017
			if (timercmp (&now, &stopat, >))
1007
				break;
1018
				break;
1008
		}
1019
		}
1020
1021
		if (retestpid) {
1022
			if (do_stop (NULL, NULL, pidfile, uid, 0, true,
1023
						 false, true) < 1)
1024
				eerrorx ("%s: %s died", progname, exec);
1025
		}
1009
	}
1026
	}
1010
1027
1011
	if (svcname)
1028
	if (svcname)

Return to bug 178274