This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision Next revision Both sides next revision | ||
linux:installation [2017/02/13 09:35] mstraub [Init Daemons] |
linux:installation [2017/02/13 10:29] mstraub [Init Daemons] |
||
---|---|---|---|
Line 501: | Line 501: | ||
Modern event-based replacement for ''init'', used by most distributions in 2015. | Modern event-based replacement for ''init'', used by most distributions in 2015. | ||
- | Init scripts are represented as "service units" in the form of ''.service'' files, which can be found in ''/lib/systemd/system'' (preinstalled) and ''/etc/systemd/system'' (to be edited by the admin). | + | Init scripts are represented as [[https://www.freedesktop.org/software/systemd/man/systemd.service.html|service units]] in the form of ''.service'' files, which can be found in ''/lib/systemd/system'' (preinstalled) and ''/etc/systemd/system'' (to be edited by the admin). |
+ | Example of a ''.service'' file with the the three sections: | ||
+ | <code> | ||
+ | [Unit] | ||
+ | Description=Foo | ||
+ | [Service] | ||
+ | ExecStart=/usr/sbin/foo-daemon | ||
+ | |||
+ | [Install] | ||
+ | WantedBy=multi-user.target | ||
+ | </code> | ||
+ | |||
+ | Starting and stopping services works as follows: | ||
+ | <code bash> | ||
+ | systemctl start myservice | ||
+ | systemctl stop myservice | ||
+ | systemctl status myservice | ||
+ | </code> | ||
+ | |||
+ | Logs of a service can be accessed via ''journalctl'': | ||
+ | <code bash> | ||
+ | journalctl -u myservice | ||
+ | </code> | ||
====== Package Management ====== | ====== Package Management ====== | ||