File ownership problem with make -- WAS: Re: pedal and dynamic events

View: New views
2 Messages — Rating Filter:   Alert me  

Parent Message unknown File ownership problem with make -- WAS: Re: pedal and dynamic events

by wg2002a :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

> Date: Mon, 5 Oct 2009 21:20:59 -0400
> From: "D. Michael McIntyre" <michael.mcintyre@...>
>
> On Monday 05 October 2009, Henry W. Peters wrote:
>
> > It appears that most if not all the RG files
> downloaded from svn are
> > "not owned by" me. Perhaps I need to put a sudo before
> I request the
> > files from svn (I have not used svn much)?
>
> Weird.
>
> You can probably fix this with something like
>
> sudo chown -R $(whoami) rosegarden
>
> although I can't quite imagine how you got into this
> predicament in the first
> place.
>

Change ownership of the whole directory back to the user is the remedy.

"sudo" should not be used with "svn" command.  The problem could be a few things.  Normally when a file is first created, it is own by the user who created it.  However, if

   sudo svn ...

was originally used, all the source files would be own by root.  Sub-sequent use of "svn" by a normal user would only try to update any existing file but will fail because of lack of permission, and if svn continues to check-out new files (not previously existed), those source files would be owned by the normal user.

The reverse would also be true -- originally checkout by normal user, subsequently checkout by "sudo/root".

When "bootstrap.sh", "configure", "make" are run, those will create files, too.  These should also be done by the nomal user, not with sudo/root.

The last step is "make install", which normally put the runtime files under /usr/bin, or /usr/local/bin, these directories are owned by root so "sudo/root" is needed.  Of course, if "configure" was done with "--prefix=/normal/user/directory", then no sudo/root privileges is needed with "make install", because all the files and directories will be installed under /normal/user/directory that is owned by the normal user.  The trick is to set

   export PATH=/normal/user/directory/bin:$PATH
   export LD_LIBRARY_PATH=/normal/user/directory/lib:$LD_LIBRARY_PATH

in order for the normal user to properly load and run the program.  This is also one way to install multiple different instances of a program in different directories.  It starts with the "--prefix" option in the "configure" step for the automake's "configure", "make" sequence.

I have run into this problem before.  I did everything as normal user, then "make install" as root in a separate terminal session.  After tweaking the code somewhat, I did recall the command too quick and get "make install" to run again as root.  So the "make install" goes through the normal "make" to compile the changed source files and create .o files as root, then install those files not a problem at all.  The problem comes in later when I try to "make clean", or "make" as normal user and I can't do anything with those .o or other temporary files which were created by root.  I had to change ownership of everything back to the normal user.

Hope it helps people understand some of the underlying issues of compiling from source.

Jimmy



     

------------------------------------------------------------------------------
Come build with us! The BlackBerry® Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9-12, 2009. Register now!
http://p.sf.net/sfu/devconf
_______________________________________________
Rosegarden-user mailing list
Rosegarden-user@... - use the link below to unsubscribe
https://lists.sourceforge.net/lists/listinfo/rosegarden-user

Re: File ownership problem with make -- WAS: Re: pedal and dynamic events

by D. Michael McIntyre :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Tuesday 06 October 2009, jimmy wrote:
> The last step is "make install", which normally put the runtime files under

The install target for Thorn is supposed to work, but it isn't necessary to
use it.  I haven't installed since I tested the install target itself.  I
normally just run out of the directory where I compiled it.

This means it's totally possible to compile and run Rosegarden Thorn without
ever using sudo or otherwise becoming root at all.
--
D. Michael McIntyre

------------------------------------------------------------------------------
Come build with us! The BlackBerry® Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9-12, 2009. Register now!
http://p.sf.net/sfu/devconf
_______________________________________________
Rosegarden-user mailing list
Rosegarden-user@... - use the link below to unsubscribe
https://lists.sourceforge.net/lists/listinfo/rosegarden-user