.svn directory missing in new repository on Subversion 1.8 on centOS 6.x - linux

I've done a fresh install of Subversion 1.8.10 on my CentOS server and created first repository.
svnadmin create --fs-type fsfs /var/www/svn/testrepo
cd /var/www/svn/testrepo
$ mkdir trunk
$ mkdir branches
$ mkdir tags
$ svn add *
svn: E155007: '/var/www/svn/testrepo' is not a working copy
on further digging the error i realized that .svn directory is missing. Following the listing of my testrepo directory.
drwxrwxr-x 9 dwac dwac 4096 Dec 20 05:06 .
drwxr-xr-x 11 dwac dwac 4096 Dec 20 05:05 ..
drwxrwxr-x 2 dwac dwac 4096 Dec 20 05:06 branches
drwxrwxr-x 2 dwac dwac 4096 Dec 20 05:05 conf
drwxrwsr-x 6 dwac dwac 4096 Dec 20 05:05 db
-r--r--r-- 1 dwac dwac 2 Dec 20 05:05 format
drwxrwxr-x 2 dwac dwac 4096 Dec 20 05:05 hooks
drwxrwxr-x 2 dwac dwac 4096 Dec 20 05:05 locks
-rw-rw-r-- 1 dwac dwac 246 Dec 20 05:05 README.txt
drwxrwxr-x 2 dwac dwac 4096 Dec 20 05:06 tags
drwxrwxr-x 2 dwac dwac 4096 Dec 20 05:06 trunk
Is there something that I'm missing ??
I've tried all options I could think of / find but no luck . Any help will be highly appreciated.

After you create your repository you need to checkout first in different directory. This directory will be your working copy.
First create repository
svnadmin create --fs-type fsfs /var/www/svn/testrepo
then your working copy
cd $HOME
mkdir svnWorkingCopy
cd svnWorkingCopy
svn checkout file:///var/www/svn/testrepo .
mkdir trunk
mkdir branches
mkdir tags
svn add *
svn commit

Related

Change directory ownership in linux

The uploads directory is not writeable by a browser because of ownership.
-rw-rw-r-- 1 masud masud 28 Mar 23 15:46 index.php
drwxrwxr-x 4 masud masud 4096 Mar 23 15:46 languages
drwxrwxr-x 11 masud masud 4096 Mar 23 16:16 plugins
drwxrwxr-x 3 masud masud 4096 Mar 23 16:11 themes
drwxrwxr-x 4 masud masud 4096 Mar 7 13:14 uploads
I want to change the ownership of the uploads directory.
it will change the ownership of that directory
sudo chmod -R 0777 directory_name

Linux folder permissions not inherited with symfony new project

I'm setting up a new web server, and getting some issues with folder perms when generating a new symfony project.
All my websites are located into /var/www
My symfony installer is located in /usr/local/bin/symfony
And this my my symfony installer ownership and perms:
-rwxr-xr-x 1 root staff 233229 Oct 11 00:56 symfony
Here is what I did on my website main folder :
chown :www-data /var/www/
chmod g+s /var/www/
setfacl u:my-user:rwx,d:u:my-user:rwx,g:www-data:rwx,d:g:www-data:rwx /var/www
When uploading file, everything is fine, group and perms are inherited correctly.
The problem is when I generate a new symfony project with the following command while located into /var/www:
symfony new my_project
This is the project folder perms:
drwxr-xr-x 9 501 root 4096 Oct 15 00:20 test
And the perms inside the project folder:
drwxr-xr-x 4 501 staff 4096 Oct 15 00:20 app
drwxr-xr-x 2 501 staff 4096 Oct 15 00:20 bin
-rw-rw-rw- 1 root root 2032 Oct 15 00:20 composer.json
-rw-rw-rw- 1 root root 74614 Oct 15 00:20 composer.lock
-rw-rw-rw- 1 root root 248 Oct 15 00:20 .gitignore
-rw-r--r-- 1 501 staff 978 Oct 3 21:12 phpunit.xml.dist
-rw-rw-rw- 1 root root 68 Oct 15 00:20 README.md
drwxr-xr-x 3 501 staff 4096 Oct 15 00:20 src
drwxr-xr-x 3 501 staff 4096 Oct 15 00:20 tests
drwxr-xr-x 5 501 staff 4096 Oct 15 00:20 var
drwxr-xr-x 15 501 root 4096 Oct 15 00:20 vendor
drwxr-xr-x 3 501 staff 4096 Oct 3 21:14 web
ACL aren't inherited at all.
After a lookup, 501 seems to be the daemon user.
How can I fix this issue?
You need to use recursive Preciel.
Try:
setfacl -R ...
Also the commands you used sets the permission for /var/www, but nothing underneath that!

Remove folder with special character on it

I accidentally created some folders with special characters. I already read the other posts in stackoverflow, but don't work. When I type the ls -la command I see
root#mycomputer:/myfolder# ls -la
drwxr-xr-x 3 root root 4096 feb 6 17:53 ,
drwxr-xr-x 70 root root 4096 feb 11 10:27 .
drwxr-xr-x 6 root root 4096 feb 11 09:16 ..
drwxr-xr-x 7 root root 4096 feb 9 22:45 (
drwxr-xr-x 3 root root 4096 feb 2 22:01 [
drwxr-xr-x 3 root root 4096 feb 6 08:11 $
drwxr-xr-x 3 root root 4096 feb 2 23:15 \
drwxr-xr-x 4 root root 4096 feb 8 10:34 &
drwxr-xr-x 5 root root 4096 feb 8 09:43 #
drwxr-xr-x 3 root root 4096 feb 6 14:41 +
drwxr-xr-x 6 root root 4096 feb 6 09:15 ?
drwxr-xr-x 4 root root 4096 feb 6 04:07 ?
drwxr-xr-x 5 root root 4096 feb 6 01:13 ?
drwxr-xr-x 3 root root 4096 feb 6 02:25 ?
drwxr-xr-x 5 root root 4096 feb 3 12:25 ?
drwxr-xr-x 4 root root 4096 feb 5 23:18 ?
I can't do anything with the ones pointed as question marks
I tried to type the command mv and then press tab and this is what I get
root#mycomputer:/myfolder# mv
,/ ▒/ 7/ h/
(/ ▒/ 8/ i/
[/ ▒/ 9/ j/
$/ ▒/
\/ ▒/
So apparently I can't rename them in order to delete them.
Any ideas?
What finally worked for me was one of the answers I found in this question:
rm all files except some
rm !(textfile.txt|backup.tar.gz|script.php|database.sql|info.txt)
If you don't need the other directories, you can just
rmdir ?
Or, use character class (supported e.g. in bash):
rmdir [^789hij] # removes all one-character directories except for 7, 9, etc.
You can also try mc or some other file manager.

CHROOT : Allowing outside access to chrooted users with mount bind

I have a chrooted user(username: clientdev) which I have jailed inside their home directory. This chroot directory is /home/clientdev/ which is owned by root.
Now I need this clientdev user to be able access the tomcat web application folder which is residing under /mnt/datadrive/tomcat/webapps.
What I have done is :
chroot the user with a public key of their own to the home
directory.
Create a folder under /home/clientdev called tomcat_ROOT and gave
the ownership to clientdev.
Now when I run the command :
mount -bind /mnn/datadrive/tomcat/webapps /home/clientdev/tomcat_ROOT
The folder disappears from the directory listing inside /home/clientdev if I login with clientdev. My root user can see it but now the desired user.
Any help would be greatly appreciated
Thanks in advance,
Peter
Output of ls -l /home/clientdev/tomcat_ROOT:
drwxr-xr-x. 6 root root 4096 Apr 11 15:07 .
drwxrwxr-x. 12 root root 4096 Apr 11 15:07 ..
drwxr-xr-x. 3 root root 4096 Apr 9 22:10 webapp1
drwxr-xr-x. 4 root root 4096 Mar 18 18:43 webapp2
drwxr-xr-x. 3 root root 4096 Apr 9 22:11 webapp3
drwxrwxr-x. 10 root root 4096 Apr 11 15:20 ROOT
Output of ls -l /home/clientdev/:
drwx------. 4 clientdev clientdev 4096 Apr 10 21:36 .
drwxr-xr-x. 7 root root 4096 Apr 10 22:07 ..
-rw-------. 1 clientdev clientdev 664 Apr 10 21:43 .bash_history
-rw-r--r--. 1 clientdev clientdev 18 Apr 23 2012 .bash_logout
-rw-r--r--. 1 clientdev clientdev 176 Apr 23 2012 .bash_profile
-rw-r--r--. 1 clientdev clientdev 124 Apr 23 2012 .bashrc
drwx------. 2 clientdev clientdev 4096 Apr 10 19:20 .ssh
drwxr-xr-x. 2 clientdev clientdev 4096 Apr 10 21:34 tomcat_ROOT

strange behaviour with .git folder

I have clone a git directory as user bob on a remote machine (after having forwarded the local key). When I clone the repo, the repo appears fine and everything shows up including a .git folder.
Now, I want to copy this folder over to another location which happens to be a link to a folder. When I do a cp -r /tmp/tmp.kk3a8xemvr/* /home/staging/myapp, everything gets copied, but not .git folder. When I explicitly call out the .git folder in the cp command, it gets copied. I also noticed the the .gitignore did not get copied either.
Another strange behavior is when I go to /home/staging/myapp, and I do a rm -rf ./*, the .git folder does not get deleted unless I call it out specifically.
How come simple unix commands behave differently for the .git directory? There is nothing special about its permissions. Could it be that the period in front of the file causes some problems?
drwxr-xr-x 8 staging staging 4096 Oct 12 03:42 .git/
My OS is Ubuntu 12.04 LTS.
Linux myapp 3.2.0-54-virtual #82-Ubuntu SMP Tue Sep 10 20:31:18 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux
EDIT
Provide more information for Jonathan: I have update the foldernames to match with the commands below:
# cd /tmp/tmp.kk3a8xemvr <- source, everything is good here.
root#myapp1:/tmp/tmp.kk3a8xemvr; ls -la
total 48
drwx------ 9 bob bob 4096 Oct 13 03:08 .
drwxrwxrwt 7 root root 4096 Oct 13 14:55 ..
drwxrwxr-x 3 bob bob 4096 Oct 13 03:08 ansible
drwxrwxr-x 4 bob bob 4096 Oct 13 03:08 backend
drwxrwxr-x 3 bob bob 4096 Oct 13 03:08 clientdb
drwxrwxr-x 15 bob bob 4096 Oct 13 03:08 dapi
drwxrwxr-x 3 bob bob 4096 Oct 13 03:08 docs
drwxrwxr-x 3 bob bob 4096 Oct 13 03:08 fabfile
drwxrwxr-x 8 bob bob 4096 Oct 13 03:08 .git
-rw-rw-r-- 1 bob bob 44 Oct 13 03:08 .gitignore
-rw-rw-r-- 1 bob bob 68 Oct 13 03:08 README.md
-rw-rw-r-- 1 bob bob 450 Oct 13 03:08 requirements.txt
# cd /home/staging; ls
lrwxrwxrwx 1 staging staging 62 Oct 13 03:06 myapp -> /srv/www/staging.myapp.com/public_html/myapp/
# command I use:
sudo cp -r /tmp/tmp.kk3a8xemvr/* /home/staging/myapp
# cd /home/staging/myapp; ls -la; # <- this is the intended destination;
# .git and .gitignore are missing after applying the cp command.
drwxr-xr-x 9 staging staging 4096 Oct 13 14:59 .
drwxr-xr-x 3 staging staging 4096 Oct 13 03:06 ..
drwxr-xr-x 3 staging staging 4096 Oct 13 03:08 ansible
drwxr-xr-x 4 staging staging 4096 Oct 13 03:08 backend
drwxrwxr-x 2 staging staging 4096 Oct 13 14:59 clientdb
drwxr-xr-x 15 staging staging 4096 Oct 13 03:09 dapi
drwxr-xr-x 3 staging staging 4096 Oct 13 03:08 docs
drwxr-xr-x 3 staging staging 4096 Oct 13 03:08 fabfile
-rw-r--r-- 1 staging staging 68 Oct 13 03:08 README.md
-rw-r--r-- 1 staging staging 450 Oct 13 03:08 requirements.txt
If you do:
sudo cp -r /tmp/tmp.kk3a8xemvr/* /home/staging/myapp
the shell expands the * into 'all file or directory names that do not start with .' (thus omitting .git, etc).
If you do:
sudo cp -r /tmp/tmp.kk3a8xemvr /home/staging/myapp
you will get a subdirectory tmp.kk3a8xemvr created in /home/staging/myapp, which is not what you want, I think.
However, if you do:
sudo cp -r /tmp/tmp.kk3a8xemvr/. /home/staging/myapp
you should find you get everything copied where you want it.

Resources