![systemd 마운트 네임스페이스를 사용하여 ntpd를 시작할 때 pid 1과 다릅니다.](https://linux55.com/image/113846/systemd%20%EB%A7%88%EC%9A%B4%ED%8A%B8%20%EB%84%A4%EC%9E%84%EC%8A%A4%ED%8E%98%EC%9D%B4%EC%8A%A4%EB%A5%BC%20%EC%82%AC%EC%9A%A9%ED%95%98%EC%97%AC%20ntpd%EB%A5%BC%20%EC%8B%9C%EC%9E%91%ED%95%A0%20%EB%95%8C%20pid%201%EA%B3%BC%20%EB%8B%A4%EB%A6%85%EB%8B%88%EB%8B%A4..png)
systemd를 사용하여 ntpd를 시작할 때 ntpd pid의 마운트 네임스페이스가 pid 1과 다른 이유는 무엇입니까?
systemd를 사용하여 ntpd를 시작할 때
마운트 네임스페이스만 pid 1과 다릅니다.
ntpd mnt:[4026532696]이 표시되지만 pid 1은 mnt:[4026531840]입니다.#ll /proc/`pidof ntpd`/ns
total 0
lrwxrwxrwx 1 root root 0 Jun 7 17:58 ipc -> ipc:[4026531839]
lrwxrwxrwx 1 root root 0 Jun 7 17:58 mnt -> mnt:[4026532696]
lrwxrwxrwx 1 root root 0 Jun 7 17:58 net -> net:[4026531968]
lrwxrwxrwx 1 root root 0 Jun 7 17:58 pid -> pid:[4026531836]
lrwxrwxrwx 1 root root 0 Jun 7 17:58 user -> user:[4026531837]
lrwxrwxrwx 1 root root 0 Jun 7 17:58 uts -> uts:[4026531838]
#ll /proc/1/ns
total 0
lrwxrwxrwx 1 root root 0 Jun 7 17:58 ipc -> ipc:[4026531839]
lrwxrwxrwx 1 root root 0 Jun 7 17:58 mnt -> mnt:[4026531840]
lrwxrwxrwx 1 root root 0 Jun 7 17:58 net -> net:[4026531968]
lrwxrwxrwx 1 root root 0 Jun 7 17:58 pid -> pid:[4026531836]
lrwxrwxrwx 1 root root 0 Jun 7 17:58 user -> user:[4026531837]
lrwxrwxrwx 1 root root 0 Jun 7 17:58 uts -> uts:[4026531838]
systemd를 사용하지 않고 ntpd를 시작하는 경우
systemd를 사용하지 않고 ntpd를 시작하면 ntpd pid의 마운트 네임스페이스는 pid 1의 마운트 네임스페이스와 동일합니다.
#systemctl stop ntpd
#/usr/sbin/ntpd -u ntp:ntp -g
#ll /proc/`pidof ntpd`/ns
total 0
lrwxrwxrwx 1 root root 0 Jun 20 19:46 ipc -> ipc:[4026531839]
lrwxrwxrwx 1 root root 0 Jun 20 19:46 mnt -> mnt:[4026531840]
lrwxrwxrwx 1 root root 0 Jun 20 19:46 net -> net:[4026531968]
lrwxrwxrwx 1 root root 0 Jun 20 19:46 pid -> pid:[4026531836]
lrwxrwxrwx 1 root root 0 Jun 20 19:46 user -> user:[4026531837]
lrwxrwxrwx 1 root root 0 Jun 20 19:46 uts -> uts:[4026531838]
#ll /proc/1/ns
total 0
lrwxrwxrwx 1 root root 0 Jun 7 17:58 ipc -> ipc:[4026531839]
lrwxrwxrwx 1 root root 0 Jun 7 17:58 mnt -> mnt:[4026531840]
lrwxrwxrwx 1 root root 0 Jun 7 17:58 net -> net:[4026531968]
lrwxrwxrwx 1 root root 0 Jun 7 17:58 pid -> pid:[4026531836]
lrwxrwxrwx 1 root root 0 Jun 7 17:58 user -> user:[4026531837]
lrwxrwxrwx 1 root root 0 Jun 7 17:58 uts -> uts:[4026531838]
systemd로 시작된 다른 데몬은 괜찮아 보입니다.
sshd pid는 1252입니다
#ll /proc/1252/ns/
total 0
lrwxrwxrwx 1 root root 0 Jun 20 19:52 ipc -> ipc:[4026531839]
lrwxrwxrwx 1 root root 0 Jun 20 19:52 mnt -> mnt:[4026531840]
lrwxrwxrwx 1 root root 0 Jun 20 19:52 net -> net:[4026531968]
lrwxrwxrwx 1 root root 0 Jun 20 19:52 pid -> pid:[4026531836]
lrwxrwxrwx 1 root root 0 Jun 20 19:52 user -> user:[4026531837]
lrwxrwxrwx 1 root root 0 Jun 20 19:52 uts -> uts:[4026531838]