Obsidian-StudiosInc / entrance

General purpose Display Manager built on the Enlightenment Foundation Libraries (EFL)
GNU General Public License v3.0
23 stars 10 forks source link

Unable to stop/restart entrance/X session when logged in #5

Closed wltjr closed 6 years ago

wltjr commented 7 years ago

Unable to stop/restart after log in. Gentoo xdm init script can start/stop/restart if not logged in. Once logged in restart/stop no longer works. End up having to kill entrance and X to stop which is not ideal.

# /etc/init.d/xdm stop
 * Stopping entrance ...
 * start-stop-daemon: no matching processes found                         [ ok ]

# cat /var/run/entrance.pid
485

# ps xa | grep entrance
485 ?        Ssl    0:00 /usr/sbin//entrance --nodaemon

The --nodaemon portion maybe the reason. Since the regular entrance process that can be started/stopped does not have that set.

wltjr commented 6 years ago

Seems it is able to restart after log in and before, just not when logged in. During an active X session.

awissu commented 6 years ago

SIGTERM is not handled when reboot/shutdown system:

strace killproc -v -p /var/run/entrance.pid -TERM /usr/sbin/entrance execve("/sbin/killproc", ["killproc", "-v", "-p", "/var/run/entrance.pid", "-TERM", "/usr/sbin/entrance"], 0xbf803784 / 85 vars /) = 0 brk(NULL) = 0x2066000 mmap2(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb7ef6000 access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory) openat(AT_FDCWD, "/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3 fstat64(3, {st_mode=S_IFREG|0644, st_size=80009, ...}) = 0 mmap2(NULL, 80009, PROT_READ, MAP_PRIVATE, 3, 0) = 0xb7ee2000 close(3) = 0 openat(AT_FDCWD, "/usr/lib/libblogger.so.2", O_RDONLY|O_CLOEXEC) = 3 read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\20\t\0\0004\0\0\0"..., 512) = 512 fstat64(3, {st_mode=S_IFREG|0644, st_size=9624, ...}) = 0 mmap2(NULL, 12588, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0xb7ede000 mmap2(0xb7ee0000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1000) = 0xb7ee0000 close(3) = 0 openat(AT_FDCWD, "/lib/libpthread.so.0", O_RDONLY|O_CLOEXEC) = 3 read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0pP\0\0004\0\0\0"..., 512) = 512 fstat64(3, {st_mode=S_IFREG|0755, st_size=139348, ...}) = 0 mmap2(NULL, 123484, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0xb7ebf000 mmap2(0xb7eda000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1a000) = 0xb7eda000 mmap2(0xb7edc000, 4700, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0xb7edc000 close(3) = 0 openat(AT_FDCWD, "/lib/libc.so.6", O_RDONLY|O_CLOEXEC) = 3 read(3, "\177ELF\1\1\1\3\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0@\211\1\0004\0\0\0"..., 512) = 512 fstat64(3, {st_mode=S_IFREG|0755, st_size=2114944, ...}) = 0 mmap2(NULL, 1935900, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0xb7ce6000 mmap2(0xb7eb9000, 12288, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1d2000) = 0xb7eb9000 mmap2(0xb7ebc000, 10780, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0xb7ebc000 close(3) = 0 mmap2(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb7ce4000 set_thread_area({entry_number:-1, base_addr:0xb7ce4700, limit:1048575, seg_32bit:1, contents:0, read_exec_only:0, limit_in_pages:1, seg_not_present:0, useable:1}) = 0 (entry_number:6) mprotect(0xb7eb9000, 8192, PROT_READ) = 0 mprotect(0xb7eda000, 4096, PROT_READ) = 0 mprotect(0xb7ee0000, 4096, PROT_READ) = 0 mprotect(0x45c000, 40960, PROT_READ|PROT_WRITE) = 0 mprotect(0x45c000, 40960, PROT_READ|PROT_EXEC) = 0 mprotect(0x466000, 4096, PROT_READ) = 0 mprotect(0xb7f23000, 4096, PROT_READ) = 0 munmap(0xb7ee2000, 80009) = 0 set_tid_address(0xb7ce4768) = 1327 set_robust_list(0xb7ce4770, 12) = 0 rt_sigaction(SIGRTMIN, {sa_handler=0xb7ec3a90, sa_mask=[], sa_flags=SA_SIGINFO}, NULL, 8) = 0 rt_sigaction(SIGRT_1, {sa_handler=0xb7ec3b20, sa_mask=[], sa_flags=SA_RESTART|SA_SIGINFO}, NULL, 8) = 0 rt_sigprocmask(SIG_UNBLOCK, [RTMIN RT_1], NULL, 8) = 0 ugetrlimit(RLIMIT_STACK, {rlim_cur=8192*1024, rlim_max=RLIM_INFINITY}) = 0 uname({sysname="Linux", nodename="192", ...}) = 0 brk(NULL) = 0x2066000 brk(0x2087000) = 0x2087000 brk(0x2088000) = 0x2088000 stat64("/var/run/entrance.pid", {st_mode=S_IFREG|0644, st_size=4, ...}) = 0 getuid32() = 0 openat(AT_FDCWD, "/var/run/entrance.pid", O_RDONLY|O_NONBLOCK|O_LARGEFILE|O_CLOEXEC) = 3 read(3, "1004", 8192) = 4 close(3) = 0 kill(1004, SIG_0) = 0 getpid() = 1327 lstat64("/usr/sbin/entrance", {st_mode=S_IFREG|0755, st_size=67632, ...}) = 0 readlink("/usr", 0xbfe6e3cb, 4096) = -1 EINVAL (Invalid argument) readlink("/usr/sbin", 0xbfe6e3cb, 4096) = -1 EINVAL (Invalid argument) readlink("/usr/sbin/entrance", 0xbfe6e3cb, 4096) = -1 EINVAL (Invalid argument) openat(AT_FDCWD, "/usr/sbin/entrance", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = 3 read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0009:\0\0004\0\0\0"..., 255) = 255 close(3) = 0 openat(AT_FDCWD, "/proc/1004/statm", O_RDONLY|O_NONBLOCK|O_LARGEFILE|O_CLOEXEC) = 3 read(3, "620", 3) = 3 close(3) = 0 stat64("/proc/1004/exe", {st_mode=S_IFREG|0755, st_size=5600, ...}) = 0 exit_group(7) = ? +++ exited with 7 +++

cat /var/run/entrance.pid 1004

ps xa | grep entrance 1004 ? S 0:00 /usr/sbin/entrance 1106 ? S 0:00 /bin/bash --login -c /etc/entrance/Xsession /usr/bin/enlightenment_start > /home/awissu/.entrance_session.log 2>&1 1494 pts/0 SN+ 0:00 grep --color=auto entrance

● display-manager.service - X Display Manager Loaded: loaded (/usr/lib/systemd/system/display-manager.service; enabled; vendor preset: enabled) Active: failed (Result: timeout) since Sat 2017-10-28 20:47:45 +03; 2min 22s ago Process: 1745 ExecStop=/usr/lib/X11/display-manager stop (code=exited, status=0/SUCCESS) Process: 989 ExecStart=/usr/lib/X11/display-manager start (code=exited, status=0/SUCCESS) Main PID: 1018 (code=killed, signal=KILL)

окт 28 20:46:15 192 systemd[1]: Stopping X Display Manager... окт 28 20:46:15 192 display-manager[1745]: Shutting down service entrance..done окт 28 20:47:45 192 systemd[1]: display-manager.service: State 'stop-sigterm' timed out. Killing. окт 28 20:47:45 192 systemd[1]: display-manager.service: Killing process 1004 (entrance) with signal SIGKILL. окт 28 20:47:45 192 systemd[1]: display-manager.service: Main process exited, code=killed, status=9/KILL окт 28 20:47:45 192 systemd[1]: Stopped X Display Manager. окт 28 20:47:45 192 systemd[1]: display-manager.service: Unit entered failed state. окт 28 20:47:45 192 systemd[1]: display-manager.service: Failed with result 'timeout'.

kill -s SIGTERM 1004 CTRL+ALT+F1

ps ax | grep entrance 1004 ? Sl 0:00 /usr/sbin/entrance --nodaemon 1581 ? Ss 0:00 /bin/sh -c export HOME=/var/lib/nobody; export USER=nobody;export LD_LIBRARY_PATH=/usr/lib/entrance;/usr/lib/entrance/entrance_client -d :0.0 -t default -g 65534 -u 65534 1583 ? Sl 0:01 /usr/lib/entrance/entrance_client -d :0.0 -t default -g 65534 -u 65534 1664 tty1 S+ 0:00 grep --color=auto entrance

wltjr commented 6 years ago

Yes its a couple of problems. I cannot restart/stop entrance when logged in. But soon as I log out I am able to stop/restart it. Seems to be something PID related.

I think part of the not stopping on system shutdown/reboot. Is a side effect from a bug fix. Before when you logged out of entrance. It would not restart the greeter/client. You ended up at a black screen and had to restart entrance. Seems in fixing that it caused it to not stop at times. Like when I go to do a system reboot when logged in. It logs out of E, restarts entrance for a bit and then it shutdowns. Likely should not restart in that case.

I need to look further into the handling of signals. It is not stopping due to it handling those internally. Otherwise it would just be killed as normal. The entire code bases is extremely buggy and seems poorly written. Thus issues like this are not surprising. I will see about fixing this before moving forward with other stuff. It has been bugging me for sometime now.....