A site for solving at least some of your technical problems...
A site for solving at least some of your technical problems...
systemd has come as the default boot loader since Ubuntu 15.04. The old version, upstart, is now considered deprecated. Systemd has an interface pretty similar to the upstart service command line.
Command | Description | Support | Persist |
---|---|---|---|
systemctl start SERVICE |
Start SERVICE | Always | No |
systemctl stop SERVICE |
Stop SERVICE | Always | No |
systemctl restart SERVICE |
Restart SERVICE | Always | No |
systemctl reload SERVICE |
Reload SERVICE | Optional | Yes |
systemctl status SERVICE |
Show SERVICE status | Always | n.a. |
systemctl enable SERVICE |
Enable SERVICE | Always | Yes |
systemctl disable SERVICE |
Disable SERVICE | Always | Yes |
systemctl is-enabled SERVICE |
Check whether SERVICE is enabled | Always | n.a. |
systemctl is-active SERVICE |
Check whether SERVICE is currently active | Always | n.a. |
systemctl show SERVICE |
Show all of SERVICE's information | Always | n.a. |
Also, when a daemon has problems starting, it may print information about it in the console. However, systemd hides all console output from you.
All the options have an equivalent for the user that make use of the --user command line option. By default, user services get started at the time the user logs in. You can specify required targets to have services only start after certain other events such as the X11 display availability.
IMPORTANT: The fact is logging in, even with ssh, has the effect of starting that user's service, if the service is enabled at that point. Just disabling the service will not stop the currently running instance if it fails over and over again. That special case requires you to (1) disable and (2) log out from all the sessions you currently have opened and that time it will stop the infinite loop trying to restart your system. Now you can re-log back in your system and the service will be stopped and it won't be restarted.
To see the latest output of a process, you'll have to use the journalctl command. In most cases, something like this will work as expected:
journalctl -a -u SERVICE
Note: the -u option means Unit (not user).
It automatically uses less to display the data.
Recent Posts on The Linux Page: