[systemd-devel] Poor man's reboot doesn't work

Thomas Meyer thomas at m3y3r.de
Fri Nov 7 11:37:42 PST 2014


Am Freitag, den 07.11.2014, 01:59 +0100 schrieb Lennart Poettering:
> On Sun, 02.11.14 12:48, Thomas Meyer (thomas at m3y3r.de) wrote:
> 
> > Hi,
> > 
> > I tried to switch to the emergency target and back to the graphical target,
> > but this doesn't seem to work.
> > 
> > Should this work, i.e.?
> > 
> > # systemctl isolate emergency.target
> > # systemctl isolate graphical.target
> > 
> > The services seems to fail with this error once I'm in the emergency.target
> > and try to switch back to the graphical.target:
> > status=219/CGROUP
> 
> Hmm, this is certainly weird.
> 
> Any chance you can do "strace -ff -p 1 -o /tmp/someplace/log" (maybe
> from the debug shell). Then, trigger the issue again, and find the
> tight log file in /tmp/someplace that ends with an exit(219). It would
> be good to paste that file somewhere (or at least the last few lines
> which might give an indication on what precisely fails), so that I can
> have a look.

Here you go, I tried to extract one example here. if you miss something
I guess I can upload all traces somewhere.

AFAIU pid 1 tries to start the "restorecond.service" here (I removed all
sendmsg calls):

access("/etc/selinux/restorecond.conf", F_OK) = 0
open("/sys/fs/cgroup/systemd/system.slice/restorecond.service/control/cgroup.procs", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/sys/fs/cgroup/systemd/system.slice/restorecond.service/control", O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
clone(child_stack=0, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0x7f06d74bcb90) = 31006
access("/sys/fs/cgroup/systemd", F_OK)  = 0
open("/sys/fs/cgroup/systemd/system.slice/restorecond.service/cgroup.procs", O_WRONLY|O_CREAT|O_TRUNC|O_CLOEXEC, 0666) = -1 ENOENT (No such file or directory)
open("/proc/31006/stat", O_RDONLY|O_CLOEXEC) = 49
fstat(49, {st_mode=S_IFREG|0444, st_size=0, ...}) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f06d74e0000
read(49, "31006 (systemd) R 1 1 1 0 -1 420"..., 1024) = 343
close(49)                               = 0
munmap(0x7f06d74e0000, 4096)            = 0
open("/sys/fs/cgroup/systemd/system.slice/restorecond.service/cgroup.procs", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/sys/fs/cgroup/systemd/system.slice/restorecond.service", O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
ioctl(0, SNDCTL_TMR_TIMEBASE or SNDRV_TIMER_IOCTL_NEXT_DEVICE or TCGETS, 0x7fffa38779d0) = -1 ENOTTY (Inappropriate ioctl for device)
ioctl(1, SNDCTL_TMR_TIMEBASE or SNDRV_TIMER_IOCTL_NEXT_DEVICE or TCGETS, 0x7fffa38779d0) = -1 ENOTTY (Inappropriate ioctl for device)
ioctl(2, SNDCTL_TMR_TIMEBASE or SNDRV_TIMER_IOCTL_NEXT_DEVICE or TCGETS, 0x7fffa38779d0) = -1 ENOTTY (Inappropriate ioctl for device)
sendto(18, "l\0\0\0j\4\5\0\233\0\0\0\0\0\0\0 comm=\"restoreco"..., 108, 0, {sa_family=AF_NETLINK, pid=0, groups=00000000}, 12) = 108
poll([{fd=18, events=POLLIN}], 1, 500)  = 1 ([{fd=18, revents=POLLIN}])
recvfrom(18, "$\0\0\0\2\0\0\0\233\0\0\0\1\0\0\0\0\0\0\0l\0\0\0j\4\5\0\233\0\0\0"..., 8988, MSG_PEEK|MSG_DONTWAIT, {sa_family=AF_NETLINK, pid=0, groups=00000000}, [12]) = 36
recvfrom(18, "$\0\0\0\2\0\0\0\233\0\0\0\1\0\0\0\0\0\0\0l\0\0\0j\4\5\0\233\0\0\0"..., 8988, MSG_DONTWAIT, {sa_family=AF_NETLINK, pid=0, groups=00000000}, [12]) = 36
socket(PF_LOCAL, SOCK_STREAM|SOCK_CLOEXEC|SOCK_NONBLOCK, 0) = 49
connect(49, {sa_family=AF_LOCAL, sun_path=@"/org/freedesktop/plymouthd"}, 29) = 0
open("/proc/self/maps", O_RDONLY|O_CLOEXEC) = 50
fstat(50, {st_mode=S_IFREG|0444, st_size=0, ...}) = 0

[...]

waitid(P_PID, 31003, {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=31003, si_uid=0, si_status=219, si_utime=0, si_stime=0}, WEXITED, NULL) = 0
waitid(P_ALL, 0, {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=31006, si_uid=0, si_status=219, si_utime=0, si_stime=0}, WNOHANG|WEXITED|WNOWAIT, NULL) = 0
open("/proc/31006/comm", O_RDONLY|O_CLOEXEC) = 47
fstat(47, {st_mode=S_IFREG|0644, st_size=0, ...}) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f06d74e0000
read(47, "(torecond)\n", 1024)          = 11
close(47)                               = 0
munmap(0x7f06d74e0000, 4096)            = 0
open("/proc/31006/cgroup", O_RDONLY|O_CLOEXEC) = 47
fstat(47, {st_mode=S_IFREG|0444, st_size=0, ...}) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f06d74e0000
read(47, "6:blkio:/\n5:freezer:/\n4:devices:"..., 1024) = 78
close(47)                               = 0
munmap(0x7f06d74e0000, 4096)            = 0
open("/sys/fs/cgroup/systemd/system.slice/restorecond.service/cgroup.procs", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/sys/fs/cgroup/systemd/system.slice/restorecond.service", O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("/sys/fs/cgroup/systemd/system.slice/restorecond.service/cgroup.procs", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/sys/fs/cgroup/systemd/system.slice/restorecond.service", O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
timerfd_create(CLOCK_MONOTONIC, 0x80800 /* TFD_??? */) = 47
timerfd_settime(47, 0, {it_interval={0, 0}, it_value={90, 0}}, NULL) = 0
epoll_ctl(4, EPOLL_CTL_ADD, 47, {EPOLLIN, {u32=3616100368, u64=139667362631696}}) = 0
access("/sys/fs/cgroup/systemd", F_OK)  = 0
stat("/sys/fs/cgroup/systemd/system.slice/restorecond.service", 0x7fffa387be40) = -1 ENOENT (No such file or directory)
mkdir("/sys", 0755)                     = -1 EEXIST (File exists)
mkdir("/sys/fs", 0755)                  = -1 EEXIST (File exists)
mkdir("/sys/fs/cgroup", 0755)           = -1 EEXIST (File exists)
mkdir("/sys/fs/cgroup/systemd", 0755)   = -1 EEXIST (File exists)
mkdir("/sys/fs/cgroup/systemd/system.slice", 0755) = -1 EEXIST (File exists)
mkdir("/sys/fs/cgroup/systemd/system.slice/restorecond.service", 0755) = 0
mkdir("/sys/fs/cgroup/systemd/system.slice/restorecond.service/control", 0755) = 0
clone(child_stack=0, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0x7f06d74bcb90) = 31033
access("/sys/fs/cgroup/systemd", F_OK)  = 0
open("/sys/fs/cgroup/systemd/system.slice/restorecond.service/control/cgroup.procs", O_WRONLY|O_CREAT|O_TRUNC|O_CLOEXEC, 0666) = 48
fstat(48, {st_mode=S_IFREG|0644, st_size=0, ...}) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f06d74e0000
write(48, "31033\n", 6)                 = 6
close(48)                               = 0
munmap(0x7f06d74e0000, 4096)            = 0
open("/sys/fs/cgroup/systemd/system.slice/restorecond.service/cgroup.procs", O_RDONLY|O_CLOEXEC) = 48
fstat(48, {st_mode=S_IFREG|0644, st_size=0, ...}) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f06d74e0000
read(48, "", 4096)                      = 0
openat(AT_FDCWD, "/sys/fs/cgroup/systemd/system.slice/restorecond.service", O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC) = 57
getdents(57, /* 7 entries */, 32768)    = 232
open("/sys/fs/cgroup/systemd/system.slice/restorecond.service/control/cgroup.procs", O_RDONLY|O_CLOEXEC) = 58
fstat(58, {st_mode=S_IFREG|0644, st_size=0, ...}) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f06d74dd000
read(58, "", 4096)                      = 0
openat(AT_FDCWD, "/sys/fs/cgroup/systemd/system.slice/restorecond.service/control", O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC) = 59
getdents(59, /* 6 entries */, 32768)    = 200
getdents(59, /* 0 entries */, 32768)    = 0
close(58)                               = 0
munmap(0x7f06d74dd000, 4096)            = 0
close(59)                               = 0
getdents(57, /* 0 entries */, 32768)    = 0
close(48)                               = 0
munmap(0x7f06d74e0000, 4096)            = 0
close(57)                               = 0
waitid(P_PID, 31006, {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=31006, si_uid=0, si_status=219, si_utime=0, si_stime=0}, WEXITED, NULL) = 0
waitid(P_ALL, 0, {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=31012, si_uid=0, si_status=219, si_utime=0, si_stime=0}, WNOHANG|WEXITED|WNOWAIT, NULL) = 0

And PID 31006:

set_robust_list(0x7f06d74bcba0, 24)     = 0
prctl(PR_SET_NAME, 0x7fffa387c060, 0x646e6f6365726f74, 0xa, 0x3f) = 0
rt_sigaction(SIGSEGV, {SIG_DFL, [], SA_RESTORER|SA_RESTART, 0x7f06d59c76d0}, NULL, 8) = 0
rt_sigaction(SIGILL, {SIG_DFL, [], SA_RESTORER|SA_RESTART, 0x7f06d59c76d0}, NULL, 8) = 0
rt_sigaction(SIGFPE, {SIG_DFL, [], SA_RESTORER|SA_RESTART, 0x7f06d59c76d0}, NULL, 8) = 0
rt_sigaction(SIGBUS, {SIG_DFL, [], SA_RESTORER|SA_RESTART, 0x7f06d59c76d0}, NULL, 8) = 0
rt_sigaction(SIGQUIT, {SIG_DFL, [], SA_RESTORER|SA_RESTART, 0x7f06d59c76d0}, NULL, 8) = 0
rt_sigaction(SIGABRT, {SIG_DFL, [], SA_RESTORER|SA_RESTART, 0x7f06d59c76d0}, NULL, 8) = 0
rt_sigaction(SIGPIPE, {SIG_DFL, [], SA_RESTORER|SA_RESTART, 0x7f06d59c76d0}, NULL, 8) = 0
rt_sigaction(SIGPIPE, {SIG_IGN, [], SA_RESTORER|SA_RESTART, 0x7f06d59c76d0}, NULL, 8) = 0
rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
openat(AT_FDCWD, "/proc/self/fd", O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC) = 49
getdents(49, /* 53 entries */, 32768)   = 1272
close(3)                                = 0
close(4)                                = 0
close(5)                                = 0
close(6)                                = 0
close(7)                                = 0
close(8)                                = 0
close(9)                                = 0
close(10)                               = 0
close(11)                               = 0
close(12)                               = 0
close(13)                               = 0
close(14)                               = 0
close(15)                               = 0
close(16)                               = 0
close(17)                               = 0
close(18)                               = 0
close(19)                               = 0
close(20)                               = 0
close(21)                               = 0
close(22)                               = 0
close(23)                               = 0
close(24)                               = 0
close(25)                               = 0
close(26)                               = 0
close(27)                               = 0
close(28)                               = 0
close(29)                               = 0
close(30)                               = 0
close(31)                               = 0
close(32)                               = 0
close(33)                               = 0
close(34)                               = 0
close(35)                               = 0
close(36)                               = 0
close(37)                               = 0
close(38)                               = 0
close(39)                               = 0
close(40)                               = 0
close(41)                               = 0
close(42)                               = 0
close(43)                               = 0
close(44)                               = 0
close(45)                               = 0
close(46)                               = 0
close(47)                               = 0
close(48)                               = 0
close(52)                               = 0
getdents(49, /* 0 entries */, 32768)    = 0
close(49)                               = 0
setsid()                                = 31006
open("/dev/null", O_RDONLY|O_NOCTTY)    = 3
dup2(3, 0)                              = 0
close(3)                                = 0
socket(PF_LOCAL, SOCK_STREAM, 0)        = 3
connect(3, {sa_family=AF_LOCAL, sun_path="/run/systemd/journal/stdout"}, 29) = 0
shutdown(3, SHUT_RD)                    = 0
getsockopt(3, SOL_SOCKET, SO_SNDBUF, [212992], [4]) = 0
setsockopt(3, SOL_SOCKET, 0x20 /* SO_??? */, [8388608], 4) = 0
fstat(3, {st_mode=S_IFSOCK|0777, st_size=0, ...}) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f06d74e0000
lseek(3, 0, SEEK_CUR)                   = -1 ESPIPE (Illegal seek)
write(3, "restorecond\nrestorecond.service\n"..., 43) = 43
munmap(0x7f06d74e0000, 4096)            = 0
dup2(3, 1)                              = 1
close(3)                                = 0
dup2(1, 2)                              = 2
access("/sys/fs/cgroup/systemd", F_OK)  = 0
open("/sys/fs/cgroup/systemd/system.slice/restorecond.service/cgroup.procs", O_WRONLY|O_CREAT|O_TRUNC|O_CLOEXEC, 0666) = -1 ENOENT (No such file or directory)
socket(PF_LOCAL, SOCK_DGRAM|SOCK_CLOEXEC, 0) = 3
getsockopt(3, SOL_SOCKET, SO_SNDBUF, [212992], [4]) = 0
setsockopt(3, SOL_SOCKET, 0x20 /* SO_??? */, [8388608], 4) = 0
setsockopt(3, SOL_SOCKET, SO_SNDTIMEO, "\n\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0", 16) = 0
connect(3, {sa_family=AF_LOCAL, sun_path="/run/systemd/journal/socket"}, 29) = 0
sendmsg(3,) = 300
close(3)                                = 0
exit_group(219)                         = ?
+++ exited with 219 +++

any ideas what could be wrong here?

does switching to emergency.target remove the system.slice somehow?

> 
> Also, try booting with debug logs on ("systemd.log_level=debug") and
> see if this generates any additional log output that might be useful.
> 
> Lennart
> 





More information about the systemd-devel mailing list