LINUX.ORG.RU

История изменений

Исправление v4567, (текущая версия) :

Ещё некоторое добавление.

В /chroot/ntp

создал папки /proc /sys папку пользователя root со всеми нужными файлами и чрутнулся в /chroot/ntp командой:

exec chroot /chroot/ntp env -i HOME=/root TERM="$TERM" PS1='\u:\w\$ ' PATH=/bin:/usr/bin:/usr/local/bin:/sbin:/usr/sbin:/usr/local/sbin /bin/bash --login +h

до этого примонтировав папки командами:

mount -v --bind /dev /chroot/mnt/dev
mount -vt devpts devpts /vhroot/mnt/dev/pts
mount -vt tmpfs shm /chroot/mnt/dev/shm
mount -v --bind /proc /chroot/mnt/proc
mount -vt sysfs sysfs /chroot/mnt/sys

После этого находясь уже в чрут из командной строки запускаю ntpd но он всё равно пишет в логи как и раньше и не работает, хотя в памяти висит.

Запустив в чрут вот такую команду:

strace /usr/sbin/ntpd -g -u ntp:ntp -p /var/run/ntp/ntpd.pid 2>&1 | tee /root/ntpd.txt

В файле /root/ntpd.txt получаю вот что:

execve("/usr/sbin/ntpd", ["/usr/sbin/ntpd", "-g", "-u", "ntp:ntp", "-p", "/var/run/ntp/ntpd.pid"], [/* 19 vars */]
brk(0)                                  = 0x9d47000
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb76f5000
access("/etc/ld.so.preload", R_OK)      = -1 ENOENT (No such file or directory)
open("/etc/ld.so.cache", O_RDONLY)      = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=3117, ...}) = 0
mmap2(NULL, 3117, PROT_READ, MAP_PRIVATE, 3, 0) = 0xb76f4000
close(3)                                = 0
open("/lib/libm.so.6", O_RDONLY)        = 3
read(3, "\177ELF\1\1\1\3\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\2004\0\0004\0\0\0"..., 512) = 512
fstat64(3, {st_mode=S_IFREG|0750, st_size=649661, ...}) = 0
mmap2(NULL, 172160, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0xb76c9000
mmap2(0xb76f2000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x28) = 0xb76f2000
close(3)                                = 0
open("/usr/lib/libcrypto.so.1.0.0", O_RDONLY) = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\200\264\3\0004\0\0\0"..., 512) = 512
fstat64(3, {st_mode=S_IFREG|0750, st_size=2036116, ...}) = 0
mmap2(NULL, 1816244, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0xb750d000
mmap2(0xb76b0000, 90112, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1a3) = 0xb76b0000
mmap2(0xb76c6000, 9908, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0xb76c6000
close(3)                                = 0
open("/lib/librt.so.1", O_RDONLY)       = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\240\30\0\0004\0\0\0"..., 512) = 512
fstat64(3, {st_mode=S_IFREG|0750, st_size=166079, ...}) = 0
mmap2(NULL, 33360, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0xb7504000
mmap2(0xb750b000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x6) = 0xb750b000
close(3)                                = 0
open("/lib/libcap.so.2", O_RDONLY)      = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\0\16\0\0004\0\0\0"..., 512) = 512
fstat64(3, {st_mode=S_IFREG|0750, st_size=47183, ...}) = 0
mmap2(NULL, 18044, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0xb74ff000
mmap2(0xb7503000, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x3) = 0xb7503000
close(3)                                = 0
open("/lib/libc.so.6", O_RDONLY)        = 3
read(3, "\177ELF\1\1\1\3\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0 \226\1\0004\0\0\0"..., 512) = 512
fstat64(3, {st_mode=S_IFREG|0750, st_size=8962502, ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb74fe000
mmap2(NULL, 1641000, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0xb736d000
mprotect(0xb74f7000, 4096, PROT_NONE)   = 0
mmap2(0xb74f8000, 12288, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x18a) = 0xb74f8000
mmap2(0xb74fb000, 10792, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0xb74fb000
close(3)                                = 0
open("/lib/libdl.so.2", O_RDONLY)       = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0@\n\0\0004\0\0\0"..., 512) = 512
fstat64(3, {st_mode=S_IFREG|0750, st_size=105007, ...}) = 0
mmap2(NULL, 16504, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0xb7368000
mmap2(0xb736b000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x2) = 0xb736b000
close(3)                                = 0
open("/lib/libpthread.so.0", O_RDONLY)  = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\320Z\0\0004\0\0\0"..., 512) = 512
fstat64(3, {st_mode=S_IFREG|0750, st_size=679639, ...}) = 0
mmap2(NULL, 107008, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0xb734d000
mmap2(0xb7364000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x16) = 0xb7364000
mmap2(0xb7366000, 4608, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0xb7366000
close(3)                                = 0
open("/lib/libattr.so.1", O_RDONLY)     = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\320\r\0\0004\0\0\0"..., 512) = 512
fstat64(3, {st_mode=S_IFREG|0750, st_size=44715, ...}) = 0
mmap2(NULL, 18864, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0xb7348000
mmap2(0xb734c000, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x3) = 0xb734c000
close(3)                                = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb7347000
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb7346000
set_thread_area({entry_number:-1 -> 6, base_addr:0xb73466c0, limit:1048575, seg_32bit:1, contents:0, read_exec_onl
mprotect(0xb7364000, 4096, PROT_READ)   = 0
mprotect(0xb736b000, 4096, PROT_READ)   = 0
mprotect(0xb74f8000, 8192, PROT_READ)   = 0
mprotect(0xb750b000, 4096, PROT_READ)   = 0
mprotect(0xb76f2000, 4096, PROT_READ)   = 0
mprotect(0xb7719000, 4096, PROT_READ)   = 0
munmap(0xb76f4000, 3117)                = 0
set_tid_address(0xb7346728)             = 31566
set_robust_list(0xb7346730, 0xc)        = 0
futex(0xbfa7a6cc, FUTEX_WAIT_BITSET_PRIVATE|FUTEX_CLOCK_REALTIME, 1, NULL, b73466c0) = -1 EAGAIN (Resource tempora
rt_sigaction(SIGRTMIN, {0xb73524f0, [], SA_SIGINFO}, NULL, 8) = 0
rt_sigaction(SIGRT_1, {0xb7352570, [], SA_RESTART|SA_SIGINFO}, NULL, 8) = 0
rt_sigprocmask(SIG_UNBLOCK, [RTMIN RT_1], NULL, 8) = 0
getrlimit(RLIMIT_STACK, {rlim_cur=8192*1024, rlim_max=RLIM_INFINITY}) = 0
uname({sys="Linux", node="server.ua", ...}) = 0
brk(0)                                  = 0x9d47000
brk(0x9d68000)                          = 0x9d68000
socket(PF_FILE, SOCK_DGRAM|SOCK_CLOEXEC, 0) = 3
connect(3, {sa_family=AF_FILE, path="/dev/log"}, 110) = 0
time(NULL)                              = 1419603005
open("/etc/localtime", O_RDONLY)        = 4
fstat64(4, {st_mode=S_IFREG|0640, st_size=2057, ...}) = 0
fstat64(4, {st_mode=S_IFREG|0640, st_size=2057, ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb76f4000
read(4, "TZif2\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\f\0\0\0\f\0\0\0\0"..., 4096) = 2057
_llseek(4, -30, [2027], SEEK_CUR)       = 0
read(4, "\nEET-2EEST,M3.5.0/3,M10.5.0/4\n", 4096) = 30
_llseek(4, 2056, [2056], SEEK_SET)      = 0
close(4)                                = 0
munmap(0xb76f4000, 4096)                = 0
send(3, "<29>Dec 26 16:10:05 ntpd[31566]:"..., 93, MSG_NOSIGNAL) = 93
umask(0)                                = 022
umask(022)                              = 0
getuid32()                              = 0
clock_gettime(CLOCK_REALTIME, {1419603005, 713280062}) = 0
clone(child_stack=0, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0xb7346728) = 31567
exit_group(0)                        = ?

Как видно что все файлы которые нужны присутствуют.

Исправление v4567, :

Ещё некоторое добавление.

В /chroot/ntp

создал папки /proc /sys папку пользователя root со всеми нужными файлами и чрутнулся в /chroot/ntp командой:

exec chroot /chroot/ntp env -i HOME=/root TERM="$TERM" PS1='\u:\w\$ ' PATH=/bin:/usr/bin:/usr/local/bin:/sbin:/usr/sbin:/usr/local/sbin /bin/bash --login +h

до этого примонтировав папки командами:

mount -v --bind /dev /chroot/mnt/dev
mount -vt devpts devpts /vhroot/mnt/dev/pts
mount -vt tmpfs shm /chroot/mnt/dev/shm
mount -v --bind /proc /chroot/mnt/proc
mount -vt sysfs sysfs /chroot/mnt/sys

После этого находясь уже в чрут из командной строки запускаю ntpd но он всё равно пишет в логи как и раньше и не работает, хотя в памяти висит.

Запустив в чрут вот такую команду:

strace /usr/sbin/ntpd -g -u ntp:ntp -p /var/run/ntp/ntpd.pid 2>&1 | tee /root/ntpd.txt

В файле /root/ntpd.txt получаю вот что:

execve("/usr/sbin/ntpd", ["/usr/sbin/ntpd", "-g", "-u", "ntp:ntp", "-p", "/var/run/ntp/ntpd.pid"], [/* 19 vars */]
brk(0)                                  = 0x9d47000
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb76f5000
access("/etc/ld.so.preload", R_OK)      = -1 ENOENT (No such file or directory)
open("/etc/ld.so.cache", O_RDONLY)      = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=3117, ...}) = 0
mmap2(NULL, 3117, PROT_READ, MAP_PRIVATE, 3, 0) = 0xb76f4000
close(3)                                = 0
open("/lib/libm.so.6", O_RDONLY)        = 3
read(3, "\177ELF\1\1\1\3\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\2004\0\0004\0\0\0"..., 512) = 512
fstat64(3, {st_mode=S_IFREG|0750, st_size=649661, ...}) = 0
mmap2(NULL, 172160, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0xb76c9000
mmap2(0xb76f2000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x28) = 0xb76f2000
close(3)                                = 0
open("/usr/lib/libcrypto.so.1.0.0", O_RDONLY) = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\200\264\3\0004\0\0\0"..., 512) = 512
fstat64(3, {st_mode=S_IFREG|0750, st_size=2036116, ...}) = 0
mmap2(NULL, 1816244, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0xb750d000
mmap2(0xb76b0000, 90112, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1a3) = 0xb76b0000
mmap2(0xb76c6000, 9908, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0xb76c6000
close(3)                                = 0
open("/lib/librt.so.1", O_RDONLY)       = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\240\30\0\0004\0\0\0"..., 512) = 512
fstat64(3, {st_mode=S_IFREG|0750, st_size=166079, ...}) = 0
mmap2(NULL, 33360, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0xb7504000
mmap2(0xb750b000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x6) = 0xb750b000
close(3)                                = 0
open("/lib/libcap.so.2", O_RDONLY)      = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\0\16\0\0004\0\0\0"..., 512) = 512
fstat64(3, {st_mode=S_IFREG|0750, st_size=47183, ...}) = 0
mmap2(NULL, 18044, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0xb74ff000
mmap2(0xb7503000, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x3) = 0xb7503000
close(3)                                = 0
open("/lib/libc.so.6", O_RDONLY)        = 3
read(3, "\177ELF\1\1\1\3\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0 \226\1\0004\0\0\0"..., 512) = 512
fstat64(3, {st_mode=S_IFREG|0750, st_size=8962502, ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb74fe000
mmap2(NULL, 1641000, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0xb736d000
mprotect(0xb74f7000, 4096, PROT_NONE)   = 0
mmap2(0xb74f8000, 12288, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x18a) = 0xb74f8000
mmap2(0xb74fb000, 10792, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0xb74fb000
close(3)                                = 0
open("/lib/libdl.so.2", O_RDONLY)       = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0@\n\0\0004\0\0\0"..., 512) = 512
fstat64(3, {st_mode=S_IFREG|0750, st_size=105007, ...}) = 0
mmap2(NULL, 16504, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0xb7368000
mmap2(0xb736b000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x2) = 0xb736b000
close(3)                                = 0
open("/lib/libpthread.so.0", O_RDONLY)  = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\320Z\0\0004\0\0\0"..., 512) = 512
fstat64(3, {st_mode=S_IFREG|0750, st_size=679639, ...}) = 0
mmap2(NULL, 107008, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0xb734d000
mmap2(0xb7364000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x16) = 0xb7364000
mmap2(0xb7366000, 4608, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0xb7366000
close(3)                                = 0
open("/lib/libattr.so.1", O_RDONLY)     = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\320\r\0\0004\0\0\0"..., 512) = 512
fstat64(3, {st_mode=S_IFREG|0750, st_size=44715, ...}) = 0
mmap2(NULL, 18864, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0xb7348000
mmap2(0xb734c000, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x3) = 0xb734c000
close(3)                                = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb7347000
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb7346000
set_thread_area({entry_number:-1 -> 6, base_addr:0xb73466c0, limit:1048575, seg_32bit:1, contents:0, read_exec_onl
mprotect(0xb7364000, 4096, PROT_READ)   = 0
mprotect(0xb736b000, 4096, PROT_READ)   = 0
mprotect(0xb74f8000, 8192, PROT_READ)   = 0
mprotect(0xb750b000, 4096, PROT_READ)   = 0
mprotect(0xb76f2000, 4096, PROT_READ)   = 0
mprotect(0xb7719000, 4096, PROT_READ)   = 0
munmap(0xb76f4000, 3117)                = 0
set_tid_address(0xb7346728)             = 31566
set_robust_list(0xb7346730, 0xc)        = 0
futex(0xbfa7a6cc, FUTEX_WAIT_BITSET_PRIVATE|FUTEX_CLOCK_REALTIME, 1, NULL, b73466c0) = -1 EAGAIN (Resource tempora
rt_sigaction(SIGRTMIN, {0xb73524f0, [], SA_SIGINFO}, NULL, 8) = 0
rt_sigaction(SIGRT_1, {0xb7352570, [], SA_RESTART|SA_SIGINFO}, NULL, 8) = 0
rt_sigprocmask(SIG_UNBLOCK, [RTMIN RT_1], NULL, 8) = 0
getrlimit(RLIMIT_STACK, {rlim_cur=8192*1024, rlim_max=RLIM_INFINITY}) = 0
uname({sys="Linux", node="server.ua", ...}) = 0
brk(0)                                  = 0x9d47000
brk(0x9d68000)                          = 0x9d68000
socket(PF_FILE, SOCK_DGRAM|SOCK_CLOEXEC, 0) = 3
connect(3, {sa_family=AF_FILE, path="/dev/log"}, 110) = 0
time(NULL)                              = 1419603005
open("/etc/localtime", O_RDONLY)        = 4
fstat64(4, {st_mode=S_IFREG|0640, st_size=2057, ...}) = 0
fstat64(4, {st_mode=S_IFREG|0640, st_size=2057, ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb76f4000
read(4, "TZif2\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\f\0\0\0\f\0\0\0\0"..., 4096) = 2057
_llseek(4, -30, [2027], SEEK_CUR)       = 0
read(4, "\nEET-2EEST,M3.5.0/3,M10.5.0/4\n", 4096) = 30
_llseek(4, 2056, [2056], SEEK_SET)      = 0
close(4)                                = 0
munmap(0xb76f4000, 4096)                = 0
send(3, "<29>Dec 26 16:10:05 ntpd[31566]:"..., 93, MSG_NOSIGNAL) = 93
umask(0)                                = 022
umask(022)                              = 0
getuid32()                              = 0
clock_gettime(CLOCK_REALTIME, {1419603005, 713280062}) = 0
clone(child_stack=0, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0xb7346728) = 31567
exit_group(0)

= ?

Как видно что все файлы которые нужны присутствуют.

Исходная версия v4567, :

Ещё некоторое добавление.

В /chroot/ntp

создал папки /proc /sys папку пользователя root со всеми нужными файлами и чрутнулся в /chroot/ntp командой:

exec chroot /chroot/ntp env -i HOME=/root TERM="$TERM" PS1='\u:\w\$ ' PATH=/bin:/usr/bin:/usr/local/bin:/sbin:/usr/sbin:/usr/local/sbin /bin/bash --login +h

до этого примонтировав папки командами:

mount -v --bind /dev /chroot/mnt/dev
mount -vt devpts devpts /vhroot/mnt/dev/pts
mount -vt tmpfs shm /chroot/mnt/dev/shm
mount -v --bind /proc /chroot/mnt/proc
mount -vt sysfs sysfs /chroot/mnt/sys

После этого находясь уже в чрут из командной строки запускаю ntpd но он всё равно пишет в логи как и раньше и не работает, хотя в памяти висит.

Запустив в чрут вот такую команду:

strace /usr/sbin/ntpd -g -u ntp:ntp -p /var/run/ntp/ntpd.pid 2>&1 | tee /root/ntpd.txt

В файле /root/ntpd.txt получаю вот что:

execve(«/usr/sbin/ntpd», [«/usr/sbin/ntpd», "-g", "-u", «ntp:ntp», "-p", «/var/run/ntp/ntpd.pid»], [/* 19 vars */] brk(0) = 0x9d47000 mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb76f5000 access(«/etc/ld.so.preload», R_OK) = -1 ENOENT (No such file or directory) open(«/etc/ld.so.cache», O_RDONLY) = 3 fstat64(3, {st_mode=S_IFREG|0644, st_size=3117, ...}) = 0 mmap2(NULL, 3117, PROT_READ, MAP_PRIVATE, 3, 0) = 0xb76f4000 close(3) = 0 open(«/lib/libm.so.6», O_RDONLY) = 3 read(3, «\177ELF\1\1\1\3\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\2004\0\0004\0\0\0»..., 512) = 512 fstat64(3, {st_mode=S_IFREG|0750, st_size=649661, ...}) = 0 mmap2(NULL, 172160, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0xb76c9000 mmap2(0xb76f2000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x28) = 0xb76f2000 close(3) = 0 open(«/usr/lib/libcrypto.so.1.0.0», O_RDONLY) = 3 read(3, «\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\200\264\3\0004\0\0\0»..., 512) = 512 fstat64(3, {st_mode=S_IFREG|0750, st_size=2036116, ...}) = 0 mmap2(NULL, 1816244, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0xb750d000 mmap2(0xb76b0000, 90112, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1a3) = 0xb76b0000 mmap2(0xb76c6000, 9908, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0xb76c6000 close(3) = 0 open(«/lib/librt.so.1», O_RDONLY) = 3 read(3, «\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\240\30\0\0004\0\0\0»..., 512) = 512 fstat64(3, {st_mode=S_IFREG|0750, st_size=166079, ...}) = 0 mmap2(NULL, 33360, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0xb7504000 mmap2(0xb750b000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x6) = 0xb750b000 close(3) = 0 open(«/lib/libcap.so.2», O_RDONLY) = 3 read(3, «\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\0\16\0\0004\0\0\0»..., 512) = 512 fstat64(3, {st_mode=S_IFREG|0750, st_size=47183, ...}) = 0 mmap2(NULL, 18044, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0xb74ff000 mmap2(0xb7503000, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x3) = 0xb7503000 close(3) = 0 open(«/lib/libc.so.6», O_RDONLY) = 3 read(3, «\177ELF\1\1\1\3\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0 \226\1\0004\0\0\0»..., 512) = 512 fstat64(3, {st_mode=S_IFREG|0750, st_size=8962502, ...}) = 0 mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb74fe000 mmap2(NULL, 1641000, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0xb736d000 mprotect(0xb74f7000, 4096, PROT_NONE) = 0 mmap2(0xb74f8000, 12288, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x18a) = 0xb74f8000 mmap2(0xb74fb000, 10792, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0xb74fb000 close(3) = 0 open(«/lib/libdl.so.2», O_RDONLY) = 3 read(3, «\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0@\n\0\0004\0\0\0»..., 512) = 512 fstat64(3, {st_mode=S_IFREG|0750, st_size=105007, ...}) = 0 mmap2(NULL, 16504, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0xb7368000 mmap2(0xb736b000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x2) = 0xb736b000 close(3) = 0 open(«/lib/libpthread.so.0», O_RDONLY) = 3 read(3, «\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\320Z\0\0004\0\0\0»..., 512) = 512 fstat64(3, {st_mode=S_IFREG|0750, st_size=679639, ...}) = 0 mmap2(NULL, 107008, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0xb734d000 mmap2(0xb7364000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x16) = 0xb7364000 mmap2(0xb7366000, 4608, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0xb7366000 close(3) = 0 open(«/lib/libattr.so.1», O_RDONLY) = 3 read(3, «\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\320\r\0\0004\0\0\0»..., 512) = 512 fstat64(3, {st_mode=S_IFREG|0750, st_size=44715, ...}) = 0 mmap2(NULL, 18864, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0xb7348000 mmap2(0xb734c000, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x3) = 0xb734c000 close(3) = 0 mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb7347000 mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb7346000 set_thread_area({entry_number:-1 -> 6, base_addr:0xb73466c0, limit:1048575, seg_32bit:1, contents:0, read_exec_onl mprotect(0xb7364000, 4096, PROT_READ) = 0 mprotect(0xb736b000, 4096, PROT_READ) = 0 mprotect(0xb74f8000, 8192, PROT_READ) = 0 mprotect(0xb750b000, 4096, PROT_READ) = 0 mprotect(0xb76f2000, 4096, PROT_READ) = 0 mprotect(0xb7719000, 4096, PROT_READ) = 0 munmap(0xb76f4000, 3117) = 0 set_tid_address(0xb7346728) = 31566 set_robust_list(0xb7346730, 0xc) = 0 futex(0xbfa7a6cc, FUTEX_WAIT_BITSET_PRIVATE|FUTEX_CLOCK_REALTIME, 1, NULL, b73466c0) = -1 EAGAIN (Resource tempora rt_sigaction(SIGRTMIN, {0xb73524f0, [], SA_SIGINFO}, NULL, 8) = 0 rt_sigaction(SIGRT_1, {0xb7352570, [], SA_RESTART|SA_SIGINFO}, NULL, 8) = 0 rt_sigprocmask(SIG_UNBLOCK, [RTMIN RT_1], NULL, 8) = 0 getrlimit(RLIMIT_STACK, {rlim_cur=8192*1024, rlim_max=RLIM_INFINITY}) = 0 uname({sys=«Linux», node=«server.ua», ...}) = 0 brk(0) = 0x9d47000 brk(0x9d68000) = 0x9d68000 socket(PF_FILE, SOCK_DGRAM|SOCK_CLOEXEC, 0) = 3 connect(3, {sa_family=AF_FILE, path=«/dev/log»}, 110) = 0 time(NULL) = 1419603005 open(«/etc/localtime», O_RDONLY) = 4 fstat64(4, {st_mode=S_IFREG|0640, st_size=2057, ...}) = 0 fstat64(4, {st_mode=S_IFREG|0640, st_size=2057, ...}) = 0 mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb76f4000 read(4, «TZif2\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\f\0\0\0\f\0\0\0\0»..., 4096) = 2057 _llseek(4, -30, [2027], SEEK_CUR) = 0 read(4, «\nEET-2EEST,M3.5.0/3,M10.5.0/4\n», 4096) = 30 _llseek(4, 2056, [2056], SEEK_SET) = 0 close(4) = 0 munmap(0xb76f4000, 4096) = 0 send(3, «<29>Dec 26 16:10:05 ntpd[31566]:»..., 93, MSG_NOSIGNAL) = 93 umask(0) = 022 umask(022) = 0 getuid32() = 0 clock_gettime(CLOCK_REALTIME, {1419603005, 713280062}) = 0 clone(child_stack=0, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0xb7346728) = 31567 exit_group(0) = ?

Как видно что все файлы которые нужны присутствуют.