[Bug 223602] New: yast starts automout attached to the controlling tty
https://bugzilla.novell.com/show_bug.cgi?id=223602 Summary: yast starts automout attached to the controlling tty Product: openSUSE 10.2 Version: RC 1 Platform: Other OS/Version: Other Status: NEW Severity: Normal Priority: P5 - None Component: YaST2 AssignedTo: bnc-team-screening@forge.provo.novell.com ReportedBy: jw@novell.com QAContact: jsrain@novell.com automount has several filedescriptors open to the controlling terminal, when started by yast. rcautofs starts the daemon properly detached. login as root via ssh # tty /dev/pts/4 # yast -> Network Services -> NIS Client If 'Start Automounter' is enabled, disable it -> Finish and start again. (*) Use NIS [if not already enabled] [x] Start Automounter -> Finish. # lsof /dev/pts/4 | grep auto automount 24695 root 4r CHR 136,4 6 /dev/pts/4 automount 24695 root 5w CHR 136,4 6 /dev/pts/4 automount 24704 root 4r CHR 136,4 6 /dev/pts/4 automount 24704 root 5w CHR 136,4 6 /dev/pts/4 # exit The ssh connection hangs until we do 'rcautofs restart' from another shell. Strace shows me 26236 execve("/usr/sbin/automount", ["/usr/sbin/automount", "/mounts", "yp", "auto.mounts"], [/* 71 vars */]) = 0 I see close(3) and close(6) before, but apparently 4 and 5 are left over from y2base: 26615 execve("/usr/lib/YaST2/bin/y2base", ["/usr/lib/YaST2/bin/y2base", "menu", "ncurses", "--nothreads"] .. 26615 readlink("/proc/self/fd/0", "/dev/pts/4", 4095) = 10 26615 uname({sys="Linux", node="testy-jw", ...}) = 0 26615 stat64("/var/log/YaST2/y2log", {st_mode=S_IFREG|0644, st_size=2775377, ..}) = 0 26615 open("/var/log/YaST2/y2log", O_WRONLY|O_APPEND|O_CREAT, 0666) = 4 26615 fstat64(4, {st_mode=S_IFREG|0644, st_size=2775377, ...}) = 0 26615 mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb7ed2000 26615 fstat64(4, {st_mode=S_IFREG|0644, st_size=2775377, ...}) = 0 26615 _llseek(4, 2775377, [2775377], SEEK_SET) = 0 26615 time(NULL) = 1164370372 26615 stat64("/etc/localtime", {st_mode=S_IFREG|0644, st_size=837, ...}) = 0 26615 write(4, "2006-11-24 13:12:52 <1> testy-jw"..., 92) = 92 26615 close(4) = 0 26615 munmap(0xb7ed2000, 4096) = 0 26615 open("/dev/pts/4", O_RDONLY|O_LARGEFILE) = 4 26615 open("/dev/pts/4", O_WRONLY|O_CREAT|O_TRUNC|O_LARGEFILE, 0666) = 5 Please add a loop to close all filedescriptors above 2 before exec'ing any daemons from yast. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is.
https://bugzilla.novell.com/show_bug.cgi?id=223602 mhorvath@novell.com changed: What |Removed |Added ---------------------------------------------------------------------------- AssignedTo|bnc-team- |jsuchome@novell.com |screening@forge.provo.novell| |.com | -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is.
https://bugzilla.novell.com/show_bug.cgi?id=223602 jsuchome@novell.com changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |mkoenig@novell.com Status|NEW |NEEDINFO Info Provider| |jw@novell.com ------- Comment #1 from jsuchome@novell.com 2006-11-27 03:37 MST ------- YaST stops the service with '/etc/init.d/autofs stop' and starts it with '/etc/init.d/autofs start'. What's wrong with this? Isn't the problem in the script itself? Juergen, could you test to run just 'yast nis', without using ncurses-menu? It might of unfinished yast when we return to menu. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is.
https://bugzilla.novell.com/show_bug.cgi?id=223602 jw@novell.com changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEEDINFO |ASSIGNED Info Provider|jw@novell.com | ------- Comment #2 from jw@novell.com 2006-11-27 06:10 MST ------- The GUI-version of yast works fine. The issue only happens with ncurses-yast. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is.
https://bugzilla.novell.com/show_bug.cgi?id=223602 jsuchome@novell.com changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |NEEDINFO Info Provider| |jw@novell.com ------- Comment #3 from jsuchome@novell.com 2006-11-27 06:17 MST ------- There is a difference in calling the module from ncurses menu ("start 'yast', find Network Services, launch NIS client") and running the specific module in ncurses mode directly. According to your report, you have used the menu way (["/usr/lib/YaST2/bin/y2base", "menu", "ncurses", "--nothreads"]). I'm asking you to run yast2-nis-client module in ncurses mode (not in Qt) direcly, not using the menu. Do it with 'yast nis' or '/usr/lib/YaST2/bin/y2base nis ncurses' call. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is.
https://bugzilla.novell.com/show_bug.cgi?id=223602 jw@novell.com changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEEDINFO |ASSIGNED Info Provider|jw@novell.com | ------- Comment #4 from jw@novell.com 2006-11-27 06:52 MST ------- Ah, sorry. I misunderstood. yast nis, /usr/lib/YaST2/bin/y2base nis ncurses, and calling the module from the ncurses menue all have the same issue: automount remains attached to the tty. Nothing wrong with using '/etc/init.d/autofs start', but these scripts cannot care about left over fildescriptors. The caller is responsible for that. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is.
https://bugzilla.novell.com/show_bug.cgi?id=223602 mvidner@novell.com changed: What |Removed |Added ---------------------------------------------------------------------------- AssignedTo|jsuchome@novell.com |mvidner@novell.com Status|NEEDINFO |ASSIGNED Info Provider|mvidner@novell.com | Summary|yast starts automout |yast starts automout attached to the controlling |attached to the controlling |tty (y2base should close fds before exec) |tty | ------- Comment #7 from mvidner@novell.com 2006-11-27 09:58 MST ------- I ran Y2DEBUG=1 strace -f -s200 -ostrace-ncurses2 /usr/lib/YaST2/bin/y2base nis ncurses and searched for dev/pts in strace-ncurses2. YaST opens the two file descriptors mentioned at end of comment 0 between these two log lines: [ui-ncurses] NCurses.cc(init):215 mytty: /dev/pts/0 [ui-ncurses] NCurses.cc(init):235 isatty(stderr)yes By looking at void NCurses::init() I cannot tell whether the fds need to stay open or not. Oh, now I get the point - between forking and execing the init script, we should close the unneeded fds. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is.
https://bugzilla.novell.com/show_bug.cgi?id=223602#c8 --- Comment #8 from Martin Vidner <mvidner@novell.com> 2007-09-13 05:45:48 MST --- Created an attachment (id=163839) --> (https://bugzilla.novell.com/attachment.cgi?id=163839) closefds.patch -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=223602#c9 Martin Vidner <mvidner@novell.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Component|YaST2 |YaST2 Product|openSUSE 10.2 |openSUSE 11.0 Version|RC 1 |unspecified --- Comment #9 from Martin Vidner <mvidner@novell.com> 2007-09-13 05:51:01 MST --- Ugh, I missed the time to fix this, so the patch will have to wait until after 10.3 because we only fix red bugs now. Originally reported on 10.2, moving to 11.0 -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=223602#c10 Martin Vidner <mvidner@novell.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |schwab@novell.com --- Comment #10 from Martin Vidner <mvidner@novell.com> 2007-09-13 05:51:46 MST --- *** Bug 270306 has been marked as a duplicate of this bug. *** https://bugzilla.novell.com/show_bug.cgi?id=270306 -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=223602#c11 Martin Vidner <mvidner@novell.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |RESOLVED Resolution| |FIXED --- Comment #11 from Martin Vidner <mvidner@novell.com> 2007-10-02 09:29:13 MST --- The fix is in yast2-core-2.16.0. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
participants (1)
-
bugzilla_noreply@novell.com