Port gardener startup script changes from master.