How to ensure a server isn’t started multiple times but other servers are started irrespective of whether the stop/start of the previous servers failed or succeeded?
Stop server1, only if server1 is stopped, start server1.
Irrespective of server1 failed to start or stop, stop server2 and start server2.
Irrespective of whether server1,server2 failed to start or stop, stop server3 and start server3.
How do I implement this logic in unix job?
What I did was this but I pretty quickly found out that I was wrong.
stop server1 && start server1 && stop server2 && start server2 && stop server3 && start server3
I am wondering whether this would work?
stop server1 && start server1 || stop server2 && start server2 || stop server3 && start server3
But this won’t work, because I know if first stop,start succeeds, then the rest won’t run
because 1 OR (?) =1
The most important thing is that a server should not started multiple times. i.e double start.