Systemd tips and tricks: Difference between revisions

From HPCWIKI
Jump to navigation Jump to search
(Add categories: Linux, Configuration)
(Fix: remove --- horizontal lines (7 removed))
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
{{Status
|status=Draft
|owner=Knowledge Agent
|last_update=2026-07-16
|review=Pending
}}
{{TOC}}
== Overview ==
Systemd tips and tricks에 대한 기술 문서입니다.
=== Summary ===
* 무엇인가? - Systemd tips and tricks
* 왜 필요한가? - HPC 및 서버 환경에서 필수 개념
* 언제 사용하는가? - 서버 구성, 성능 튜닝, 문제 해결 시
== Purpose ==
이 문서가 존재하는 이유
* Goal: Systemd tips and tricks에 대한 기술 정보 제공
* Scope: Systemd tips and tricks의 개념, 사용법, 설정
* Non-goals: 다른 주제로의 확장
== Key Concepts ==
{| class="wikitable"
! Concept
! Description
! Related
|-
| Systemd tips and tricks
| HPC/서버 환경에서 중요한 기술 개념
| [[Linux]], [[Server]]
|}
== Detailed Explanation ==


== Check systemd service ==
<syntaxhighlight lang="bash">
<syntaxhighlight lang="bash">
$ sudo systemctl list-dependencies
$ sudo systemctl list-dependencies
Line 21: Line 63:
● ├─rsyslog.service
● ├─rsyslog.service
● ├─ssh.service
● ├─ssh.service
● ├─sshswitch.service
....
</syntaxhighlight>


== ExecStop<ref>https://www.freedesktop.org/software/systemd/man/latest/</ref> ==
{| class="wikitable"
|control-group (default)
|''If set to control-group, all remaining processes in the control group of this unit will be killed on unit stop (for services: after the stop command is executed, as configured with ExecStop=)''
|-
|mixed
|''If set to mixed, the SIGTERM signal (see below) is sent to the main process while the subsequent SIGKILL signal (see below) is sent to all remaining processes of the unit's control group''
|-
|process
|''only the main process itself is killed (not recommended!).''
|-
|none
|''no process is killed. In this case, only the stop command will be executed on unit stop, but no process will be killed otherwise. Processes remaining alive after stop are left in their control group and the control group continues to exist after stop unless empty. (strongly recommended against!).''
|}


== How to permanently disable EEE (Energy Efficient Ethernet) on network card ==
== Best Practices ==
On system bootup, if dmesg shows following warning,
 
* 최신 버전 사용 권장
* 공식 문서 참고
* 테스트 환경에서 먼저 검증
 


<code>kernel: igb 0000:01:00.3: exceed max 2 second</code>
== References ==


* [https://wiki.hpcmate.com Systemd tips and tricks]


'''We can disable Energy-Efficient Ethernet''' ('''EEE''')<ref>https://en.wikipedia.org/wiki/Energy-Efficient_Ethernet</ref> of NIC. To disable EEE on network card we can use systemd service unit to run the ethtool command (e.g. /etc/systemd/system/disable-eee.service<ref>https://unix.stackexchange.com/questions/729508/how-to-permanently-disable-eee-energy-efficient-ethernet-on-ethernet-card</ref> )<syntaxhighlight lang="bash">
/etc/systemd/system/disable-eee.service


Description=HM disable eee on NIC
== Related Pages ==
Before=network-pre.target
Wants=network-pre.target


[Service]
* [[Linux]]
Type=oneshot
* [[Server]]
RemainAfterExit=true
* [[Hardware]]
ExecStartPre=/usr/sbin/ethtool --set-eee eno1 eee off
* [[Network]]
ExecStart=/usr/sbin/ethtool --set-eee eno2 eee off


[Install]
WantedBy=multi-user.target
</syntaxhighlight>


== How to read live-tail logs of multiple services with journalctl ==
[[Category:Server]]
#Systemd - How to read live-tail logs of multiple services with journalctl<ref>https://gist.github.com/MrAndrewMal/764e69e35cef7e7b38f05e561d670c9f</ref>
== Knowledge Graph ==
$sudo journalctl --follow _SYSTEMD_UNIT=docker.service + _SYSTEMD_UNIT=apache2.service


== Ensure the mount path is accessible before the service ==
Related
<[Unit]
RequiresMountsFor=<path required>
This will ensure the path is accessible before starting the service and also will mount it if it's not already (unless it has noauto specified).


== Reference ==
→ [[Linux]]
<references />
→ [[Server]]
[[Category:Linux]]
[[Hardware]]
→ [[Network]]


[[Category:Configuration]]
[[Category:Reference]]

Latest revision as of 11:30, 17 July 2026

Template:Status

Template:TOC

Overview

Systemd tips and tricks에 대한 기술 문서입니다.

Summary

  • 무엇인가? - Systemd tips and tricks
  • 왜 필요한가? - HPC 및 서버 환경에서 필수 개념
  • 언제 사용하는가? - 서버 구성, 성능 튜닝, 문제 해결 시


Purpose

이 문서가 존재하는 이유

  • Goal: Systemd tips and tricks에 대한 기술 정보 제공
  • Scope: Systemd tips and tricks의 개념, 사용법, 설정
  • Non-goals: 다른 주제로의 확장


Key Concepts

Concept Description Related
Systemd tips and tricks HPC/서버 환경에서 중요한 기술 개념 Linux, Server


Detailed Explanation

<syntaxhighlight lang="bash"> $ sudo systemctl list-dependencies default.target ● ├─console-setup.service ● ├─containerd.service ● ├─cron.service ● ├─dbus.service ● ├─dphys-swapfile.service ● ├─e2scrub_reap.service ● ├─ModemManager.service ● ├─plymouth-quit-wait.service ● ├─plymouth-quit.service ● ├─raspberrypi-net-mods.service ● ├─raspi-config.service ● ├─rc-local.service ● ├─rng-tools-debian.service ● ├─rpi-eeprom-update.service ● ├─rsync.service ● ├─rsyslog.service ● ├─ssh.service


Best Practices

  • 최신 버전 사용 권장
  • 공식 문서 참고
  • 테스트 환경에서 먼저 검증


References


Related Pages

Knowledge Graph

Related

LinuxServerHardwareNetwork