Ubuntu "service" 명령이 중단되어 서비스를 다시 로드할 수 없습니다.

Ubuntu "service" 명령이 중단되어 서비스를 다시 로드할 수 없습니다.

serviceUbuntu 16.04.6 LTS에서는 명령을 호출하여 서비스 상태를 수정하는 방법이 없습니다 . /etc/init/명령이 시작되었지만 실행 중에 중단되었습니다.

서비스 자체는 여전히 실행 중이지만 자체 구성( start on등) 에 따라

그 안에 있는 스크립트와 /etc/init.d상호 작용할 수 있습니다.

에는 아무것도 없고 , /var/log/syslog서비스별 로그( ) /var/log/upstart/<service>.log에는 특별한 내용이 없습니다 .

initctl -v reload-configuration명령도 중단되어 아무 것도 인쇄하지 않습니다.

다음을 사용하여 추가한 init 스크립트의 구문을 확인했는데 init-checkconf다음과 같이 출력되었습니다.

DEBUG: upstart_path=/sbin/upstart
DEBUG: initctl_path=/sbin/initctl
DEBUG: Setting XDG_RUNTIME_DIR='/tmp/init-checkconf.fbn15XHMSG'
DEBUG: confdir=/tmp/init-checkconf.1ZAjdLCNnz
DEBUG: file=/etc/init/tiler.conf
DEBUG: job=tiler
DEBUG: upstart_out=/tmp/init-checkconf-upstart-output.KbilFI2A3x
DEBUG: upstart_cmd=/sbin/upstart --user --no-dbus --no-startup-event --verbose --confdir /tmp/init-checkconf.1ZAjdLCNnz
DEBUG: Upstart pid=32001
DEBUG: Joining Upstart session 'unix:abstract=/com/ubuntu/upstart-session/0/32001'
DEBUG: Waiting for Upstart to initialise (attempt 1)
DEBUG: Secondary Upstart (/sbin/upstart --user --no-dbus --no-startup-event --verbose --confdir /tmp/init-checkconf.1ZAjdLCNnz) running with PID 32001
File /etc/init/tiler.conf: syntax ok
DEBUG: Stopping secondary Upstart (running with PID 32001)

그리고 기본 스크립트인 nginx 스크립트를 사용합니다.

DEBUG: upstart_path=/sbin/upstart
DEBUG: initctl_path=/sbin/initctl
DEBUG: Setting XDG_RUNTIME_DIR='/tmp/init-checkconf.bk34MF5r1W'
DEBUG: confdir=/tmp/init-checkconf.1aWnCVHKEp
DEBUG: file=/etc/init/nginx.conf
DEBUG: job=nginx
DEBUG: upstart_out=/tmp/init-checkconf-upstart-output.n7w9BHFOsL
DEBUG: upstart_cmd=/sbin/upstart --user --no-dbus --no-startup-event --verbose --confdir /tmp/init-checkconf.1aWnCVHKEp
DEBUG: Upstart pid=32107
DEBUG: Joining Upstart session 'unix:abstract=/com/ubuntu/upstart-session/0/32107'
DEBUG: Waiting for Upstart to initialise (attempt 1)
DEBUG: Secondary Upstart (/sbin/upstart --user --no-dbus --no-startup-event --verbose --confdir /tmp/init-checkconf.1aWnCVHKEp) running with PID 32107
File /etc/init/nginx.conf: syntax ok
DEBUG: Stopping secondary Upstart (running with PID 32107)

이 문제의 원인은 무엇입니까? 어떻게 해결하나요?

시간 내 주셔서 감사합니다

폴리스티렌strace런타임 로그 입니다service tiler restart

execve("/usr/sbin/service", ["service", "tiler", "restart"], [/* 19 vars */]) = 0
brk(NULL)                               = 0x55b3bcb00000
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)
access("/etc/ld.so.preload", R_OK)      = -1 ENOENT (No such file or directory)
open("/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=61892, ...}) = 0
mmap(NULL, 61892, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7fee7dfe1000
close(3)                                = 0
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)
open("/lib/x86_64-linux-gnu/libc.so.6", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\2\1\1\3\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0`\t\2\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=1868984, ...}) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fee7dfe0000
mmap(NULL, 3971488, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7fee7da02000
mprotect(0x7fee7dbc2000, 2097152, PROT_NONE) = 0
mmap(0x7fee7ddc2000, 24576, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1c0000) = 0x7fee7ddc2000
mmap(0x7fee7ddc8000, 14752, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7fee7ddc8000
close(3)                                = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fee7dfdf000
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fee7dfde000
arch_prctl(ARCH_SET_FS, 0x7fee7dfdf700) = 0
mprotect(0x7fee7ddc2000, 16384, PROT_READ) = 0
mprotect(0x55b3bc08e000, 8192, PROT_READ) = 0
mprotect(0x7fee7dff1000, 4096, PROT_READ) = 0
munmap(0x7fee7dfe1000, 61892)           = 0
getuid()                                = 0
getgid()                                = 0
getpid()                                = 5537
rt_sigaction(SIGCHLD, {0x55b3bbe82540, ~[RTMIN RT_1], SA_RESTORER, 0x7fee7da374c0}, NULL, 8) = 0
geteuid()                               = 0
brk(NULL)                               = 0x55b3bcb00000
brk(0x55b3bcb21000)                     = 0x55b3bcb21000
getppid()                               = 5535
stat("/home/ubuntu", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
stat(".", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
open("/usr/sbin/service", O_RDONLY)     = 3
fcntl(3, F_DUPFD, 10)                   = 10
close(3)                                = 0
fcntl(10, F_SETFD, FD_CLOEXEC)          = 0
geteuid()                               = 0
getegid()                               = 0
rt_sigaction(SIGINT, NULL, {SIG_DFL, [], 0}, 8) = 0
rt_sigaction(SIGINT, {0x55b3bbe82540, ~[RTMIN RT_1], SA_RESTORER, 0x7fee7da374c0}, NULL, 8) = 0
rt_sigaction(SIGQUIT, NULL, {SIG_DFL, [], 0}, 8) = 0
rt_sigaction(SIGQUIT, {SIG_DFL, ~[RTMIN RT_1], SA_RESTORER, 0x7fee7da374c0}, NULL, 8) = 0
rt_sigaction(SIGTERM, NULL, {SIG_DFL, [], 0}, 8) = 0
rt_sigaction(SIGTERM, {SIG_DFL, ~[RTMIN RT_1], SA_RESTORER, 0x7fee7da374c0}, NULL, 8) = 0
read(10, "#!/bin/sh\n\n#####################"..., 8192) = 8192
pipe([3, 4])                            = 0
clone(child_stack=0, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0x7fee7dfdf9d0) = 5538
close(4)                                = 0
read(3, "service\n", 128)               = 8
read(3, "", 128)                        = 0
close(3)                                = 0
wait4(-1, [{WIFEXITED(s) && WEXITSTATUS(s) == 0}], 0, NULL) = 5538
--- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=5538, si_uid=0, si_status=0, si_utime=0, si_stime=0} ---
rt_sigreturn({mask=[]})                 = 5538
pipe([3, 4])                            = 0
clone(child_stack=0, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0x7fee7dfdf9d0) = 5539
close(4)                                = 0
read(3, "service\n", 128)               = 8
read(3, "", 128)                        = 0
close(3)                                = 0
wait4(-1, [{WIFEXITED(s) && WEXITSTATUS(s) == 0}], 0, NULL) = 5539
--- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=5539, si_uid=0, si_status=0, si_utime=0, si_stime=0} ---
rt_sigreturn({mask=[]})                 = 5539
stat("/run/systemd/system", 0x7ffdc59d9e90) = -1 ENOENT (No such file or directory)
chdir("/")                              = 0
faccessat(AT_FDCWD, "/etc/init/tiler.conf", R_OK) = 0
open("/dev/null", O_WRONLY|O_CREAT|O_TRUNC, 0666) = 3
fcntl(1, F_DUPFD, 10)                   = 11
close(1)                                = 0
fcntl(11, F_SETFD, FD_CLOEXEC)          = 0
dup2(3, 1)                              = 1
close(3)                                = 0
stat("/usr/local/sbin/which", 0x7ffdc59d9fa0) = -1 ENOENT (No such file or directory)
stat("/usr/local/bin/which", 0x7ffdc59d9fa0) = -1 ENOENT (No such file or directory)
stat("/usr/sbin/which", 0x7ffdc59d9fa0) = -1 ENOENT (No such file or directory)
stat("/usr/bin/which", {st_mode=S_IFREG|0755, st_size=946, ...}) = 0
clone(child_stack=0, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0x7fee7dfdf9d0) = 5540
wait4(-1, [{WIFEXITED(s) && WEXITSTATUS(s) == 0}], 0, NULL) = 5540
--- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=5540, si_uid=0, si_status=0, si_utime=0, si_stime=0} ---
rt_sigreturn({mask=[]})                 = 5540
dup2(11, 1)                             = 1
close(11)                               = 0
stat("/usr/local/sbin/initctl", 0x7ffdc59da030) = -1 ENOENT (No such file or directory)
stat("/usr/local/bin/initctl", 0x7ffdc59da030) = -1 ENOENT (No such file or directory)
stat("/usr/sbin/initctl", 0x7ffdc59da030) = -1 ENOENT (No such file or directory)
stat("/usr/bin/initctl", 0x7ffdc59da030) = -1 ENOENT (No such file or directory)
stat("/sbin/initctl", {st_mode=S_IFREG|0755, st_size=214216, ...}) = 0
pipe([3, 4])                            = 0
clone(child_stack=0, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0x7fee7dfdf9d0) = 5541
close(4)                                = 0
stat("/usr/local/sbin/grep", 0x7ffdc59da030) = -1 ENOENT (No such file or directory)
stat("/usr/local/bin/grep", 0x7ffdc59da030) = -1 ENOENT (No such file or directory)
stat("/usr/sbin/grep", 0x7ffdc59da030)  = -1 ENOENT (No such file or directory)
stat("/usr/bin/grep", 0x7ffdc59da030)   = -1 ENOENT (No such file or directory)
stat("/sbin/grep", 0x7ffdc59da030)      = -1 ENOENT (No such file or directory)
stat("/bin/grep", {st_mode=S_IFREG|0755, st_size=211224, ...}) = 0
clone(child_stack=0, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0x7fee7dfdf9d0) = 5542
close(3)                                = 0
close(-1)                               = -1 EBADF (Bad file descriptor)
wait4(-1, 0x7ffdc59d9f5c, 0, NULL)      = ? ERESTARTSYS (To be restarted if SA_RESTART is set)
--- SIGINT {si_signo=SIGINT, si_code=SI_KERNEL} ---
rt_sigreturn({mask=[]})                 = -1 EINTR (Interrupted system call)
wait4(-1, [{WIFSIGNALED(s) && WTERMSIG(s) == SIGINT}], 0, NULL) = 5542
--- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_KILLED, si_pid=5542, si_uid=0, si_status=SIGINT, si_utime=0, si_stime=0} ---
rt_sigreturn({mask=[]})                 = 5542
wait4(-1, [{WIFSIGNALED(s) && WTERMSIG(s) == SIGINT}], 0, NULL) = 5541
--- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_KILLED, si_pid=5541, si_uid=0, si_status=SIGINT, si_utime=0, si_stime=0} ---
rt_sigreturn({mask=[]})                 = 5541
rt_sigprocmask(SIG_SETMASK, [], [], 8)  = 0
rt_sigaction(SIGINT, {SIG_DFL, [INT], SA_RESTORER|SA_RESTART, 0x7fee7da374c0}, {0x55b3bbe82540, ~[KILL STOP RTMIN RT_1], SA_RESTORER, 0x7fee7da374c0}, 8) = 0
tgkill(5537, 5537, SIGINT)              = 0
--- SIGINT {si_signo=SIGINT, si_code=SI_TKILL, si_pid=5537, si_uid=0} ---
+++ killed by SIGINT +++

대기 모드에서 멈춰 있습니다.

또한 Journalctl에는 아무것도 없습니다.

답변1

알고보니 RAM이 부족하여 프로세스를 강제로 중지한 인스턴스였습니다.

관련 정보