'sudo' build step hangs the build

I have a 'custom script' build step, to which I've added, at the end, a sudo command line:

   sudo   %teamcity.agent.home.dir%/../nfs_unpack.sh    image.tar.bz2

- basically this is a script which unpacks a tarball with root ownership. 

In /etc/sudoers is

  teamcity ALL = NOPASSWD: /home/teamcity/nfs_unpack.sh

The script itself seems to work fine outside of TC; it does it get run by TC, and *does* do the untar correctly. And I even 'echo Done' at the end of the script and I see this in the log.

However the build itself is hanging.

And trying to then stop it results in "Cannot stop".

Is something needed for the scipt to be sudo'd or terminated correctly?

Thanks

 

0
2 comments

Hi Colin,

I've just tried this in 2017.1.3 and it seems to work just fine. Which version are you using? Could you take some thread dumps from the agent running the build (Check for the link in the agent page) and send them to us using the Submit a Request button above? If the build log has posted the echo-s from after the command, it should be good to go.

0
Avatar
Permanently deleted user

Hi Denis. It turns out the problem was actually a bug in one of the plugins (https://youtrack.jetbrains.com/issue/TW-51555), which I just happened to encounter at the same time as trying to add the sudo step.

 

0

Please sign in to leave a comment.