Here is the solution: I've came up with a patch for the pipeline.c at /kent/src/lib. I've tested it on genome browser v262, under SUSE Enterprise 11 (Linux 2.6.32.54-0.3-default #1 SMP 2012-01-27 17:38:56 +0100 x86_64 x86_64 x86_64 GNU/Linux). I didn't change the logic of pipiline.c, I've found by google that setpgid should be called at parent process also but genome browser didn't do this so I've added this call to the parent setpgid(0,0). May be it is not bad idea to include this patch in genome browser beta?
Please find .diff file attached. Andrey. ====================================================================== --- ./pipeline.c.orig 2012-03-14 16:06:42.000000000 -0400 +++ ./pipeline.c 2012-03-14 17:00:13.000000000 -0400 @@ -1,5 +1,6 @@ /* pipeline.c - create a process pipeline that can be used for reading or * writing */ +/* Patched 03/2012 by Andrey Kartashov [email protected]. Issue setpgid() operation not permitted. */ #include "pipeline.h" #include "common.h" #include "sqlNum.h" @@ -294,9 +295,9 @@ if (signal(SIGPIPE, SIG_IGN) == SIG_ERR) errnoAbort("error ignoring SIGPIPE"); // set process group to first subprocess id, which might be us -pid_t pgid = (pl->pgid < 0) ? getpid() : pl->pgid; -if (setpgid(getpid(), pgid) != 0) - errnoAbort("error from setpgid(%d, %d)", getpid(), pgid); +//pid_t pgid = (pl->pgid < 0) ? getpid() : pl->pgid; +if (setpgid(getpid(), getppid()) != 0) + errnoAbort("error from setpgid(%d, %d)", getpid(), getppid()); if (otherEndBuf != NULL) plProcMemWrite(proc, procStdoutFd, stderrFd, otherEndBuf, otherEndBufSize); @@ -328,8 +329,10 @@ /* parent only */ if (pl->pgid < 0) + { + setpgid(0,0); pl->pgid = proc->pid; // first process defines pgid - + } /* record that we did this */ plProcStateTrans(proc, procStateRun); pl->numRunning++; @@ -624,7 +627,8 @@ /* wait on one process to finish */ { int status; -pid_t pid = waitpid(-pl->pgid, &status, 0); +//pid_t pid = waitpid(-pl->pgid, &status, 0); +pid_t pid = waitpid(0, &status, 0); if (pid < 0) errnoAbort("waitpid failed"); plProcWait(pipelineFindProc(pl, pid), status); ====================================================================== Hi, I've meet an issue with uploading wig, but not bedgraph files to UCSC genome browser on some systems ( https://lists.soe.ucsc.edu/pipermail/genome/2011-May/026009.html). When I upload .wig, .gz or any other files that require pipeline I get an error that operation is not permitted in function setpgid(...). My configuration is SUSE linux + apache2 server. After investigation of problem I've figured out the function in genome browser library that does not work correctly; exact function is execProcChild(...) from pipeline.c, the position where error appears is "if ( setpgid(getpid(), pgid) != 0)" this system call does not work. I've isolated this problem and wrote a simple python script: ___________________________________________________ #!/usr/bin/python import os print "Content-type: text/html\r\n" gid=os.getpid() result=os.fork() if (result==0): os.setpgid(os.getpid(), gid) os.execl("/bin/gzip","-h") os.wait() ___________________________________________________ which reproduces the same error ([Errno 1] Operation not permitted). Interestingly, this script executes without errors in shell under the same user as Apache. At this moment I didn't find a solution and can't exactly tell where the problem resides: in OS settings or apache. On Wed, Mar 14, 2012 at 4:40 PM, Hiram Clawson <[email protected]> wrote: > Reply to one of these emails so that it has the [email protected] > address in the email with this same subject line. > > > Andrey Kartashov wrote: > >> Hi, >> I found a solution how I can post for that thread ? >> >> On Fri, Mar 9, 2012 at 1:07 PM, Hiram Clawson <[email protected]> wrote: >> >> Good Morning Andrey: >>> >>> We don't know what the resolution is for this situation. >>> As you noticed in the mentioned mail list thread, it is >>> often a situation of the enhanced security system in place. >>> If it is not exactly that, I suspect there are configurations >>> in the apache system that are preventing these functions >>> from operating correctly. If you do find a solution to this, >>> please respond to the mail list to aid future users. >>> >>> --Hiram >>> >>> ----- Original Message ----- >>> From: "Andrey Kartashov" <[email protected]> >>> To: [email protected] >>> Sent: Friday, March 9, 2012 6:23:13 AM >>> Subject: [Genome] CustomTrack upload error (pipeline) >>> >>> Hi, >>> I have problem with upload wig or gzipped files (bed uncompressed files >>> uploaded well). I've found this thread >>> https://lists.soe.ucsc.edu/**pipermail/genome/2011-May/**026009.html<https://lists.soe.ucsc.edu/pipermail/genome/2011-May/026009.html>and >>> checked >>> everything and problem still exist. The exact error message is: " Error >>> in 'chr1.wig.gz' - Operation not permitted error from setpgid (3281, >>> 3280); File >>> 'chr1.wig.gz' - process exited with 100: "[mem]" in pipeline "gzip -dc"". >>> Also I've replaced original /bin/gzip by shell which just make "echo >>> "123">>/tmp/gzipGENOME" and file does not appear. I'm digging, a little >>> pipeline.c but for me, as a beginner in genome browser, it >>> really complected. >>> I've tried set SETUID bit, to run hgCustom program as root but it didn't >>> help. >>> System is: SUSE Linux Enterprise Server 11 (x86_64) >>> uname -a: Linux bmigbweb 2.6.32.46-0.3-default #1 SMP 2011-09-29 17:49:31 >>> +0200 x86_64 x86_64 x86_64 GNU/Linux >>> >>> Do you have any ideas what it can be? >>> -- >>> Sincerely yours >>> Andrey >>> >>> >> >> >> > -- Sincerely yours Andrey _______________________________________________ Genome maillist - [email protected] https://lists.soe.ucsc.edu/mailman/listinfo/genome
