On 23 Feb 2005 at 8:42, the.noonings wrote: > > ----- Original Message ----- > From: "the.noonings" <the.noonings[at]verizon.net> > To: <par[at]perl.org> > Sent: 21 February 2005 20:27 > Subject: Works as root but not as user > > > >> > >> Hello, > >> I have a problem running pp on Mandrake Linux as a regular user. Root
Does the problem occur when running pp, or when running the packed executable? > >> runs just fine. In fact as root I can chdir and run > >> PAR0.87/contrib/automated_pp_test/automated_pp_test.pl just fine. No > >> automated_pp_test.pl tests run as a regular user. > >> > >> To simplify things, I created this file hello.pl > >> #!/usr/bin/perl -w > >> print "Hello\n"; > >> > >> And then I > >> pp -o hello hello.pl > >> ./hello > >> And I get > >> No such file or directory at -e line 725. > >> BEGIN failed--compilation aborted at -e line 835. > >> This looks like pp ran OK and then the executable bombed. > >> Again, it works fine as root. It bombs as a regular user. I don't > know > >> what I am missing here. Any help would be appreciated. > >> Thanks > > > >One suggestion: check that the environment variable USER is set. > >If not, PAR will use /tmp/par_SYSTEM for _all_ users. So, if you > >don't own this directory and are not root, tough beans. > > > >Solution: add the line "export USER=myloginname" to your .profile. > > > >I'm probably wrong, put it's one line to eliminate. > > > > > >Ivor. > > I have the solution. I thought I sent this a number of days ago. Sorry > for the delay. I am also here making a PAR suggestion. > > I had installed PAR as root, which is of course necessary. However, > /tmp/par-loginname > installed with owner and group both "root", and lacked write > permissions. I changed group to "users" and chmod 775 > /tmp/par-loginname and now everything works fine. > > Is "users" a universal enough group that PAR should automatically > chgrp -R users /tmp/par-loginname > upon installation? And of course > chmod -R 775 /tmp/par-loginname > > Thanks > I am going to guess that you have an error when running pp itself, and the following may be what is happening. You login initially as some non-root user, say "nooning", and then in order to install PAR, you "su root", but your environment variable still say your user name is "nooning", so the temp dir that is created by parl running during the install is named something like "/tmp/par-nooning" but the real owner is root (755). That dir isn't so much "installed" as left over. Then when you exit root back to being "nooning" again and run pp, "/tmp/par-nooning" still exists, but pp fails for lack of rights to create cache dirs inside of it. If that fits what you are seeing, then the best thing to do is not broaden the rights of the dir to an unpredictable group of users. Who knows what groups different systems have? Either delete the temp dir after installing PAR and let it be re-created during pp/executable, or set PAR_GLOBAL_CLEAN=1 while you install PAR and it will be auto deleted. Perhaps the installation process should automatically set PAR_GLOBAL_CLEAN=1 and then set it back to its former value? Alan
