Changes
Jump to navigation
Jump to search
← Older edit
Newer edit →
Linux: SystemD
(edit)
Revision as of 15:50, 9 October 2018
159 bytes added
,
15:50, 9 October 2018
no edit summary
Line 1:
Line 1:
−
#
List all running services
+
==
List all running services
==
sytemctl
sytemctl
−
#
Start/stop or enable/disable services
+
==
Start/stop or enable/disable services
==
systemctl start foo.service
systemctl start foo.service
systemctl stop foo.service
systemctl stop foo.service
Line 8:
Line 8:
systemctl enable foo.service
systemctl enable foo.service
systemctl disable foo.service
systemctl disable foo.service
−
#
Check if service is enabled
+
==
Check if service is enabled
==
systemctl is-enabled foo.service; echo $?
systemctl is-enabled foo.service; echo $?
Line 44:
Line 44:
WantedBy=multi-user.target
WantedBy=multi-user.target
</nowiki>
</nowiki>
+
+
+
== Automatic restart ==
+
Add the following lines to your service file at Service block
+
Restart=always
+
RestartSec=3
+
+
watch "ps -ef|grep service"
Rafahsolis
Bureaucrats
,
Administrators
2,306
edits
Navigation menu
Personal tools
Not logged in
Talk
Contributions
Create account
Log in
Namespaces
Page
Discussion
Variants
Views
Read
Edit
View history
More
Search
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Tools
Special pages
Printable version