Question
Restart using states?

Answers

Now we can apply the workaround to restart the Minion in reliable way. The following example works on both UNIX-like and Windows operating systems:
Restart Salt Minion:
  cmd.run:{%- if grains['kernel'] == 'Windows' %}    - name: 'C:saltsalt-call.bat --local service.restart salt-minion'{%- else %}    - name: 'salt-call --local service.restart salt-minion'{%- endif %}    - bg: True    - onchanges:      - pkg: Upgrade Salt Minion
However, it requires more advanced tricks to upgrade from legacy version of Salt (before 2016.3.0), where executing commands in the background is not supported:
Restart Salt Minion:
  cmd.run:{%- if grains['kernel'] == 'Windows' %}    - name: 'start powershell "Restart-Service -Name salt-minion"'{%- else %}    # fork and disown the process    - name: |-        exec 0>&- # close stdin        exec 1>&- # close stdout        exec 2>&- # close stderr       nohup salt-call --local service.restart salt-minion &{%- endif %}   Your Comment




More States,Software Questions..
Why is pawan kalyan so popular in telugu states ?

What is the inputsplit in map reduce software?

What is software configuration management?

What Is Java Api For Xml-based Rpc (jax-rpc)?

How can you implement fine-grained auditing?

What is IBM’s simple explanation for Big Data’s four critical features?

What is static synchronized method in JDBC API? Give an example?

What does the NULLIF function do?

What happens if a start method is not invoked and the run method is directly invoked?

Should we override finalize method

what is the difference between mysql_fetch_array and mysql_fetch_object?

How will XML affect my document links?

Why to use Style Sheets?

What are Filters in MVC?

Can you explain Application layer in OSI model?

How to define new testplan attributes?

What are the minimum system requirements to run Photoshop? Is it possible to run Photoshop over linux?

Which oracle package is used to manage the oracle lock management services?

What is Latch Up? Explain Latch Up with cross section of a CMOS Inverter. How do you avoid Latch Up?

What is marker interface?



Search
Can you Answer!!
  • Q When an EventEmitter instance faces any error, it emits an 'error' event. When new listener is added, 'newListener' event is fired and when a listener is removed, 'removeListener' event is fired. EventEmitter provides multiple properties like on and emit. on property is used to bind a function with the event and emit is used to fire an event.
  • Q What is a semi conductor?
  • Q 78 percent of the atmosphere is?
  • Q What is different between web.config and machine.config and where it will be ?
  • Q What are the different kinds of reports in Salesforce?
  • Q Write the code for select second last div element?
  • Q Who was the Prime Minister of Britain during the first and second Round Table conferences?
  • Q On a scale of 1-10 how devilsh would you say you are?
  • Q What is inflation and deflation
  • Q What is the function of a boiler?
  • Q Who did Ekalavya consider as his Guru?