>First time it prompts me for a password - why? As far as I understand Fabric >should be able to handle this?
I’m not sure what you mean by ‘Fabric should be able to handle this’. Sudo is prompting you for a password because that’s how sudo works. If your credentials are not cached, you get a password prompt, then a timer starts. When that timer expires, you have to enter your password again for sudo. Sorry if you know all that – not trying to be patronizing. Fabric handles interactive prompts by by passing the prompt back to you. It doesn’t have an expect like behavior where it sees a password prompt and passes in the password ( from what I know and someone correct me if I’m wrong ). If you don’t want a password prompt, you’ll have to change your sudoers to NOPASSWD. -- sh From: [email protected] [mailto:[email protected]] On Behalf Of [email protected] Sent: Friday, December 02, 2011 12:13 AM To: Paul Hoffman Cc: [email protected] Subject: Re: [Fab-user] sudo fails every now and again Seems your right, quick test : fab -H dns1 dns_restart [dns1] Executing task 'dns_restart' [dns1] sudo: service bind9 restart [dns1] out: sudo password: * Stopping domain name service... bind9 [dns1] out: ...done. [dns1] out: * Starting domain name service... bind9 [dns1] out: ...done. Done. Disconnecting from dns1... done. wernerg@admin:/opt/git/bin$ fab -H dns1 dns_restart [dns1] Executing task 'dns_restart' [dns1] sudo: service bind9 restart [dns1] out: * Stopping domain name service... bind9 [dns1] out: ...done. [dns1] out: * Starting domain name service... bind9 [dns1] out: ...done. First time it prompts me for a password - why? As far as I understand Fabric should be able to handle this? Give the password and then the script runs without a hitch on re-runs afterwards. On Thu, Dec 1, 2011 at 6:59 PM, Paul Hoffman <[email protected]> wrote: I suspect that most of the time, sudo is being run when a password is needed (that is, there hasn't been a recent sudo from that user), but in the failure times, sudo is not prompting for a password because it isn't needed. Does Fabric itself assume that a password is needed every time? --Paul Hoffman
_______________________________________________ Fab-user mailing list [email protected] https://lists.nongnu.org/mailman/listinfo/fab-user
