~soren/ec2-init/0.5

Viewing all changes in revision 65.

  • Committer: Soren Hansen
  • Author(s): Scott Moser
  • Date: 2009-09-25 15:11:24 UTC
  • Revision ID: soren@canonical.com-20090925151124-ej6j3wqi3uu33fnv
replace multiple '| logger' in regenerate_ssh_host_keys with a single one

This is a speed improvement as previous would make a fork/subshell for
each pipe. This will only make a single fork.  I've also verified that
each line in logger output will still get the 'ec2' prefix

$ printf "%s\n%s\n" "hi world" "by world" | logger -s -t ec2 2>/dev/null
$ tail -n 2 /var/log/messages 
Sep 24 19:06:10 ip-10-242-225-190 ec2: hi world
Sep 24 19:06:10 ip-10-242-225-190 ec2: by world

The other thing to note is that I redirected stderr of the
regenerate_ssh_host_keys call to logger, so it will go to the logs also.

expand all expand all

Show diffs side-by-side

added added

removed removed

Lines of Context: