How to stop filebeat running under non-root account - other than kill


(zoplex) #1

Is there a way to send shutdown/reboot signal to filebeat running under non-root account? From root account service filebeat restart/stop/start works great - but from non-root account?

Thanks,
Zoran


(Magnus Bäck) #2

I suggest you use sudo to grant the user in question specific permissions to run the needed commands.


(zoplex) #3

Yes we did that in few cases but it becomes impractical on large scale; would be good to have different option in this case - maybe password protected signal on specific port.

Thank you.


(Magnus Bäck) #4

Yes we did that in few cases but it becomes impractical on large scale

How so?


(Steffen Siering) #5

it's on purpose the OS does not allow user X killing processes run by user Y.

You need to run filebeat as root? If so, any other user should not be allowed to kill the process. This is not filebeat specific, but provided by OS.


(zoplex) #6

it is the other way around - due to the need to deploy this to large number
of VMs where we do not have root access, it would be deployed under
separate account - say filebeat, in filebeat group. In that case I assume
it could not be run as service ( there are workarounds but they seem to at
least require sudo setup of some kind - which again is impractical for
large number of different purpose VMs) - so in that case filebeat could be
started with nohup into the background, but in that case there is no way to
stop it - other than kill. Not sure if that could cause any issues with
filebeat after it is restarted.


(Magnus Bäck) #7

but in that case there is no way to stop it - other than kill. Not sure if that could cause any issues with filebeat after it is restarted.

Just kill it with a normal SIGTERM. That's the normal way of stopping processes and it's what happens when processes run as daemons/services are stopped. Killing it with SIGKILL should be avoided, just like with any other program.


(zoplex) #8

Thank you - so basically using regular 'kill' command as opposed to kill -9 ...

Thanks,


(system) #9

This topic was automatically closed after 21 days. New replies are no longer allowed.