systemctl
प्रोसेस और सिस्टम
इस्तेमाल
systemctl <verb> <unit>systemd सेवाओं को शुरू, बंद और जाँचता है; `enable` केवल बूट व्यवहार तय करता है, इसलिए अभी भी चालू करने के लिए `enable --now` लें, और unit फ़ाइल बदलने के बाद `daemon-reload` चलाएँ।
आम विकल्प
| विकल्प | अर्थ |
|---|---|
| status <unit> | Whether it is running, its PID, and the last log lines. |
| start / stop / restart | Act on the service now, without changing boot behaviour. |
| reload | Re-read the config without dropping connections, if the service supports it. |
| enable --now <unit> | Start it now and also start it at every boot. |
| daemon-reload | Required after you edit a .service file, before restarting it. |
| list-units --failed | Everything that failed to start. |
| --user | Act on your own user units instead of the system ones. |
उदाहरण
sudo systemctl restart nginxRestart the web server.
systemctl status sshd --no-pagerPrint the state and recent log lines without opening a pager.
sudo systemctl enable --now dockerStart Docker and make it come back after a reboot.
क्या चल रहा है और क्या मशीन खा रहा है। मारने से पहले पहचानना क्रम है।
कैसे पढ़ें
- बड़े कोष्ठक [ ] उस हिस्से को दिखाते हैं जिसे छोड़ा जा सकता है।
- तीन बिंदु … का मतलब है एक से ज़्यादा दिए जा सकते हैं।
- विकल्पों में बड़े-छोटे अक्षर मायने रखते हैं — कुछ कमांड में -r और -R अलग काम करते हैं।
आम सवाल
Q. systemctl क्या करता है?
systemd सेवाओं को शुरू, बंद और जाँचता है; `enable` केवल बूट व्यवहार तय करता है, इसलिए अभी भी चालू करने के लिए `enable --now` लें, और unit फ़ाइल बदलने के बाद `daemon-reload` चलाएँ।
Q. इसे कैसे लिखें?
systemctl <verb> <unit> — बड़े कोष्ठक वह हिस्सा दिखाते हैं जो छोड़ा जा सकता है।
Q. कितने विकल्प जानने लायक़ हैं?
यहाँ 7 दिए हैं; पूरी सूची man systemctl में है। यह कमांड प्रोसेस और सिस्टम में आती है।
मिलती-जुलती कमांड
man पेज: man systemctl