Re: bash script fails conditional test

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



>
> You can probably replace that with a much cleaner pid=$(pidof cassandra).


Good to know! I hadn't heard of pidof before. However this is what I get
when I run it:

[root@web1:~] #pidof cassandra
[root@web1:~] #

Returns nothing. However:

[root@web1:~] #pidof java
27210 11418 10852

Gives me a few pids. Only one of which belongs to cassandra, as I have a
few java processes running.

I still find that my little script isolates exactly the pid of cassandra
that I would need to shutdown.

[root@web1:~] #check-cass.sh
Cassandra is running with pid: 27210

I really need to turn this into an init script. Which I probably will. But
this is just for a hobby project ,and I'm a little too lazy to do it this
weekend. Maybe next weekend.

Thanks,
Tim

On Sun, Apr 19, 2015 at 9:58 PM, Chris Adams <linux@xxxxxxxxxxx> wrote:

> Once upon a time, Tim Dunphy <bluethundr@xxxxxxxxx> said:
> > pid=$(ps -ef | grep cassandra | grep -v grep | grep -i -v -e grep -e
> screen
> > -e s3fs|awk '{print $2}')
>
> You can probably replace that with a much cleaner pid=$(pidof cassandra).
>
> --
> Chris Adams <linux@xxxxxxxxxxx>
> _______________________________________________
> CentOS mailing list
> CentOS@xxxxxxxxxx
> http://lists.centos.org/mailman/listinfo/centos
>



-- 
GPG me!!

gpg --keyserver pool.sks-keyservers.net --recv-keys F186197B
_______________________________________________
CentOS mailing list
CentOS@xxxxxxxxxx
http://lists.centos.org/mailman/listinfo/centos




[Index of Archives]     [CentOS]     [CentOS Announce]     [CentOS Development]     [CentOS ARM Devel]     [CentOS Docs]     [CentOS Virtualization]     [Carrier Grade Linux]     [Linux Media]     [Asterisk]     [DCCP]     [Netdev]     [Xorg]     [Linux USB]
  Powered by Linux