While setting up deployment through jenkins for my django project, I got stuck where I had to restart apache2 service to reflect the new changes to the client side. I am not sure how to provide user password after running systemctl reload apache2.service
command.
I tried below options but no luck.
1) systemctl reload apache2.service
Result:
Failed to reload apache2.service: Interactive authentication required.
See system logs and 'systemctl status apache2.service' for details.
Build step 'Execute shell' marked build as failure
2) sudo systemctl reload apache2.service
Result :
sudo: no tty present and no askpass program specified
Build step 'Execute shell' marked build as failure
3) Also not sure whether sshpass
will help in this case
Attached screenshot taken from jenkins job.