Skip to content

Instantly share code, notes, and snippets.

@mwhooker
Created January 28, 2014 23:46
Show Gist options
  • Save mwhooker/8678985 to your computer and use it in GitHub Desktop.
Save mwhooker/8678985 to your computer and use it in GitHub Desktop.

okay, running in a double chpst env does mess up the temp directory

root@skyliner-db:/tmp/fakewal-e# ./run 
Python 2.7.3 (default, Apr 10 2013, 06:20:15) 
[GCC 4.6.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import os
>>> os.environ
{'TMP': '/mnt/wal-e/tmp', ...}
>>> import tempfile
>>> x = tempfile.NamedTemporaryFile()
>>> x
<open file '<fdopen>', mode 'w+b' at 0x7f4fc9618030>
>>> x.name
'/tmp/tmp3Rm6w5'

run

exec 2>&1
exec /usr/bin/chpst -u postgres /tmp/fakewal-e/wal-e

wal-e

chpst -e /etc/service/wal-e/env /opt/wal-e/current/bin/python $*
root@skyliner-db:/tmp/fakewal-e# chpst -e /etc/service/wal-e/env/ /opt/wal-e/current/bin/python
Python 2.7.3 (default, Apr 10 2013, 06:20:15) 
[GCC 4.6.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import os
>>> import tempfile
>>> os.environ
{'TMP': '/mnt/wal-e/tmp', ...}
>>> x = tempfile.NamedTemporaryFile()
>>> x.name
'/mnt/wal-e/tmp/tmpnAeGFR'
@mwhooker
Copy link
Author

btw it's a permissions issue. the tmp dir needs to be x7xx and it was x6xx

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment