Это старая версия документа.
Содержание
Командная строка
Действие | Команда upstart | Команда systemd | Замечания |
---|---|---|---|
Start service | start $job | systemctl start $unit | |
Stop service | stop $job | systemctl stop $unit | |
Restart service | restart $job | systemctl restart $unit | |
See status of services | initctl list | systemctl status | |
Check configuration is valid | init-checkconf /tmp/foo.conf | systemd-analyze verify <unit_file> | |
Show job environment | initctl list-env | systemctl show-environment | |
Set job environment variable | initctl set-env foo=bar | systemctl set-environment foo=bar | |
Remove job environment variable | initctl unset-env foo | systemctl unset-environment foo | |
View job log | cat /var/log/upstart/$job.log | sudo journalctl -u $unit | |
tail -f job log | tail -f /var/log/upstart/$job.log | sudo journalctl -u $unit -f | |
Show relationship between services | initctl2dot | systemctl list-dependencies –all | Shows pstree-style output. |