Skip to content

Grant sudo permissions for nrpe to run the check as root

When I run service httpd status like root user I get httpd (pid 2932) is running… which is like expected. Now, when I su nrpe and run the same cmd service httpd status I get httpd dead but subsys locked. I’m kind of new to the Linux world but to me this smells like nrpe doesn’t have the perm…

-bash: laravel: command not found

I have installed the composer and move the composer.phar file to /usr/local/bin just follow the following step: Then I edit my ~/.bash_profile file as following: and save the change and excute: But, when I excute the laravel new test command, it returns an error: PS: in /usr/local/bin directory have no larave…

Child process starts after parent process

I have a simple code to test the fork() function. It didn’t work as I expected. My expectation is: parent’s result and child’s result appear alternately. Can someone explain this and teach me how to fix it? Thanks! Answer The explanation is simple. Scheduling of processes is up to the kernel…

How fork() function works in this program?

I’m having some trouble with this program. I know what a fork() function does. It is used to create a new process from an existing process. The new process is called the child process, and the existing process is called the parent. The parent returnes the child’s pid and the child returns 0. That …

Unix – Uncomment xml comments

I have below node from XML file. How do I uncomment the first occurrance of mainHost using Unix shell script or commands? I have tried with below command with different variations but that does not seem to work. sed ‘0,/<!– /{s/<!– //}’ /test.xml I am expecting below output Thank…