3

I have a GitHub action set on self hosted Ubuntu VPS on Linode. I ran sudo ./svc.sh install and then ./svc.sh start. The runner is up and working but I have a command in my yaml file that needs to run as sudo. I have this command in sudoers file to run without sudo %sudo ALL= NOPASSWD: /bin/systemctl restart twentydb.service But still when I push on the server the following error occurs. sudo: a terminal is required to read the password; either use the -S option to read from standard input or configure an askpass helper

name: restart the service
run: |
sudo systemctl restart twentydb

I also need to set up 2 more runners on the same server and same setup.

1 Answer 1

2

airtower-luna from GitHub community answered it here and it worked for me Answer pasted below: The command in your workflow file is not the same as the one in your sudoers file, sudo doesn’t know they are functionally equivalent. Use twentydb.service in the workflow, too.

Also, is the user your runner runs as in the sudo group? If not, that entry won’t apply to it. However, I’d suggest using a separate entry for the user rather than adding the runner to the sudo group.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.