Compare commits
	
		
			6 Commits
		
	
	
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
|   | da0ddd521a | ||
|   | 1967cd402c | ||
|   | a7f3eb466c | ||
|   | ae7490929d | ||
|   | ddbd1caa35 | ||
|   | a249651218 | 
							
								
								
									
										65
									
								
								ChangeLog
									
									
									
									
									
								
							
							
						
						
									
										65
									
								
								ChangeLog
									
									
									
									
									
								
							| @@ -1,3 +1,39 @@ | ||||
| commit 1967cd402caf6e229263f15aef40c6c4d8f60ce3 | ||||
| Author: William Hubbs <w.d.hubbs@gmail.com> | ||||
| Commit: William Hubbs <w.d.hubbs@gmail.com> | ||||
|  | ||||
|     rc_status: calculate time differences in time_t and display seconds in uptime | ||||
|  | ||||
| commit a7f3eb466c750eee160c49ab728ad1f8cd3380ee | ||||
| Author: William Hubbs <w.d.hubbs@gmail.com> | ||||
| Commit: William Hubbs <w.d.hubbs@gmail.com> | ||||
|  | ||||
|     version 0.26.2 | ||||
|  | ||||
| commit ae7490929d35322e1ce19daaa9f1edadbfe8dfd6 | ||||
| Author: William Hubbs <w.d.hubbs@gmail.com> | ||||
| Commit: William Hubbs <w.d.hubbs@gmail.com> | ||||
|  | ||||
|     update ChangeLog | ||||
|  | ||||
| commit ddbd1caa35986b9f1be0070dad1cedfc427a1bf1 | ||||
| Author: William Hubbs <w.d.hubbs@gmail.com> | ||||
| Commit: William Hubbs <w.d.hubbs@gmail.com> | ||||
|  | ||||
|     supervise-daemon: save start time and respawn count before dropping privs | ||||
|  | ||||
| commit a24965121834b64cc5e62c52c67b88886e5c5f5c | ||||
| Author: William Hubbs <w.d.hubbs@gmail.com> | ||||
| Commit: William Hubbs <w.d.hubbs@gmail.com> | ||||
|  | ||||
|     version 0.26.1 | ||||
|  | ||||
| commit e4bfb4530a86a4ccdff312c857df37fa0da36fd6 | ||||
| Author: William Hubbs <w.d.hubbs@gmail.com> | ||||
| Commit: William Hubbs <w.d.hubbs@gmail.com> | ||||
|  | ||||
|     update ChangeLog | ||||
|  | ||||
| commit 78e0042eccaf5a5554b195ad391b3ab0b8974cf6 | ||||
| Author: William Hubbs <w.d.hubbs@gmail.com> | ||||
| Commit: William Hubbs <w.d.hubbs@gmail.com> | ||||
| @@ -1450,32 +1486,3 @@ Commit: William Hubbs <w.d.hubbs@gmail.com> | ||||
|     guide.md: typo fix | ||||
|      | ||||
|     This fixes #86. | ||||
|  | ||||
| commit 3fa9015b8e5610d38366f781a08789e34159b0dc | ||||
| Author: Jason Zaman <jason@perfinion.com> | ||||
| Commit: William Hubbs <w.d.hubbs@gmail.com> | ||||
|  | ||||
|     rc-selinux: access check was backwards | ||||
|  | ||||
| commit 3b5a8b331e81ecd9a9362553c16f4527291d5528 | ||||
| Author: William Hubbs <w.d.hubbs@gmail.com> | ||||
| Commit: William Hubbs <w.d.hubbs@gmail.com> | ||||
|  | ||||
|     supervise-daemon: add pam service file | ||||
|  | ||||
| commit b3a04e797e5e459842c2c239886ab6ea08a8dc29 | ||||
| Author: Anthony G. Basile <blueness@gentoo.org> | ||||
| Commit: Anthony G. Basile <blueness@gentoo.org> | ||||
|  | ||||
|     runlevels/Makefile: add support for runlevel ‘nonetwork’ | ||||
|      | ||||
|     Traditional System V reserves runlevel 2 for multiuser with no | ||||
|     networking.  We add support for this which is already defined in | ||||
|     the inittab as | ||||
|      | ||||
|         l2:2:wait:/sbin/rc nonetwork | ||||
|      | ||||
|     X-Gentoo-Bug: 533828 | ||||
|     X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=533828 | ||||
|      | ||||
|     Signed-off-by: Anthony G. Basile <blueness@gentoo.org> | ||||
|   | ||||
| @@ -1,3 +1,3 @@ | ||||
| NAME=		openrc | ||||
| VERSION=	0.26 | ||||
| VERSION=	0.26.2 | ||||
| PKG=		${NAME}-${VERSION} | ||||
|   | ||||
| @@ -83,11 +83,11 @@ static void get_uptime(const char *service, char *uptime, int uptime_size) | ||||
| 	time_t now; | ||||
| 	char *start_time_string; | ||||
| 	time_t start_time; | ||||
| 	double time_diff; | ||||
| 	double diff_tmp; | ||||
| 	double diff_days; | ||||
| 	double diff_hours; | ||||
| 	double diff_mins; | ||||
| 	time_t time_diff; | ||||
| 	time_t diff_days = (time_t) 0; | ||||
| 	time_t diff_hours = (time_t) 0; | ||||
| 	time_t diff_mins = (time_t) 0; | ||||
| 	time_t diff_secs = (time_t) 0; | ||||
|  | ||||
| 	uptime[0] = '\0'; | ||||
| 	if (state & RC_SERVICE_STARTED) { | ||||
| @@ -96,26 +96,29 @@ static void get_uptime(const char *service, char *uptime, int uptime_size) | ||||
| 		if (start_count && start_time_string) { | ||||
| 			start_time = to_time_t(start_time_string); | ||||
| 			now = time(NULL); | ||||
| 			time_diff = difftime(now, start_time); | ||||
| 			diff_tmp = time_diff; | ||||
| 			if (diff_tmp > 86400.0) { | ||||
| 				diff_days = diff_tmp / 86400.0; | ||||
| 				diff_tmp -= diff_days * 86400.0; | ||||
| 			time_diff = (time_t) difftime(now, start_time); | ||||
| 			diff_secs = time_diff; | ||||
| 			if (diff_secs > (time_t) 86400) { | ||||
| 				diff_days = diff_secs / (time_t) 86400; | ||||
| 				diff_secs %= diff_days * (time_t) 86400; | ||||
| 			} | ||||
| 			if (diff_tmp > 3600.0) { | ||||
| 				diff_hours = diff_tmp / 3600.0; | ||||
| 				diff_tmp -= diff_hours * 3600.0; | ||||
| 			if (diff_secs > (time_t) 3600) { | ||||
| 				diff_hours = diff_secs / (time_t) 3600; | ||||
| 				diff_secs %= diff_hours * (time_t) 3600; | ||||
| 			} | ||||
| 			if (diff_tmp > 60.0) { | ||||
| 				diff_mins = diff_tmp / 60.0; | ||||
| 				diff_tmp -= diff_mins * 60.0; | ||||
| 			if (diff_secs > (time_t) 60) { | ||||
| 				diff_mins = diff_secs / (time_t) 60; | ||||
| 				diff_secs %= diff_mins * (time_t) 60; | ||||
| 			} | ||||
| 			if ((int) diff_days > 0) | ||||
| 				snprintf(uptime, uptime_size, "%.0f days %02.0f:%02.0f (%s)", | ||||
| 						diff_days, diff_hours, diff_mins, start_count); | ||||
| 			if (diff_days > 0) | ||||
| 				snprintf(uptime, uptime_size, | ||||
| 						"%ld day(s) %02ld:%02ld:%02ld (%s)", | ||||
| 						diff_days, diff_hours, diff_mins, diff_secs, | ||||
| 						start_count); | ||||
| 			else | ||||
| 				snprintf(uptime, uptime_size, "%02.0f:%02.0f (%s)", | ||||
| 						diff_hours, diff_mins, start_count); | ||||
| 				snprintf(uptime, uptime_size, | ||||
| 						"%02ld:%02ld:%02ld (%s)", | ||||
| 						diff_hours, diff_mins, diff_secs, start_count); | ||||
| 		} | ||||
| 	} | ||||
| } | ||||
|   | ||||
| @@ -196,6 +196,14 @@ static void child_process(char *exec, char **argv, char *svcname, | ||||
|  | ||||
| 	setsid(); | ||||
|  | ||||
| 	if (svcname) { | ||||
| start_time = time(NULL); | ||||
| from_time_t(start_time_string, start_time); | ||||
| 		rc_service_value_set(svcname, "start_time", start_time_string); | ||||
| sprintf(start_count_string, "%i", start_count); | ||||
| 		rc_service_value_set(svcname, "start_count", start_count_string); | ||||
| 	} | ||||
|  | ||||
| 	if (nicelevel) { | ||||
| 		if (setpriority(PRIO_PROCESS, getpid(), nicelevel) == -1) | ||||
| 			eerrorx("%s: setpriority %d: %s", applet, nicelevel, | ||||
| @@ -342,13 +350,6 @@ static void child_process(char *exec, char **argv, char *svcname, | ||||
| 		c++; | ||||
| 	} | ||||
| 	syslog(LOG_INFO, "Running command line: %s", cmdline); | ||||
| 	if (svcname) { | ||||
| start_time = time(NULL); | ||||
| from_time_t(start_time_string, start_time); | ||||
| 		rc_service_value_set(svcname, "start_time", start_time_string); | ||||
| sprintf(start_count_string, "%i", start_count); | ||||
| 		rc_service_value_set(svcname, "start_count", start_count_string); | ||||
| 	} | ||||
| 	execvp(exec, argv); | ||||
|  | ||||
| #ifdef HAVE_PAM | ||||
|   | ||||
		Reference in New Issue
	
	Block a user