When I create new process using exec
I can give it some custom name using -a
option, i.e. exec -a MyName MyCommand
Doing so facilities handling bunch of same processes started with different parameters. For instance if I have following:
exec -a MyName1 MyCommand param1
exec -a MyName2 MyCommand param2
and for some reason I want to kill a latter it's as simple as:
pkill -f MyName2
.
Problem is I don't know how to achieve same effect with processes started using nohup
. I've read about -p
option, but it's not always supported.
disjoin
doesn't seem to work either.
Has anybody faced similar problem?
You can do like this:
nohup bash -c 'exec -a xxx sleep 12345'
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With