Hi, I've met the same problem and later came up with solution.
So here is the problem: *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()* *print "result %d" %(result)* * * *if (result==0):* * print "RUN"* * 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.* 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) 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); ====================================================================== ______________________________________________________________________ Federico, Did you see Hiram's comment that he sent you on 5/23? "Check to see if you have a system called SElinux installed and functioning. This is "Security Enhanced linux" and can prevent any number of things from functioning: http://en.wikipedia.org/wiki/SElinux --Hiram" - Greg On 5/30/11 6:11 AM, Federico De Masi wrote: >* HI again Greg,*>* thanks for your reply.*>* Unfortunately /tmp/ has all the >proper permissions. That would have been*>* the easiest fix. But would have >also made sense if the system would not*>* accept any custom track.*>**>* We >think that the issue has to do with the "pipeline input buffer short*>* write >65536, expected 925909, referer: h" error I see on my error-log.*>* That can >only be relative to the gz -> bed pipe created to write into mySQL.*>**>* >Since it seem that it is not possible to change that buffer size (at the*>* >kernel level), is there any suggestions you would (or anyone out there)*>* >have?*>**>* To make things clear:*>* - gz is functioning and recognised by >apache2 as a "compressed extension".*>* - I am running Suse virtual server >with a 2.6.34-12-desktop kernel.*>* - uncompressed bed file is happily >loaded*>* - gz version of same file is not*>**>* Thanks a lot!*>**>* >Fred*>**>* PS: heeeeeeeeeeelp!!!!*>**>* On 19/05/2011 22:58, Greg Roe >wrote:*>>* Hi Federico,*>>**>>* I sent this over to one of our mirror experts >who had this to say:*>>**>>* "These are very odd error messages. When we see a >compressed file,*>>* we use the command 'gzip' (for .gz files) to uncompress >the incoming*>>* data in a unix pipeline command. This could cause the >creation*>>* of a pipe file handle in the /tmp/ directory which should be >writable*>>* via the Apache process, but maybe they have Apache locked down so >it*>>* can not do that. They may need to check permissions on the /tmp/*>>* >directory (which should always allow all permissions for any process)*>>* or >they need to check their Apache configuration to see if it has*>>* some >limitation on running unix pipeline commands."*>>**>>* If you make these >checks and still have no luck, just let us know:*>>* genome at soe.ucsc.edu ><https://lists.soe.ucsc.edu/mailman/listinfo/genome>*>>**>>* -*>>* Greg >Roe*>>* UCSC Genome Bioinformatics Group*>>**>>**>>* On 5/9/11 9:17 AM, >Federico De Masi wrote:*>>>* Dear UCSC devs and users,*>>>**>>>* Before I can >deploy my in-house version of the UCSC Browser, I need to*>>>* tweak the last >bit, ie: customTracks.*>>>**>>>* So far, it works a charm when using non >compressed files. They load,*>>>* show up etc etc. As soon as I try to upload >a .gz track, all hell breaks*>>>* lose.*>>>* I get:*>>>**>>>* - Operation not >permitted error from setpgid(8638, 8637)*>>>**>>>* and*>>>**>>>* - Can't start >query:*>>>* select genome from dbDb where name = 'syboss_hg19'*>>>* - mySQL >error 2006: MySQL server has gone away*>>>**>>>**>>>* I am pretty sure it has >to do with the decompression of the gz file, but*>>>* I give up. I tried many >things, but can't find a solution.*>>>**>>>* Please, help meeeeee :)* -- Sincerely yours Andrey
_______________________________________________ Genome maillist - [email protected] https://lists.soe.ucsc.edu/mailman/listinfo/genome
