systemd 관련하여 재정리를 시작한다.



요약하면 systemd 는 부팅 중 시작하는 서비스(혹 데몬)들을 관리하는 놈이라고 볼수 있다.


부팅 시점에 정의해논 서비스들을 병렬적으로 실행 할 수 있다. 특정 서비스 동작후에 원하는 서비스가 동작하도록 정의할수 있지만 명확한 타이밍에 동작 가능하도록 하는것은 아직 모르겠다.



우분투 15.04 부터 upstart-job 대신 systemd 를 사용하고 있다. 
이전까지 리눅스는 PID 1번 프로세스가 가장 먼저 실행되어 OS 에 필요한 각종 데몬들을 init 하였다.

이전에는 서비스 실행,중지를 service <service name> start | stop | restart 의 명령으로 제어했으나, systemd 를 사용하는 시스템에서는 systemctl start | stop | restart <unit name> 으로 관리하게 된다.
upstart-job에서는 데몬들을 service라는 네이밍을 붙였고, systemd에서는 unit이라는 이름을 사용한다.
systemd에서는 <unit name>.service이라는 파일을 systemctl enable [<unit name>.service] or [unit name] 명령으로 설치를 할 수 있다.(ini 포맷사용)
systemctl enable [unit name] 명령어를 실행하면 관련 서비스를 /etc/systemd/system/[target]/ 경로에 링크파일을 생성한다.
systemctl disable[unit name] 명령어를 실행하면 링크파일을 삭제한다.

  1. systemd는 최소한의 서비스만을 실행시키고 병렬화해서 실행시키는데 주안점을 두고 있기 때문에 기존에 순차적 방식으로 처리하는 SysV에 비해서 부팅속도가 빠른 편이다.
  2. 부팅 시간을 단축 시킬(즉, 불필요한 프로세스가 있는지 여부부터 오동작으로 인해 시간을 많이 잡아먹는지) 방안에 대해서 생각해 볼 수 있다.


  • systemctl 명령어 

   systemd 와 관련된 명령어를 수행한다.

 $ systemctl == $systemctl list-units // 동일한 명령으로 list-units 들을 보여준다


  • 런레벨은 target 으로 관리
systemd는 기존 init 커맨드와 달리 숫자 기반의 런레벨이 아니라 각 런레벨에 대한 설정 세트를 통해서 런레벨을 변경한다.


SysV Runlevel 

Systemd Target 

Notes 

 0

runlevel0.target, poweroff.target 

시스템을 중지 

 1,s, single

 runlevel1.target, rescue.target

단일 사용자 모드 

 2, 4

runlevel2.target, runlevel4,target, multi-user.target

사용자 정의, 기본 3과 동일 

 3

 runlevel3.target , multi-user.target

다중 사용자, 그래픽 사용하지않음. 사용자는 콘솔이나 네트워크를 통해 다중 접속할 수 있다. 

 5

runlevel5.target, graphical.target 

 다중사용자, 그래픽. 런레벨3에서 그래픽 추가된 서비스를 제공

 6

runlevel6.target, reboot.target 

 재부팅

emvergency 

emergency.target 

Emergency shell 



현재 사용하는 런레벨을 확인한다.

# systemctl get-default

graphical.target



  • 로그관리 (syslog 에서 지정하는 debug, info, err 등) 조회도 가능하다.

       # journalctl -p err >> err


  • 유용한 명령어
    1. systemd-analyze : 부팅에 걸린시간 표시 (tcc8935 없음)
    2. systemd-analyze blame : 부팅시 서비스별 걸린 시간표시 (tcc8935 없음)
    3. journalctl : 부팅을 포함한 전체적인 시스템 로그
    4. journalctl -b : 마지막 부팅 이후 시스템 로그
    5. hostnamectl : 호스트 이름표시
    6. hostnamectl set-hostname [변경이름] : 호스트이름 변경




  • 서비스 파일 등록하는 법
    • 부팅시 서비스가 실행하게 된다.
    • 재부팅시 적용됨
    • /lib/system/systemd 폴더와 /etc/systemd/system 폴더 안에 관련 파일을 확인하고 각 시스템 폴더에 링크파일을 생성해 주는 역할을 한다. 
      $ systemctl enable [serviceName|serviceName.service]
      $ systemctl enable XX 나 systemctl enable XX.service

  • 서비스 파일 해제하는 법
    • 서비스가 등록된 링크파일을 삭제한다.
    • 재부팅시 적용됨
      $ systemctl disable [serviceName|serviceName.service]
      $ systemctl disable XX 나 systemctl disable XX.service
  • 관련 서비스 start
    • 관련된 시스템이 동작하도록 한다.
    • 현재 각 서비스 파일을 보면 Restart=on-failure 로 등록되어 어서 앱이 죽거나 kill 시 자동 restart 되어지고 있다. 재실행하지 않으려면 주석처리 -> #Restart=on-failure
      $ systemctl start XX

  • 관련 서비스 stop
    • 관련된 시스템을 중지시킨다.
    • 서비스가 동작시 해당 어플리케이션 파일을 변경시킬 수 없다. 소스변경이 이루어질시 해당 하는 서비스를 중지시키고 해야함.
      $ systemctl stop XX

참고 


'Linux > Systemd' 카테고리의 다른 글

[SYSTEMD] INSTALL 섹션 옵션  (0) 2016.07.18
[Systemd] Unit .mount 설명  (0) 2016.07.12
journalctl 정의  (0) 2016.07.12
Systemd 내용  (2) 2016.06.15
  • [INSTALL] 섹션 옵션에 대해 알아보자
-  해당 유닛의 정보를 알기 위해 [INSTALL] 을 설정한다. 이 섹션은 systemctl 커맨드를 통해 enable , disable 시 유닛 파일이 설정된다. 링크 파일을 생성 및 삭제 한다.



해당옵션

Alias=

 링크파일이 생성될 파일이름을 지정한다. 확장자는 유닛 타입과 동일하다.

WantedBy, RequiredBy=

Also=

 

DefaultInstance=

"%n"    풀 Unit 이름 확장자까지

"%N"   확장자를 뺀 Unit 이름 

""

 



interpreted : (의미를) 설명하다. , (특정한 뜻으로)이해하다. ,통역하다.


'Linux > Systemd' 카테고리의 다른 글

[Systemd] 사용법  (0) 2018.05.23
[Systemd] Unit .mount 설명  (0) 2016.07.12
journalctl 정의  (0) 2016.07.12
Systemd 내용  (2) 2016.06.15

Systemd Unit Types 중 하나인 mount 파일에 대해 알아보겠다.



정의

확장자는 .mount 를 가지며 파일시스템의 마운트 포인트를 나타낸다. Unit 섹션과 Install 섹션 사용은 다른 유닛들과 비슷하나 Mount 섹션이 추가된다. 마운트 지점이 /home/kw 이라면 유닛파일은 home-kw.mount 로 지정한다. 



Ubuntu16.04 에서 진행하였으며

/lib/systemd/system 경로에 있는 .mount 파일을 분석


항목은 다음과 같다.


ManPage Link: https://www.freedesktop.org/software/systemd/man/systemd.mount.html


1. sys-kernel-debug.mount

2. sys-fs-fuse-connections.mount

3. dev-hugepages.mount

4. sys-kernel-config.mount

5. sysinit.target.wants/sys-kernel-debug.mount

6. sysinit.target.wants/sys-fs-fuse-connections.mount

7. sysinit.target.wants/dev-hugepages.mount

8. sysinit.target.wants/sys-kernel-config.mount

9. sysinit.target.wants/dev-mqueue.mount

10. proc-sys-fs-binfmt_misc.mount

11. dev-mqueue.mount






사용되는 옵션

[Unit]

Description=

Documentation=

Documentation=

DefaultDependencies=

ConditionPathExists=

ConditionCapability=

Before=


[Mount]

 마운트 파일은 Mount 섹션을 포함한다. 


What= 마운트할 파일 및 리소스의 절대경로

Where= 마운트할 디렉토리를 지정한다. 마운트경로가 없으면 자동으로 생성한다.  unit 파일 이름과 연관이 있다. 

Type= 파일시스템 타입을 가져온다 .  mount(8) for details. This setting is optional.

Options= 마운트 옵션이 들어가며 콤마, 로 구분한다. See mount(8) for details. This setting is optional.

SloppyOptions= boolean 값으로, true 이면  디폴트값은 off

DirectoryMode= 디렉토리 마운트 폴더가 자동생설될 때 폴더의 권한을 설정할 수 있다. 디폴트값은 0755

TimeoutSec= 마운트 커맨드의 대기시간을 설정한다.  이 시간내에 수행되지 않으면, 실패로 간주하고 종료한다. 


Check systemd.exec(5) and systemd.kill(5) for more settings.




샘플예제


ext4 파일시스템을 마운트하는 unit 파일을 생성 함.

[Unit] mnt-fs.mount 파일 생성

Description=Board rootFileSystem

Documentation=https://www.kernel.org/kw

Documentation=http://www.mysystem.org

DefaultDependencies=no

After=systemd-modules-load.service

#Before=sysinit.target


[Mount]

What=/home/kwangjo/Desktop/7_15.ext4

Where=/mnt/fs

Type=ext4 


systemctl start mnt-fs.mount

마운트는 확인 되었으나 재부팅시 적용되지 않았다.

자동추가하기 위해 Mount 섹션 아래에 Install 섹션 추가


[Install]

Alias=homeroofs

WantedBy=multi-user.target


등록 :  sudo systemctl enable mnt-fs.mount

재부팅후 정상 동작 확인함.






상태 확인


root@kwangjo:/mnt/fs# systemctl status mnt-fs.mount

● mnt-fs.mount - Board rootFileSystem

   Loaded: loaded (/lib/systemd/system/mnt-fs.mount; static; vendor preset: enabled)

   Active: active (mounted) since 화 2016-07-19 15:37:54 KST; 9s ago

    Where: /mnt/fs

     What: /dev/loop0

     Docs: https://www.kernel.org/kw

           http://www.mysystem.org

  Process: 2537 ExecMount=/bin/mount /home/kwangjo/Desktop/7_15.ext4 /mnt/fs -t ext4 (code=exited, status=0/SUCCESS)

      CPU: 4ms


 7월 19 15:37:53 kwangjo systemd[1]: Mounting Board rootFileSystem...

 7월 19 15:37:54 kwangjo systemd[1]: Mounted Board rootFileSystem.







'Linux > Systemd' 카테고리의 다른 글

[Systemd] 사용법  (0) 2018.05.23
[SYSTEMD] INSTALL 섹션 옵션  (0) 2016.07.18
journalctl 정의  (0) 2016.07.12
Systemd 내용  (2) 2016.06.15

다음공식문서를 보고 분석 : https://www.freedesktop.org/software/systemd/man/journalctl.html


systemd 의 서비스 로그를 확인 할 수 있다. 

journalctl 은 systemd-journald.service 에 의해서  systemd 의 정보들을 분석한다. 



옵션


--no-full, --full, -l




journal : 신문, 저널,학습지, 일기

synopsis : 개요

'Linux > Systemd' 카테고리의 다른 글

[Systemd] 사용법  (0) 2018.05.23
[SYSTEMD] INSTALL 섹션 옵션  (0) 2016.07.18
[Systemd] Unit .mount 설명  (0) 2016.07.12
Systemd 내용  (2) 2016.06.15

참고 사이트 : https://www.digitalocean.com/community/tutorials/understanding-systemd-units-and-unit-files



systemd 는 Unit 이라는 객체들을 관리한다. 


유닛의 종류


.service : 서버의 어플리케이션이나 서비스를 관리하는 역할. 



[Service] Section


GuessMainPID= 

 boolean 값을 가지며 기본값은 yes이다. Type=forking , PIDFile= 이 설정되지 않으면 동작하지 않는다.


PIDFile=

 지정한 PID 파일을 가져온다.  이옵션은 Service Type=이 "forking" 인경우 사용하길 권장한다. systemd 는 메인프로세스 데몬이 시작시 PID 파일을 읽어 서비스를 수행한다. 

BusName= 

 Type= 이 "dbus" 인경우 사용하는 하며 D-Bus 이름을 명시한다.





[Install] Section Directives

 유닛파일의 마지막 부분에 해당한다. 이 섹션은 선택사항으로 활성화 또는 비활성화 된경우 동작을 정의한다.

* WantedBy= :  [Unit] 섹션의 Wants= 와 유사하다. 


* RequiredBy= : WantedBy= 와 아주 유사하나, 의존성들이 충족되지 않으면 실패하게 된다. 활성화 되면 . requires 로 끝나는 디렉토리가 생성된다.


directive:  지시 , 지시하는


Section: systemd.resource-control :http://www.jlemmens.nl/cgi-bin/man/man2html?5+systemd.resource-control


CPUAccounting= Turn on CPU usage accounting for this unit. Takes a boolean argument. 

Note that turning on CPU accounting for one unit might also implicitly turn it on for all units contained in the same slice and for all its parent slices and the units contained therein. 

The system default for this setting maybe controlled withDefaultCPUAccounting= in systemd-system.conf(5).


유닛의 CPU 사용량 을 계산하도록 한다. boolean 값을 설정한다. 기본 디폴트값은 systgemd-system.conf 파일의 withDefaultCPUAccounting= 값을 참고한다.


CPUShares=weightStartupCPUShares=weight

Assign the specified CPU time share weight to the processes executed. These options take an integer value and control the "cpu.shares" control group attribute. The allowed range is 2 to 262144. Defaults to 1024. For details about this control group attribute, see sched-design-CFS.txt.

The available CPU time is split up among all units within one slice relative to their CPU time share weight.

While StartupCPUShares= only applies to the startup phase of the system, CPUShares= applies to normal runtime of the system, and if the former is not set also to the startup phase. 

Using StartupCPUShares= allows prioritizing specific services at boot-up differently than during normal runtime.

These options imply "CPUAccounting=true".



프로세스가 실행될때 CPU 공유시간을 설정할수 있다. 이 설정값은 integer 값으로 "cpu.shares"라는 속성에 의해 제어된다. 가능한값은 2~262144 로 기본값은 1024이다. 자세한 사항은 sched-design-CFS.txt 을 참고한다. 
StartupCPUShares= 를 사용하면 부팅시 normal runtime 시보다 우선적으로 수행을한다.
이 옵션은 "CPUaccounting=true"를 의미한다.

assign : 맡기다. 선임하다. 파견하다. 
specified : 명시된
specific : 구체적인, 명확한,분명한
applies to : ~에 적용되다.
phase : 단계, 단계적으로하다.

split : 분열되다. 나뉘다. 나누다.

slice : 조각, 몫

among: ~에 둘러싸인. ~의 가운데에

within : 이내에

prioritize : 우선순의를 매기다. 우선적으로 처리하다.
imply : 의미하다.

CPUQuota=

Assign the specified CPU time quota to the processes executed. Takes a percentage value, suffixed with "%". The percentage specifies how much CPU time the unit shall get at maximum, relative to the total CPU time available on one CPU. Use values > 100% for allotting CPU time on more than one CPU. This controls the "cpu.cfs_quota_us" control group attribute. For details about this control group attribute, see sched-design-CFS.txt.

Example: CPUQuota=20% ensures that the executed processes will never get more than 20% CPU time on one CPU.

Implies "CPUAccounting=true".


CPU 한도
 프로세스가 실행될때 CPU 사용 할당량을 지정한다. 이 속성은 "cpu.cfs_quota_us" 컨트롤 그룹 어트리뷰트에 의해 제어된다.  자세한 사항은 sched-design-CFS.txt 파일 참고.   CPUQuota=20% 의 의미는 20% 이상의 CPU 사용을 하지않도록 한다. 

quota : 한도, 몫


MemoryAccounting=

Turn on process and kernel memory accounting for this unit. Takes a boolean argument. Note that turning on memory accounting for one unit will also implicitly turn it on for all units contained in the same slice and for all its parent slices and the units contained therein. The system default for this setting may be controlled with DefaultMemoryAccounting= in systemd-system.conf(5).


유닛의 프로세스와 커널메모리를 계산한다.  boolean 값을 사용 (true, false). 기본설정값은 systemd-system.conf 의 DefaultMemoryAccounting= 사용한다.



MemoryLimit=bytes

Specify the limit on maximum memory usage of the executed processes. The limit specifies how much process and kernel memory can be used by tasks in this unit. Takes a memory size in bytes. If the value is suffixed with K, M, G or T, the specified memory size is parsed as Kilobytes, Megabytes, Gigabytes, or Terabytes (with the base 1024), respectively. If assigned the special value "infinity", no memory limit is applied. This controls the "memory.limit_in_bytes" control group attribute. For details about this control group attribute, see memory.txt.

Implies "MemoryAccounting=true".



최대 메모리 사용량을 지정한다. Byte 단위로 K, M, G, T 단위를 사용한다. "memory.limit_in_bytes"라는 컨트롤 그룹어트리뷰트에 의해 제어된다.  "MemoryAccounting=true" 




TasksAccounting=

Turn on task accounting for this unit. Takes a boolean argument. If enabled, the system manager will keep track of the number of tasks in the unit. The number of tasks accounted this way includes both kernel threads and userspace processes, with each thread counting individually. Note that turning on tasks accounting for one unit will also implicitly turn it on for all units contained in the same slice and for all its parent slices and the units contained therein. The system default for this setting may be controlled withDefaultTasksAccounting= in systemd-system.conf(5).






TasksMax=N

Specify the maximum number of tasks that may be created in the unit. This ensures that the number of tasks accounted for the unit (see above) stays below a specific limit. If assigned the special value "infinity", no tasks limit is applied. This controls the "pids.max" control group attribute. For details about this control group attribute, see pids.txt.

Implies "TasksAccounting=true". The system default for this setting may be controlled with DefaultTasksMax= in systemd-system.conf(5).

IOAccounting=

Turn on Block I/O accounting for this unit, if the unified control group hierarchy is used on the system. Takes a boolean argument. Note that turning on block I/O accounting for one unit will also implicitly turn it on for all units contained in the same slice and all for its parent slices and the units contained therein. The system default for this setting may be controlled withDefaultIOAccounting= in systemd-system.conf(5).

This setting is supported only if the unified control group hierarchy is used. Use BlockIOAccounting= on systems using the legacy control group hierarchy.

IOWeight=weightStartupIOWeight=weight

Set the default overall block I/O weight for the executed processes, if the unified control group hierarchy is used on the system. Takes a single weight value (between 1 and 10000) to set the default block I/O weight. This controls the "io.weight" control group attribute, which defaults to 100. For details about this control group attribute, see cgroup-v2.txt. The available I/O bandwidth is split up among all units within one slice relative to their block I/O weight.

While StartupIOWeight= only applies to the startup phase of the system, IOWeight= applies to the later runtime of the system, and if the former is not set also to the startup phase. This allows prioritizing specific services at boot-up differently than during runtime.

Implies "IOAccounting=true".

This setting is supported only if the unified control group hierarchy is used. Use BlockIOWeight= and StartupBlockIOWeight= on systems using the legacy control group hierarchy.

IODeviceWeight=device weight

Set the per-device overall block I/O weight for the executed processes, if the unified control group hierarchy is used on the system. Takes a space-separated pair of a file path and a weight value to specify the device specific weight value, between 1 and 10000. (Example: "/dev/sda 1000"). The file path may be specified as path to a block device node or as any other file, in which case the backing block device of the file system of the file is determined. This controls the "io.weight" control group attribute, which defaults to 100. Use this option multiple times to set weights for multiple devices. For details about this control group attribute, see cgroup-v2.txt.

Implies "IOAccounting=true".

This setting is supported only if the unified control group hierarchy is used. Use BlockIODeviceWeight= on systems using the legacy control group hierarchy.

IOReadBandwidthMax=device bytesIOWriteBandwidthMax=device bytes

Set the per-device overall block I/O bandwidth maximum limit for the executed processes, if the unified control group hierarchy is used on the system. This limit is not work-conserving and the executed processes are not allowed to use more even if the device has idle capacity. Takes a space-separated pair of a file path and a bandwidth value (in bytes per second) to specify the device specific bandwidth. The file path may be a path to a block device node, or as any other file in which case the backing block device of the file system of the file is used. If the bandwidth is suffixed with K, M, G, or T, the specified bandwidth is parsed as Kilobytes, Megabytes, Gigabytes, or Terabytes, respectively, to the base of 1000. (Example: "/dev/disk/by-path/pci-0000:00:1f.2-scsi-0:0:0:0 5M"). This controls the "io.max" control group attributes. Use this option multiple times to set bandwidth limits for multiple devices. For details about this control group attribute, see cgroup-v2.txt.

Implies "IOAccounting=true".

This setting is supported only if the unified control group hierarchy is used. Use BlockIOAccounting= on systems using the legacy control group hierarchy.

IOReadIOPSMax=device IOPSIOWriteIOPSMax=device IOPS

Set the per-device overall block I/O IOs-Per-Second maximum limit for the executed processes, if the unified control group hierarchy is used on the system. This limit is not work-conserving and the executed processes are not allowed to use more even if the device has idle capacity. Takes a space-separated pair of a file path and an IOPS value to specify the device specific IOPS. The file path may be a path to a block device node, or as any other file in which case the backing block device of the file system of the file is used. If the IOPS is suffixed with K, M, G, or T, the specified IOPS is parsed as KiloIOPS, MegaIOPS, GigaIOPS, or TeraIOPS, respectively, to the base of 1000. (Example: "/dev/disk/by-path/pci-0000:00:1f.2-scsi-0:0:0:0 1K"). This controls the "io.max" control group attributes. Use this option multiple times to set IOPS limits for multiple devices. For details about this control group attribute, see cgroup-v2.txt.

Implies "IOAccounting=true".

This setting is supported only if the unified control group hierarchy is used.

BlockIOAccounting=

Turn on Block I/O accounting for this unit, if the legacy control group hierarchy is used on the system. Takes a boolean argument. Note that turning on block I/O accounting for one unit will also implicitly turn it on for all units contained in the same slice and all for its parent slices and the units contained therein. The system default for this setting may be controlled withDefaultBlockIOAccounting= in systemd-system.conf(5).

This setting is supported only if the legacy control group hierarchy is used. Use IOAccounting= on systems using the unified control group hierarchy.

BlockIOWeight=weightStartupBlockIOWeight=weight

Set the default overall block I/O weight for the executed processes, if the legacy control group hierarchy is used on the system. Takes a single weight value (between 10 and 1000) to set the default block I/O weight. This controls the "blkio.weight" control group attribute, which defaults to 500. For details about this control group attribute, see blkio-controller.txt. The available I/O bandwidth is split up among all units within one slice relative to their block I/O weight.

While StartupBlockIOWeight= only applies to the startup phase of the system, BlockIOWeight= applies to the later runtime of the system, and if the former is not set also to the startup phase. This allows prioritizing specific services at boot-up differently than during runtime.

Implies "BlockIOAccounting=true".

This setting is supported only if the legacy control group hierarchy is used. Use IOWeight= and StartupIOWeight= on systems using the unified control group hierarchy.

BlockIODeviceWeight=device weight

Set the per-device overall block I/O weight for the executed processes, if the legacy control group hierarchy is used on the system. Takes a space-separated pair of a file path and a weight value to specify the device specific weight value, between 10 and 1000. (Example: "/dev/sda 500"). The file path may be specified as path to a block device node or as any other file, in which case the backing block device of the file system of the file is determined. This controls the "blkio.weight_device" control group attribute, which defaults to 1000. Use this option multiple times to set weights for multiple devices. For details about this control group attribute, see blkio-controller.txt.

Implies "BlockIOAccounting=true".

This setting is supported only if the legacy control group hierarchy is used. Use IODeviceWeight= on systems using the unified control group hierarchy.

BlockIOReadBandwidth=device bytesBlockIOWriteBandwidth=device bytes

Set the per-device overall block I/O bandwidth limit for the executed processes, if the legacy control group hierarchy is used on the system. Takes a space-separated pair of a file path and a bandwidth value (in bytes per second) to specify the device specific bandwidth. The file path may be a path to a block device node, or as any other file in which case the backing block device of the file system of the file is used. If the bandwidth is suffixed with K, M, G, or T, the specified bandwidth is parsed as Kilobytes, Megabytes, Gigabytes, or Terabytes, respectively, to the base of 1000. (Example: "/dev/disk/by-path/pci-0000:00:1f.2-scsi-0:0:0:0 5M"). This controls the "blkio.throttle.read_bps_device" and "blkio.throttle.write_bps_device" control group attributes. Use this option multiple times to set bandwidth limits for multiple devices. For details about these control group attributes, see blkio-controller.txt.

Implies "BlockIOAccounting=true".

This setting is supported only if the legacy control group hierarchy is used. Use IOReadBandwidthMax= and IOWriteBandwidthMax= on systems using the unified control group hierarchy.

DeviceAllow=

Control access to specific device nodes by the executed processes. Takes two space-separated strings: a device node specifier followed by a combination of rwm to control reading, writing, or creation of the specific device node(s) by the unit (mknod), respectively. This controls the "devices.allow" and "devices.deny" control group attributes. For details about these control group attributes, see devices.txt.

The device node specifier is either a path to a device node in the file system, starting with /dev/, or a string starting with either "char-" or "block-" followed by a device group name, as listed in /proc/devices. The latter is useful to whitelist all current and future devices belonging to a specific device group at once. The device group is matched according to file name globbing rules, you may hence use the "*" and "?" wildcards. Examples: /dev/sda5 is a path to a device node, referring to an ATA or SCSI block device. "char-pts" and "char-alsa" are specifiers for all pseudo TTYs and all ALSA sound devices, respectively. "char-cpu/*" is a specifier matching all CPU related device groups.

DevicePolicy=auto|closed|strict

Control the policy for allowing device access:

strict

means to only allow types of access that are explicitly specified.

closed

in addition, allows access to standard pseudo devices including /dev/null/dev/zero/dev/full/dev/random, and /dev/urandom.

auto

in addition, allows access to all devices if no explicit DeviceAllow= is present. This is the default.

Slice=

The name of the slice unit to place the unit in. Defaults to system.slice for all non-instantiated units of all unit types (except for slice units themselves see below). Instance units are by default placed in a subslice of system.slice that is named after the template name.

This option may be used to arrange systemd units in a hierarchy of slices each of which might have resource settings applied.

For units of type slice, the only accepted value for this setting is the parent slice. Since the name of a slice unit implies the parent slice, it is hence redundant to ever set this parameter directly for slice units.

Special care should be taken when relying on the default slice assignment in templated service units that haveDefaultDependencies=no set, see systemd.service(5), section "Automatic Dependencies" for details.

Delegate=

Turns on delegation of further resource control partitioning to processes of the unit. For unprivileged services (i.e. those using theUser= setting), this allows processes to create a subhierarchy beneath its control group path. For privileged services and scopes, this ensures the processes will have all control group controllers enabled.



'Linux > Systemd' 카테고리의 다른 글

[Systemd] 사용법  (0) 2018.05.23
[SYSTEMD] INSTALL 섹션 옵션  (0) 2016.07.18
[Systemd] Unit .mount 설명  (0) 2016.07.12
journalctl 정의  (0) 2016.07.12

+ Recent posts