[[linux_og_unix:sysadm|Tilbage til Sysadm]] ---- ==== Systemd vs. SysV init ==== * [[http://www.linux.com/learn/tutorials/788613-understanding-and-using-systemd/|Understanding and using Systemd]] * [[http://0pointer.de/blog/projects/systemd.html|Rethinking PID 1]] * [[http://www.bt0.ninja/ten-things-i-love-about-systemd/|10 things I love about systemd]] * [[https://niels.kobschaetzki.net/post/2015-11-11-creating-systemd-timers-instead-of-a-personal-crontab/|systemd.timers instead of a personal crontab]] ===== Service Related Commands ===== ^ Comments ^ SysV ^ Systemd ^ | Start en service | service start | systemctl start .service | | Stop en service | service stop | systemctl stop .service | | Restarte en service | service restart | systemctl restart .service | | Reload en service | service reload | systemctl reload .service | | Service status | service status | systemctl status .service | | Enable service at startup | chkconfig on | systemctl enable .service | | Disable service at startup | chkconfig off | systemctl disable .service | | Check om en service er enable at startup | chkconfig | systemctl is-enabled .service | ===== Runlevels ===== ^ Comments ^ SysV ^ Systemd ^ | System halt | 0 | runlevel0.target, poweroff.target | | Single user mode | 1,s,single | runlevel1.target, rescue.target | | Multi user | 2 | runlevel2.target, multi-user.target | | Multi user med netværk | 3 | runlevel3.target, multi-user.target | | Eksperimental | 4 | runlevel4.target, multi-user.target | | Multi user med netværk og grafisk mode | 5 | runlevel5.target, graphical.target | | Reboot | 6 | runlevel6.target, reboot.target | | Emergency shell | emergency | emergency.target | | Skift til multi user runlevel %%/%% target | init 3 | systemctl isolate multi-user.target | | Check current runlevel | runlevel | systemctl get-default | | Change default runlevel | Ret i %%/etc/inittab%% | systemctl set-default multi-user.target | ===== Diverse ===== ^ Comments ^ SysV ^ Systemd ^ | System halt | halt | systemctl halt | | Power off | poweroff | systemctl poweroff | | Restart | reboot | systemctl reboot | | Suspend | pm-suspend | systemctl suspend | | Hilbernate | pm-hilbernate | systemctl hibernate | | Follow system log file | tail -f /var/log/messages, tail -f /var/log/syslog | journalctl -f | ===== Systemd kommandoer ===== ^ Comments ^ Systemd ^ | Kill processes related to a service | systemd kill | | Get logs or events for today | journalctl --since=today | | Check boot time | systemd-analyze