Skip to content

Latest commit

 

History

History
executable file
·
152 lines (96 loc) · 3.82 KB

10-Systemd.md

File metadata and controls

executable file
·
152 lines (96 loc) · 3.82 KB

[ Home | Xfce | Systemd | Network | FFmpeg | Bugs | Other ]

Systemd


References

https://www.freedesktop.org/software/systemd/man/systemctl.html
https://access.redhat.com/attachments/12052018_systemd_6.pdf
https://access.redhat.com/documentation/

  • Manage services and units

    https://www.digitalocean.com/community/tutorials/

    sudo systemctl status application.service

    sudo systemctl start application.service
    sudo systemctl stop application.service
    
    sudo systemctl enable application.service
    sudo systemctl disable application.service
    
    sudo systemctl restart application.service
    sudo systemctl reload application.service
    

    sudo systemctl daemon-reload

  • Modify unit file

    https://serverfault.com/questions/840996/

    systemctl edit <service-name>

  • List services

    https://askubuntu.com/questions/795226/

    systemctl list-unit-files --type=service
    systemctl list-unit-files | grep "enabled "
    systemctl list-units --no-pager
    systemctl | grep running
    
  • List timers

    systemctl list-timers --all
    

Log files

https://www.golinuxcloud.com/view-logs-using-journalctl-filt

Turn off excessive logging

  • sudo

    https://unix.stackexchange.com/questions/224370/
    https://unix.stackexchange.com/questions/637227/

    In /etc/pam.d/sudo add the following with a real user name :

    session [success=1 default=ignore] pam_succeed_if.so quiet uid = 0 ruser = <username>

    Example of /etc/pam.d/sudo file :

    #%PAM-1.0
    
    # Set up user limits from /etc/security/limits.conf.
    session    required   pam_limits.so
    session [success=1 default=ignore] pam_succeed_if.so quiet uid = 0 ruser = hotnuma
    
    @include common-auth
    @include common-account
    @include common-session-noninteractive
    
  • rtkit-daemon

    https://unix.stackexchange.com/questions/684379/

    sudo mkdir /etc/systemd/system/rtkit-daemon.service.d/
    sudo geany /etc/systemd/system/rtkit-daemon.service.d/log.conf
    

    Add the following :

    [Service]
    LogLevelMax=4
    

    Reload the service

    sudo systemctl daemon-reload
    sudo systemctl restart rtkit-daemon.service
    

Other

  • Analyze startup

    systemd-analyze time
    systemd-analyze --no-pager blame
    systemd-analyze critical-chain