#!/bin/sh pid=$(pidof postgres) echo $pid sudo kill $pid pg_ctlcluster 8.4 main start
This script is just for killing processid using postgres database. This is not working inside jenkins.. Error showing is sudo: no tty present and no askpass program specified sudo: no tty present and no askpass program specified Sorry, try again. sudo: no tty present and no askpass program specified sudo: no tty present and no askpass program specified Sorry, try again. sudo: no tty present and no askpass program specified sudo: no tty present and no askpass program specified Sorry, try again. sudo: 3 incorrect password attempts Following is my etc/sudoers file user is sigma. # User privilege specification root ALL=(ALL:ALL) ALL # Members of the admin group may gain root privileges %admin ALL=(ALL) ALL # Allow members of group sudo to execute any command %sudo ALL=(ALL:ALL) ALL # See sudoers(5) for more information on "#include" directives: #includedir /etc/sudoers.d sigma ALL=(root) NOPASSWD: /bin/kill %admin ALL=(ALL) NOPASSWD:/usr/share/tomcat6/.jenkins/Eulen/killpostgres.sh Please help me..