I'am using gitlab-runner binary and I cannot launch commands needed privilege. I'am logged with my user sysadmin I have put the binary in /usr/local/bin and i did'nt need to add the path in my PATH variable. Here my bash_profile
# User specific environment and startup programs
PATH=$PATH:$HOME/bin
export PATH
echo $PATH
/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/home/sysadmin/bin
Command without sudo work's perfectly
gitlab-runner -help
NAME:
gitlab-runner - a GitLab Runner
USAGE:
gitlab-runner [global options] command [command options] [arguments...]
But all command with sudo return
sudo gitlab-runner status
return
command not found
NOW FOR ROOT
This is my bash_profile for root.
# User specific environment and startup programs
GITLAB_RUNNER=/usr/local/bin
PATH=$PATH:$HOME/bin:$GITLAB_RUNNER
export PATH
export GITLAB_RUNNER
echo $PATH
/sbin:/bin:/usr/sbin:/usr/bin:/root/bin:/usr/local/bin
gitlab-runner status
gitlab-runner: Service is running!
The only way to use any command it's to use the path where the binary is located.
[sysadmin@XXXXXXXX ~]$ sudo /usr/local/bin/gitlab-runner status
Runtime platform arch=amd64 os=linux pid=12666 revision=8bb608ff version=11.7.0
gitlab-runner: Service is running!
Please can you explain me what's going wrong. Thanks.