dtolabs/rerun — Issue #11: stubbs archive does not work with sudo
Author: connaryscott
Created: 2012-01-10 01:49:46+00:00
State: open

Here we have an issue when I attempt to execute rerun archive with respect to sudo

/tmp/rerun.bin was generated by rerun stubbs archive

/tmp/rerun was generated by makeself archive utility (per my earlier post before I discovered stubbs archive command)

both reside on the same target node:

-shell-3.2$ ssh -tt imageuser@pbdevrk1v ls -l /tmp/rerun
-rwxr-xr-x 1 imageuser webadmin 123530 Jan 9 16:57 /tmp/rerun
Connection to pbdevrk1v closed.
-shell-3.2$ ssh -tt imageuser@pbdevrk1v ls -l /tmp/rerun.bin
-rwxr-xr-x 1 imageuser webadmin 19896 Jan 9 17:10 /tmp/rerun.bin
Connection to pbdevrk1v closed.

As you can see I am able to execute the full command line with respect to the makeself generated archive over sudo

-shell-3.2$ ssh -tt imageuser@pbdevrk1v sudo -u tomcat /tmp/rerun stubbs: add-module -m foo --description bar
Verifying archive integrity... All good.
Uncompressing rerun self extracting executable..............................................................................
Created module structure: /tmp/selfgz268215127/modules/foo
Connection to pbdevrk1v closed.

Trying the same with stubbs archive, we have trouble.....

-shell-3.2$ ssh -tt imageuser@pbdevrk1v sudo -u tomcat /tmp/rerun.bin stubbs: add-module -m foo --description bar
tar: Cannot save working directory
tar: Error is not recoverable: exiting now
ERROR: unarchiving failed. (tar=/bin/tar. size=42)
Connection to pbdevrk1v closed.

Same problem if we execute this locally:

[imageuser@pbdevrk1v ~]$ sudo -u tomcat /tmp/rerun.bin stubbs: add-module -m foo --description bar
tar: Cannot save working directory
tar: Error is not recoverable: exiting now
ERROR: unarchiving failed. (tar=/bin/tar. size=42)

perhaps there is a perm issue here that relates to the pre sudo user and the effective user