Project

General

Profile

« Previous | Next » 

Revision 14857

bugfix: lib/sh/sync.sh, db.sh: *_snapshot() commands that run multiple sudo commands: use become_sudo so that the program won't hang at later sudo prompts. for pg_snapshot() with pg_start_backup(), this also prevents the backup from staying open at the end waiting on a sudo prompt, causing excess WAL logs to accrue.

View differences:

trunk/lib/sh/sync.sh
66 66
# ctl(cmd:{start|stop}): daemon controller that takes command param
67 67
{
68 68
	echo_func; kw_params ctl from to; : "${ctl:?}"
69
	become_sudo # don't let program hang at later sudo prompts
69 70
	
70 71
	# trim bloated temp files (eg. from rolled back changes)
71 72
	sudo "$ctl" restart
trunk/lib/sh/db.sh
458 458
pg_snapshot() # usage: [live=] [from=...] [to=...] pg_snapshot rsync_opts...
459 459
{
460 460
	echo_func; kw_params from to; local from="${from:-/var/lib/postgresql}"
461
	become_sudo # don't let program hang at later sudo prompts. with
462
		# pg_start_backup(), this also prevents the backup from staying open at
463
		# the end waiting on a sudo prompt, causing excess WAL logs to accrue.
461 464
	
462 465
	pg_stop_backup
463 466
	if pg_start_backup; then # perform online backup

Also available in: Unified diff