make the location of the swclock reference file configurable
This fixes #565.
This commit is contained in:
		| @@ -7,6 +7,7 @@ conf_common = [ | ||||
|   'localmount', | ||||
|   'netmount', | ||||
|   'swap', | ||||
|   'swclock', | ||||
|   ] | ||||
|  | ||||
| conf_net = [ | ||||
|   | ||||
							
								
								
									
										6
									
								
								conf.d/swclock
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										6
									
								
								conf.d/swclock
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,6 @@ | ||||
| # This is the location of the reference file swclock uses to set the | ||||
| # system date and time. | ||||
| # This is the default path. If you are using it, you do not need to | ||||
| # uncomment it. If you are using the default and have /var on its own | ||||
| # file system, you need to add the appropriate rc_after setting. | ||||
| # swclock_file=/var/lib/misc/openrc-shutdowntime | ||||
| @@ -10,6 +10,7 @@ | ||||
| # except according to the terms contained in the LICENSE file. | ||||
|  | ||||
| description="Sets the local clock to the mtime of a given file." | ||||
| swclock_file="${swclock_file:-/var/lib/misc/openrc-shutdowntime}" | ||||
|  | ||||
| depend() | ||||
| { | ||||
| @@ -22,7 +23,7 @@ depend() | ||||
| start() | ||||
| { | ||||
| 	ebegin "Setting the local clock based on last shutdown time" | ||||
| 	if ! swclock 2> /dev/null; then | ||||
| 	if ! swclock "${swclock_file}" 2> /dev/null; then | ||||
| 	swclock --warn @SBINDIR@/openrc-run | ||||
| 	fi | ||||
| 	eend $? | ||||
| @@ -31,6 +32,6 @@ start() | ||||
| stop() | ||||
| { | ||||
| 	ebegin "Saving the shutdown time" | ||||
| 	swclock --save | ||||
| 	swclock --save "${swclock_file}" | ||||
| 	eend $? | ||||
| } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user