Goal: Get Poetry working in my Anaconda3 venvs.
I'm using Anaconda3, via. Git Bash in PyCharm.
I installed Poetry using:
conda install -c conda-forge poetry
Location:
C:\Users\dabell\Anaconda3\Lib\site-packages\poetry
C:\Users\dabell\Anaconda3\Scripts\poetry.exe
$ ls -alrth
total 376K
-rw-r--r-- 3 HDS+dabell 4096 81 Mar 31 15:37 __init__.py
-rw-r--r-- 3 HDS+dabell 4096 1.4K Apr 20 06:53 poetry.py
-rw-r--r-- 3 HDS+dabell 4096 506 Apr 20 06:53 locations.py
-rw-r--r-- 3 HDS+dabell 4096 5.3K Apr 20 06:53 factory.py
-rw-r--r-- 3 HDS+dabell 4096 99 Apr 20 06:53 exceptions.py
-rw-r--r-- 3 HDS+dabell 4096 23 Apr 20 06:53 __version__.py
-rw-r--r-- 3 HDS+dabell 4096 92 Apr 20 06:53 __main__.py
drwxr-xr-x 1 HDS+dabell 4096 0 Jun 16 15:30 core/
drwxr-xr-x 1 HDS+dabell 4096 0 Jun 16 15:30 __pycache__/
drwxr-xr-x 1 HDS+dabell 4096 0 Jun 16 15:30 _vendor/
drwxr-xr-x 1 HDS+dabell 4096 0 Jun 16 15:30 config/
drwxr-xr-x 1 HDS+dabell 4096 0 Jun 16 15:30 console/
drwxr-xr-x 1 HDS+dabell 4096 0 Jun 16 15:30 inspection/
drwxr-xr-x 1 HDS+dabell 4096 0 Jun 16 15:30 installation/
drwxr-xr-x 1 HDS+dabell 4096 0 Jun 16 15:30 io/
drwxr-xr-x 1 HDS+dabell 4096 0 Jun 16 15:30 json/
drwxr-xr-x 1 HDS+dabell 4096 0 Jun 16 15:30 layouts/
drwxr-xr-x 1 HDS+dabell 4096 0 Jun 16 15:30 masonry/
drwxr-xr-x 1 HDS+dabell 4096 0 Jun 16 15:30 mixology/
drwxr-xr-x 1 HDS+dabell 4096 0 Jun 16 15:30 packages/
drwxr-xr-x 1 HDS+dabell 4096 0 Jun 16 15:30 ./
drwxr-xr-x 1 HDS+dabell 4096 0 Jun 16 15:30 publishing/
drwxr-xr-x 1 HDS+dabell 4096 0 Jun 16 15:30 puzzle/
drwxr-xr-x 1 HDS+dabell 4096 0 Jun 16 15:30 repositories/
drwxr-xr-x 1 HDS+dabell 4096 0 Jun 16 15:30 utils/
drwxr-xr-x 1 HDS+dabell 4096 0 Jun 16 15:30 version/
drwxr-xr-x 1 HDS+dabell 4096 0 Jun 16 15:30 ../
However, in (base) or in any (<venv>) - when I run:
$ poetry install pandas
bash: poetry: command not found
python -m poetry install pandas:
C:\Users\dabell\Anaconda3\envs\sdg\python.exe: No module named poetry
I added it to .bashrc, and still get the above error:
$ export PATH="$HOME/.poetry/bin:$PATH"
or
$ export PATH=C:/Users/dabell/Anaconda3/Lib/site-packages/poetry:$PATH
$ poetry install pandas
bash: poetry: command not found
$ winpty poetry install pandas
winpty: error: cannot start 'poetry': Not found in PATH
$ $HOME/.poetry/bin
bash: /c/Users/dabell/.poetry/bin: No such file or directory
HDS+dabell#PF2DCSXD MINGW64 ~/Documents/GitHub/lumada-catalog/synthetic-data-gen/sdg (daniel_sims)
$ export PATH=/C/Users/dabell/Anaconda3/Lib/site-packages/poetry:$PATH
HDS+dabell#PF2DCSXD MINGW64 ~/Documents/GitHub/lumada-catalog/synthetic-data-gen/sdg (daniel_sims)
$ poetry install pandas
bash: poetry: command not found
$ echo $PATH
/C/Users/dabell/Anaconda3/Lib/site-packages/poetry:/c/Users/dabell/bin:/mingw64/bin:/usr/local/bin:/usr/bin:/bin:/mingw64/bin:/usr/bin:/c/Users/dabell/bin:/c/Users/dabell/Anaconda3/envs/sdg:/c/Users/dabell/Anaconda3/e
nvs/sdg/Library/mingw-w64/bin:/c/Users/dabell/Anaconda3/envs/sdg/Library/usr/bin:/c/Users/dabell/Anaconda3/envs/sdg/Library/bin:/c/Users/dabell/Anaconda3/envs/sdg/Scripts:/c/Users/dabell/Anaconda3/envs/sdg/bin:/c/User
s/dabell/Anaconda3/condabin:/c/Program Files/Common Files/Oracle/Java/javapath:/c/Program Files (x86)/Common Files/Oracle/Java/javapath:/c/WINDOWS/system32:/c/WINDOWS:/c/WINDOWS/System32/Wbem:/c/WINDOWS/System32/Windo
wsPowerShell/v1.0:/c/WINDOWS/System32/OpenSSH:/c/Program Files (x86)/gs/gs9.56.1/bin:/c/Users/dabell/AppData/Local/Programs/Python/Python310:/usr/bin/vendor_perl:/usr/bin/core_perl
Related
MWE
I have a GitHub Actions workflow that recently stopped working without me making changes. The error:
==> ERROR: /etc/makepkg.conf not found.
Aborting...
This is from running # sudo -Eu builder makepkg --printsrcinfo.
Source
Logs
The order of the logs seem to be wrong but it is correct in an earlier log (possibly due to ls -l having a large output).
The source of this error seems to be libmakepkg/util/config.sh.in:
# Source the config file; fail if it is not found
if [[ -r $MAKEPKG_CONF ]]; then
source_safe "$MAKEPKG_CONF"
else
error "$(gettext "%s not found.")" "$MAKEPKG_CONF"
plainerr "$(gettext "Aborting...")"
exit $E_CONFIG_ERROR
fi
I added the following to my entrypoint script:
echo "Writing SRCINFO..."
# Debug
echo "---"
ls -l /
echo "---"
ls -l /etc
echo "---"
sudo -Eu builder cat /etc/makepkg.conf
echo "---"
sudo -Eu builder /bin/bash -c "[[ -r "/etc/makepkg.conf" ]] && echo 1 || echo 0"
echo "---"
sudo -Eu builder makepkg --printsrcinfo > .SRCINFO
The builder user is created in build.sh:
useradd builder -m
echo "builder ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers
I got:
Setting permissions...
Writing SRCINFO...
---
total 52
lrwxrwxrwx 1 root root 7 Feb 1 19:19 bin -> usr/bin
drwxr-xr-x 2 root root 4096 Jan 19 01:32 boot
drwxr-xr-x 5 root root 340 Feb 7 11:58 dev
-rwxr-xr-x 1 root root 836 Feb 7 11:57 entrypoint.sh
drwxr-xr-x 1 root root 4096 Feb 7 11:58 etc
drwxr-xr-x 6 root root 4096 Feb 7 11:58 github
drwxr-xr-x 1 root root 4096 Feb 7 11:57 home
lrwxrwxrwx 1 root root 7 Feb 1 19:19 lib -> usr/lib
lrwxrwxrwx 1 root root 7 Feb 1 19:19 lib64 -> usr/lib
drwxr-xr-x 2 root root 4096 Jan 19 01:32 mnt
drwxr-xr-x 2 root root 4096 Jan 19 01:32 opt
dr-xr-xr-x 159 root root 0 Feb 7 11:58 proc
drwxr-x--- 2 root root 4096 Jan 19 01:32 root
drwxr-xr-x 1 root root 4096 Feb 7 11:58 run
lrwxrwxrwx 1 root root 7 Feb 1 19:19 sbin -> usr/bin
drwxr-xr-x 4 root root 4096 Feb 1 19:19 srv
dr-xr-xr-x 12 root root 0 Feb 7 11:58 sys
drwxrwxrwt 2 root root 4096 Jan 19 01:32 tmp
drwxr-xr-x 1 root root 4096 Feb 7 11:57 usr
drwxr-xr-x 1 root root 4096 Feb 1 19:19 var
---
total 640
-rw-r--r-- 1 root root 0 Jan 19 01:32 arch-release
drwxr-xr-x 3 root root 4096 Feb 1 19:19 audit
-rw-r--r-- 1 root root 28 Dec 20 18:44 bash.bash_logout
-rw-r--r-- 1 root root 618 Dec 20 18:44 bash.bashrc
-rw-r--r-- 1 root root 447 Dec 2 16:02 bindresvport.blacklist
drwxr-xr-x 2 root root 4096 Dec 16 14:38 binfmt.d
drwxr-xr-x 4 root root 4096 Feb 1 19:19 ca-certificates
-rw------- 1 root root 722 Jan 19 01:32 crypttab
drwxr-xr-x 2 root root 4096 Feb 1 19:19 default
drwxr-xr-x 2 root root 4096 Jan 7 19:51 depmod.d
-rw-r--r-- 1 root root 685 Jan 31 20:31 e2scrub.conf
-rw-r--r-- 1 root root 97 Jan 13 22:50 environment
-rw-r--r-- 1 root root 1362 Jan 20 21:31 ethertypes
-rw-r--r-- 1 root root 126 Jan 19 01:32 fstab
-rw-r--r-- 1 root root 2584 Feb 6 00:09 gai.conf
-rw-r--r-- 1 root root 626 Feb 7 11:57 group
-rw-r--r-- 1 root root 610 Jan 31 00:20 group-
-rw------- 1 root root 558 Feb 7 11:57 gshadow
-rw------- 1 root root 546 Jan 31 00:20 gshadow-
-rw-r--r-- 1 root root 73 Jan 19 01:32 host.conf
-rw-r--r-- 1 root root 13 Feb 7 11:58 hostname
-rw-r--r-- 1 root root 174 Feb 7 11:58 hosts
-rw-r--r-- 1 root root 714 Dec 8 17:48 inputrc
drwxr-xr-x 2 root root 4096 Feb 1 19:19 iproute2
drwxr-xr-x 2 root root 4096 Feb 1 19:19 iptables
-rw-r--r-- 1 root root 20 Jan 19 01:32 issue
drwxr-xr-x 3 root root 4096 Feb 1 19:19 kernel
drwxr-xr-x 2 root root 4096 Jul 7 2020 keyutils
-rw-r--r-- 1 root root 369 Jan 14 00:32 krb5.conf
-rw-r--r-- 1 root root 18096 Feb 7 11:57 ld.so.cache
-rw-r--r-- 1 root root 117 Jan 19 01:32 ld.so.conf
drwxr-xr-x 1 root root 4096 Feb 7 11:57 ld.so.conf.d
-rw-r----- 1 root root 191 Jan 13 22:33 libaudit.conf
drwxr-xr-x 2 root root 4096 Feb 1 19:19 libnl
-rw-r--r-- 1 root root 17 Jan 31 00:19 locale.conf
-rw-r--r-- 1 root root 18 Jan 31 00:19 locale.gen
-rw-r--r-- 1 root root 9984 Feb 6 00:09 locale.gen.pacnew
-rw-r--r-- 1 root root 5645 Sep 7 13:42 login.defs
-rw-r--r-- 1 root root 5792 Jul 1 2020 makepkg.conf
-rw-r--r-- 1 root root 812 Jan 31 20:31 mke2fs.conf
drwxr-xr-x 2 root root 4096 Jan 7 19:51 modprobe.d
drwxr-xr-x 2 root root 4096 Dec 16 14:38 modules-load.d
-rw-r--r-- 1 root root 0 Jan 19 01:32 motd
lrwxrwxrwx 1 root root 12 Feb 7 11:58 mtab -> /proc/mounts
-rw-r--r-- 1 root root 767 Dec 2 16:02 netconfig
-rw-r--r-- 1 root root 2717 Feb 6 00:09 nscd.conf
-rw-r--r-- 1 root root 328 Jan 19 01:32 nsswitch.conf
drwxr-xr-x 1 root root 4096 Feb 7 11:57 openldap
lrwxrwxrwx 1 root root 19 Feb 1 19:19 os-release -> /usr/lib/os-release
-rw-r--r-- 1 root root 3264 Feb 7 11:57 pacman.conf
-rw-r--r-- 1 root root 2883 Jul 1 2020 pacman.conf.pacnew
drwxr-xr-x 1 root root 4096 Feb 7 11:57 pacman.d
drwxr-xr-x 1 root root 4096 Feb 7 11:57 pam.d
-rw-r--r-- 1 root root 744 Feb 7 11:57 passwd
-rw-r--r-- 1 root root 699 Jan 31 00:20 passwd-
drwxr-xr-x 2 root root 4096 Feb 1 19:19 pkcs11
-rw-r--r-- 1 root root 1020 Jan 19 01:32 profile
drwxr-xr-x 1 root root 4096 Feb 7 11:57 profile.d
-rw-r--r-- 1 root root 3171 Jan 3 17:14 protocols
-rw-r--r-- 1 root root 1814 Jul 7 2020 request-key.conf
drwxr-xr-x 2 root root 4096 Jul 7 2020 request-key.d
-rw-r--r-- 1 root root 649 Feb 7 11:58 resolv.conf
-rw-r--r-- 1 root root 1634 Feb 6 00:09 rpc
-rw-r--r-- 1 root root 139 Jan 19 01:32 securetty
drwxr-xr-x 2 root root 4096 Feb 1 19:19 security
-rw-r--r-- 1 root root 297708 Jan 3 17:14 services
-rw------- 1 root root 375 Feb 7 11:57 shadow
-rw------- 1 root root 346 Jan 31 00:20 shadow-
-rw-r--r-- 1 root root 83 Jan 19 01:32 shells
drwxr-xr-x 2 root root 4096 Feb 1 19:19 skel
drwxr-xr-x 5 root root 4096 Feb 1 19:19 ssl
-rw-r--r-- 1 root root 3975 Jan 26 18:34 sudo.conf
-r--r----- 1 root root 3160 Feb 7 11:57 sudoers
drwxr-x--- 2 root root 4096 Jan 26 18:34 sudoers.d
-rw-r--r-- 1 root root 6169 Jan 26 18:34 sudo_logsrvd.conf
drwxr-xr-x 2 root root 4096 Dec 16 14:38 sysctl.d
drwxr-xr-x 1 root root 4096 Feb 7 11:57 systemd
drwxr-xr-x 2 root root 4096 Dec 16 14:38 tmpfiles.d
drwxr-xr-x 1 root root 4096 Feb 7 11:57 udev
drwxr-xr-x 1 root root 4096 Feb 1 19:19 X11
-rw-r--r-- 1 root root 642 May 7 2020 xattr.conf
drwxr-xr-x 1 root root 4096 Feb 1 19:19 xdg
drwxr-xr-x 2 root root 4096 Feb 1 19:19 xinetd.d
---
#!/hint/bash
#
# /etc/makepkg.conf
#
...
SRCEXT='.src.tar.gz'
---
0
---
==> ERROR: /etc/makepkg.conf not found.
Aborting...
(The contents of /etc/makepkg.conf was concatenated.)
I also accidentally did [[ -r "/etc/makepkg.conf" ]] && echo 1 || echo 0 (as root) and I also got 0.
How is it possible that a file is not readable yet I can cat it? I also tried running the exact same commands in a local container and couldn't reproduce this issue, but this has happened every GitHub Actions run since it started.
This makes me think the Actions setup is causing an issue, but nothing seems odd there:
/usr/bin/docker build -t 442333:35a065f0b9f356b32f2852ba2f6b7296 -f "/home/runner/work/visual-studio-code-insiders-arch/visual-studio-code-insiders-arch/./.github/actions/pkg/Dockerfile" "/home/runner/work/visual-studio-code-insiders-arch/visual-studio-code-insiders-arch/.github/actions/pkg"
/usr/bin/docker run --name a065f0b9f356b32f2852ba2f6b7296_baf94b --label 442333 --workdir /github/workspace --rm -e pythonLocation -e LD_LIBRARY_PATH -e HOME -e GITHUB_JOB -e GITHUB_REF -e GITHUB_SHA -e GITHUB_REPOSITORY -e GITHUB_REPOSITORY_OWNER -e GITHUB_RUN_ID -e GITHUB_RUN_NUMBER -e GITHUB_RETENTION_DAYS -e GITHUB_ACTOR -e GITHUB_WORKFLOW -e GITHUB_HEAD_REF -e GITHUB_BASE_REF -e GITHUB_EVENT_NAME -e GITHUB_SERVER_URL -e GITHUB_API_URL -e GITHUB_GRAPHQL_URL -e GITHUB_WORKSPACE -e GITHUB_ACTION -e GITHUB_EVENT_PATH -e GITHUB_ACTION_REPOSITORY -e GITHUB_ACTION_REF -e GITHUB_PATH -e GITHUB_ENV -e RUNNER_OS -e RUNNER_TOOL_CACHE -e RUNNER_TEMP -e RUNNER_WORKSPACE -e ACTIONS_RUNTIME_URL -e ACTIONS_RUNTIME_TOKEN -e ACTIONS_CACHE_URL -e GITHUB_ACTIONS=true -e CI=true -v "/var/run/docker.sock":"/var/run/docker.sock" -v "/home/runner/work/_temp/_github_home":"/github/home" -v "/home/runner/work/_temp/_github_workflow":"/github/workflow" -v "/home/runner/work/_temp/_runner_file_commands":"/github/file_commands" -v "/home/runner/work/visual-studio-code-insiders-arch/visual-studio-code-insiders-arch":"/github/workspace" 442333:35a065f0b9f356b32f2852ba2f6b7296
Thanks for sharing this. I have precisely the same problems.
I added the following in my Dockerfile
RUN sed -i 's/\tif \[\[ -r $MAKEPKG_CONF \]\]; then/\tif \[\[ -f $MAKEPKG_CONF \]\]; then/' /usr/share/makepkg/util/config.sh
which replaces the check for read permission (-r) for the check whether the file exists and is a regular file (-f).
now my github action gets over this particular location, but fails with the next check:
==> ERROR: You do not have write permission for the directory $BUILDDIR (/tmp/aurutils).
Aborting...
This is not a solution and does not answer what's the underlying issue, but I hope it helps anyways.
This issue is caused by using glibc >= 2.33 on the container and an outdated version of the Docker engine on the host.
You can fix it by patching glibc in your container:
patched_glibc=glibc-linux4-2.33-4-x86_64.pkg.tar.zst
curl -LO https://repo.archlinuxcn.org/x86_64/$patched_glibc
bsdtar -C / -xvf $patched_glibc
Thanks to lxqt-panel for the workaround.
I'm getting myself familiar with Linux (Debian 9). However I managed to get myself confused with the ls command manual. I made up the following trivial setting for testing:
meouser:~/triv_dir$ ls -laR
.:
total 24
drwxr-xr-x 4 meouser meouser 4096 Mar 27 15:42 .
drwxr-xr-x 19 meouser meouser 4096 Mar 27 15:41 ..
drwxr-xr-x 4 meouser meouser 4096 Mar 27 15:55 a
drwxr-xr-x 2 meouser meouser 4096 Mar 27 15:42 b
-rw-r--r-- 1 meouser meouser 6 Mar 27 15:44 c
-rw-r--r-- 1 meouser meouser 6 Mar 27 15:44 d
./a:
total 24
drwxr-xr-x 4 meouser meouser 4096 Mar 27 15:55 .
drwxr-xr-x 4 meouser meouser 4096 Mar 27 15:42 ..
-rw-r--r-- 1 meouser meouser 4 Mar 27 15:50 aa
-rw-r--r-- 1 meouser meouser 4 Mar 27 15:50 ab
drwxr-xr-x 2 meouser meouser 4096 Mar 27 15:55 a_sub_1
drwxr-xr-x 2 meouser meouser 4096 Mar 27 15:55 a_sub_2
./a/a_sub_1:
total 12
drwxr-xr-x 2 meouser meouser 4096 Mar 27 15:55 .
drwxr-xr-x 4 meouser meouser 4096 Mar 27 15:55 ..
-rw-r--r-- 1 meouser meouser 4 Mar 27 15:55 aaa
./a/a_sub_2:
total 8
drwxr-xr-x 2 meouser meouser 4096 Mar 27 15:55 .
drwxr-xr-x 4 meouser meouser 4096 Mar 27 15:55 ..
./b:
total 16
drwxr-xr-x 2 meouser meouser 4096 Mar 27 15:42 .
drwxr-xr-x 4 meouser meouser 4096 Mar 27 15:42 ..
-rw-r--r-- 1 meouser meouser 4 Mar 27 15:50 ba
-rw-r--r-- 1 meouser meouser 4 Mar 27 15:50 bb
I would like to see all the directory names and their subdirectories, but not the filenames. That is, I want something like ls --insert-options-here so that the output is this subset from above:
.:
total 24
drwxr-xr-x 4 meouser meouser 4096 Mar 27 15:42 .
drwxr-xr-x 19 meouser meouser 4096 Mar 27 15:41 ..
drwxr-xr-x 4 meouser meouser 4096 Mar 27 15:55 a
drwxr-xr-x 2 meouser meouser 4096 Mar 27 15:42 b
./a:
total 24
drwxr-xr-x 4 meouser meouser 4096 Mar 27 15:55 .
drwxr-xr-x 4 meouser meouser 4096 Mar 27 15:42 ..
drwxr-xr-x 2 meouser meouser 4096 Mar 27 15:55 a_sub_1
drwxr-xr-x 2 meouser meouser 4096 Mar 27 15:55 a_sub_2
According to ls manual that should be achieved by ls -ldR.
meouser:~/triv_dir$ man ls
-a, --all
do not ignore entries starting with .
-d, --directory
list directories themselves, not their contents
-l use a long listing format
-R, --recursive
list subdirectories recursively
But this is what happens instead: only the '.' is shown.
meouser:~/triv_dir$ ls -ldR
drwxr-xr-x 4 meouser meouser 4096 Mar 27 15:42 .
What am I missing from the manual?
I noticed from https://stackoverflow.com/a/29277454/11199684 that this can be achieved by
find . -maxdepth 2 -type d -print
which is impressive but it gives less information than the ls output above. Besides, I might not know beforehand the correct maxdepth? And above all, for future needs I'm actually interested in teaching myself from the manuals. Advice are appreciated.
The -d option apply to [FILE] given as input, in your case, as none are given, you fall back to the default one : the current directory. The recursivity doesn't apply as no directory are returned.
To get the same output as ls with the find command, you can combine them :
find . -type d -exec ls -ld {} \;
in some way you could use the grep tool to filter the results:
ll -A | grep ^d
if you want to use it programatically, in a bash script you can have only the dir names (but find might be better for that):
ll -A | grep / | awk '{print $9}'
With the man manual, I know some information about auditctl. But with the option -w path, I found some information as follow:
Insert a watch for the file system object at path. You cannot insert a watch to the top level directory. This is prohibited by the kernel. Wildcards are not supported either and will generate a warning.
According to my understanding, I think the command auditctl -w / could not insert a watch to the top level directory. But with my test in CentOS, I found that is OK?
The result test information:
[centos#localhost ~]$ sudo auditctl -w /
[centos#localhost ~]$ sudo auditctl -l
-w / -p rwxa
[centos#localhost ~]$ cd /
[centos#localhost /]$ pwd
/
[centos#localhost /]$ ll
total 24
-rw-r--r--. 1 root root 0 Mar 13 17:01 1
lrwxrwxrwx. 1 root root 7 Mar 13 16:56 bin -> usr/bin
dr-xr-xr-x. 4 root root 4096 Mar 13 17:15 boot
drwxr-xr-x. 20 root root 3320 Mar 14 02:15 dev
drwxr-xr-x. 142 root root 8192 Mar 14 02:14 etc
drwxr-xr-x. 3 root root 20 Mar 13 17:12 home
lrwxrwxrwx. 1 root root 7 Mar 13 16:56 lib -> usr/lib
lrwxrwxrwx. 1 root root 9 Mar 13 16:56 lib64 -> usr/lib64
drwxr-xr-x. 2 root root 6 Nov 5 11:38 media
-rw-r--r--. 1 root root 0 Mar 13 21:40 mmm
drwxr-xr-x. 2 root root 6 Nov 5 11:38 mnt
drwxr-xr-x. 3 root root 16 Mar 13 17:08 opt
dr-xr-xr-x. 219 root root 0 Mar 14 02:14 proc
dr-xr-x---. 6 root root 234 Mar 13 11:53 root
drwxr-xr-x. 40 root root 1180 Mar 14 02:15 run
lrwxrwxrwx. 1 root root 8 Mar 13 16:56 sbin -> usr/sbin
drwxr-xr-x. 2 root root 6 Nov 5 11:38 srv
dr-xr-xr-x. 13 root root 0 Mar 14 02:14 sys
drwxrwxrwt. 42 root root 4096 Mar 14 04:04 tmp
drwxr-xr-x. 2 root root 6 Mar 13 21:40 ttt
drwxr-xr-x. 13 root root 155 Mar 13 16:56 usr
drwxr-xr-x. 21 root root 4096 Mar 14 02:14 var
[centos#localhost /]$ sudo mkdir alex
[centos#localhost /]$ sudo touch alexzl
[centos#localhost /]$ ll
total 24
-rw-r--r--. 1 root root 0 Mar 13 17:01 1
drwxr-xr-x. 2 root root 6 Mar 14 04:17 alex
-rw-r--r--. 1 root root 0 Mar 14 04:17 alexzl
lrwxrwxrwx. 1 root root 7 Mar 13 16:56 bin -> usr/bin
dr-xr-xr-x. 4 root root 4096 Mar 13 17:15 boot
drwxr-xr-x. 20 root root 3320 Mar 14 02:15 dev
drwxr-xr-x. 142 root root 8192 Mar 14 02:14 etc
drwxr-xr-x. 3 root root 20 Mar 13 17:12 home
lrwxrwxrwx. 1 root root 7 Mar 13 16:56 lib -> usr/lib
lrwxrwxrwx. 1 root root 9 Mar 13 16:56 lib64 -> usr/lib64
drwxr-xr-x. 2 root root 6 Nov 5 11:38 media
-rw-r--r--. 1 root root 0 Mar 13 21:40 mmm
drwxr-xr-x. 2 root root 6 Nov 5 11:38 mnt
drwxr-xr-x. 3 root root 16 Mar 13 17:08 opt
dr-xr-xr-x. 218 root root 0 Mar 14 02:14 proc
dr-xr-x---. 6 root root 234 Mar 13 11:53 root
drwxr-xr-x. 40 root root 1180 Mar 14 02:15 run
lrwxrwxrwx. 1 root root 8 Mar 13 16:56 sbin -> usr/sbin
drwxr-xr-x. 2 root root 6 Nov 5 11:38 srv
dr-xr-xr-x. 13 root root 0 Mar 14 02:14 sys
drwxrwxrwt. 42 root root 4096 Mar 14 04:04 tmp
drwxr-xr-x. 2 root root 6 Mar 13 21:40 ttt
drwxr-xr-x. 13 root root 155 Mar 13 16:56 usr
drwxr-xr-x. 21 root root 4096 Mar 14 02:14 var
[centos#localhost /]$ sudo ausearch -f /
.............
.............
time->Tue Mar 14 04:17:00 2017
type=PATH msg=audit(1489479420.957:1682): item=1 name="alex" objtype=CREATE
type=PATH msg=audit(1489479420.957:1682): item=0 name="/" inode=64 dev=fd:00 mode=040555 ouid=0 ogid=0 rdev=00:00 obj=system_u:object_r:root_t:s0 objtype=PARENT
type=CWD msg=audit(1489479420.957:1682): cwd="/"
type=SYSCALL msg=audit(1489479420.957:1682): arch=c000003e syscall=83 success=no exit=-13 a0=7ffeb030b435 a1=1ff a2=1ff a3=7ffeb030a370 items=2 ppid=3444 pid=5955 auid=1000 uid=1000 gid=1000 euid=1000 suid=1000 fsuid=1000 egid=1000 sgid=1000 fsgid=1000 tty=pts0 ses=1 comm="mkdir" exe="/usr/bin/mkdir" subj=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 key=(null)
.............
time->Tue Mar 14 04:17:39 2017
type=PATH msg=audit(1489479459.343:1915): item=1 name="/lib64/ld-linux-x86-64.so.2" inode=33613563 dev=fd:00 mode=0100755 ouid=0 ogid=0 rdev=00:00 obj=system_u:object_r:ld_so_t:s0 objtype=NORMAL
type=PATH msg=audit(1489479459.343:1915): item=0 name="/usr/bin/sudo" inode=1461019 dev=fd:00 mode=0104111 ouid=0 ogid=0 rdev=00:00 obj=system_u:object_r:sudo_exec_t:s0 objtype=NORMAL
type=CWD msg=audit(1489479459.343:1915): cwd="/"
type=EXECVE msg=audit(1489479459.343:1915): argc=3 a0="sudo" a1="touch" a2="alexzl"
type=BPRM_FCAPS msg=audit(1489479459.343:1915): fver=0 fp=0000000000000000 fi=0000000000000000 fe=0 old_pp=0000000000000000 old_pi=0000000000000000 old_pe=0000000000000000 new_pp=0000001fffffffff new_pi=0000000000000000 new_pe=0000001fffffffff
type=SYSCALL msg=audit(1489479459.343:1915): arch=c000003e syscall=59 success=yes exit=0 a0=e21e00 a1=e99fb0 a2=e34670 a3=7ffe09a62fa0 items=2 ppid=3444 pid=5971 auid=1000 uid=1000 gid=1000 euid=0 suid=0 fsuid=0 egid=1000 sgid=1000 fsgid=1000 tty=pts0 ses=1 comm="sudo" exe="/usr/bin/sudo" subj=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 key=(null)
----
Why the man manual does not support insertion a watch to the top level directory, but the test is OK?
I think this problem is that it limit to insert a watch on the top level directory not the child directory or file. for example, if you want to insert a watch to root directory, it is prohibited, but it could add the watches to child directory and file at the same time.
I'm using the following command to download some file in another machine.
It works fine when the file size of senselist.txt is small(<1G maybe, no accurate number just a estimate).
When the file size grow bigger, it failed to download one of the senselist.txt.
wget -r -N -l inf -nd -np -q --accept=senselist.txt* \
-t 30 -T 60 -c --limit-rate=100M \
ftp://ftp:ftp#hostname/home/work/data/20150922 \
-P ./data_tmp/20150921000000/tmp_dir
Currently there are eight files on the source machine. Sometimes, I failed to download senselist.txt4. But it can't be reproduced, it happens occasionally.
How to fix this, or how to find the reason for this?
-rw-rw-rw- 1 root root 1.4G Sep 21 19:04 senselist.txt0
-rw-rw-rw- 1 root root 100 Sep 21 19:04 senselist.txt0.md5
-rw-rw-rw- 1 root root 1019.8M Sep 21 19:33 senselist.txt1
-rw-rw-rw- 1 root root 100 Sep 21 19:34 senselist.txt1.md5
-rw-rw-rw- 1 root root 1.1G Sep 21 20:42 senselist.txt2
-rw-rw-rw- 1 root root 100 Sep 21 20:42 senselist.txt2.md5
-rw-rw-rw- 1 root root 1.1G Sep 21 21:25 senselist.txt3
-rw-rw-rw- 1 root root 100 Sep 21 21:25 senselist.txt3.md5
-rw-rw-rw- 1 root root 1017.0M Sep 21 21:59 senselist.txt4
-rw-rw-rw- 1 root root 100 Sep 21 22:00 senselist.txt4.md5
-rw-rw-rw- 1 root root 895.2M Sep 21 22:37 senselist.txt5
-rw-rw-rw- 1 root root 100 Sep 21 22:38 senselist.txt5.md5
-rw-rw-rw- 1 root root 1.2G Sep 21 23:22 senselist.txt6
-rw-rw-rw- 1 root root 100 Sep 21 23:22 senselist.txt6.md5
-rw-rw-rw- 1 root root 1.2G Sep 21 23:54 senselist.txt7
-rw-rw-rw- 1 root root 100 Sep 21 23:54 senselist.txt7.md5
UPDATE
I wrote the command in a shell script, and use the following code:
eval "$cmd_str" 2>>$ERRFILE 1>>$LOGFILE
**I cannot use find as I get a permission denied error
I am trying to find all the directories in /students that are world readable. This is what I have so far:
grep 'r-x' | cut -c8-10 | ls -l /students | sort | uniq -c
I don't understand why this is not working. I am telling the shell to search for occurrences of 'r-x'in the 8th-10th characters of ls -l which is other users permissions (hence world readable). Then I'm sorting the output and displaying a count of matching results with uniq -c. This is my understanding of what my shell script should do and I dont see why its not. Any help would be greatly appreciated!
For some reason it's pulling out more than just the directories readable by others.
Here is some sample output (I omitted the majority of the output)
1 drwx------ 11 lluong b20107 4096 May 26 11:15 lluong
1 drwx------ 23 stretbar b20097 4096 Dec 18 2012 stretbar
1 drwx------ 2 slawson b20003 4096 Mar 2 2013 slawson
1 drwx------ 9 fcunha b20117 4096 May 2 15:21 fcunha
1 drwxrwxrwx 10 jwu131 b20117 4096 Jul 2 19:26 jwu131
1 drwxrwxrwx 14 jadler4 b20127 4096 Oct 11 2012 jadler4
1 drwxrwxrwx 5 rlicudo1 b20067 4096 Apr 3 15:28 rlicudo1
1 drwxrwxrwx 8 lkrubner b20107 4096 Oct 25 2011 lkrubner
1 drwxrwxrwx 9 klau53 b20133 4096 Mar 12 2013 klau53
1 drwxrwx--x 14 vrobins9 b20123 4096 Mar 4 2013 vrobins9
1 drwxr-xr-x 10 aguo3 b20107 4096 Sep 24 00:13 aguo3
1 drwxr-xr-x 10 mdanial b20123 4096 Apr 10 20:46 mdanial
1 drwxr-xr-x 11 49 users 4096 Mar 28 2013 trac
1 drwxr-xr-x 11 rroger12 b20133 4096 May 8 10:00 rroger12
1 drwxr-xr-x 12 spark15 b20113 4096 May 15 2012 spark15
1 drwxr-xr-x 18 lulrich1 b20133 4096 Sep 29 22:36 lulrich1
1 drwxr-xr-x 18 yliu192 b20127 4096 Sep 26 12:19 yliu192
1 drwxr-xr-x 19 dstein b20117 4096 Feb 9 2013 dstein
1 drwxr-xr-x 20 jgarc166 b20127 4096 Sep 12 19:22 jgarc166
1 drwxr-xr-x 2 root root 16384 Nov 15 2007 lost+found
1 drwxr-xr-x 4 jsarno b20113 4096 Dec 7 2011 jsarno
1 drwxr-xr-x 6 btaylo19 b20123 4096 Mar 5 2012 btaylo19
1 drwxr-xr-x 6 dtu b20093 4096 Apr 18 19:18 dtu
1 drwxr-xr-x 6 ewu2 b20133 4096 May 4 14:30 ewu2
1 drwxr-xr-x 6 smeehan b20053 4096 Aug 29 00:19 smeehan
1 drwxr-xr-x 6 ybondar2 b20027 4096 May 23 2012 ybondar2
1 drwxr-xr-x 7 apekar b20103 4096 May 10 00:22 apekar
1 drwxr-xr-x 7 root root 4096 Mar 28 2013 tracprojects
1 drwxr-xr-x 8 jhsiao b20117 4096 Jul 26 17:33 jhsiao
1 drwxr-xr-x 8 xfeng18 b20137 4096 Sep 25 14:42 xfeng18
1 drwxr-xr-x 9 cmendo26 b20133 4096 Aug 19 01:22 cmendo26
1 drwx-----x 8 amissiro b20093 4096 May 12 16:00 amissiro
1 drwx--xr-x 17 apinchuk b20127 4096 May 26 23:03 apinchuk
1 drwx--x--x 10 aboak b20093 4096 Feb 18 2013 aboak
1 drwx--x--x 10 achan123 b20133 4096 Sep 6 21:24 achan123
1 drwx--x--x 10 acurkend b20133 4096 Jul 10 13:15 acurkend
1 drwx--x--x 10 akleinii b20133 4096 Jun 21 09:07 akleinii
1 drwx--x--x 10 akobzar b20133 4096 Sep 26 18:51 akobzar
1 drwx--x--x 10 amainett b20137 4096 Sep 22 11:17 amainett
1 drwx--x--x 10 apewther b20127 4096 Feb 6 2013 apewther
1 drwx--x--x 10 asyrtsov b20127 4096 Aug 16 10:43 asyrtsov
1 drwx--x--x 10 bernst b20135 4096 Sep 23 09:12 bernst
1 drwx--x--x 10 blilley b20123 4096 Apr 20 18:08 blilley
1 drwx--x--x 10 bmckeand b20117 4096 Aug 14 14:17 bmckeand
1 drwx--x--x 10 bsmith18 b20097 4096 Jun 10 11:19 bsmith18
1 drwx--x--x 10 bwilli18 b20117 4096 Nov 6 2012 bwilli18
1 drwx--x--x 10 cbeaton b20123 4096 May 19 04:07 cbeaton
1 drwx--x--x 10 cbeck4 b20137 4096 Sep 29 16:08 cbeck4
1 drwx--x--x 10 cho8 b20093 4096 Mar 24 2013 cho8
1 drwx--x--x 10 cliu58 b20117 4096 Oct 8 2012 cliu58
1 drwx--x--x 10 cmitch21 b20133 4096 Mar 10 2013 cmitch21
1 drwx--x--x 10 cnavarr9 b20127 4096 Apr 30 12:11 cnavarr9
1 drwx--x--x 10 dbienenf b20123 4096 Mar 20 2012 dbienenf
1 drwx--x--x 10 dlau13 b20135 4096 Jul 16 12:15 dlau13
1 drwx--x--x 10 dmok1 b20137 4096 Sep 24 12:50 dmok1
1 drwx--x--x 10 dnou b20133 4096 Apr 23 14:12 dnou
1 drwx--x--x 10 drajabar b20137 4096 Sep 3 20:20 drajabar
1 drwx--x--x 10 drodri12 b20115 4096 Sep 27 17:25 drodri12
1 drwx--x--x 10 ealberto b20113 4096 Dec 18 2012 ealberto
Rather than parsing ls, use find:
find /students -perm -o=r
This would list all files and directories in /students that are world readable.
If you don't want to recurse into subdirectories and want to find only directories, say:
find /students -maxdepth 1 -type d -perm -o=r
I am telling the shell to search for occurrences of 'r-x'in the 8th-10th characters of ls -l which is other users permissions (hence world readable).
No you're not. You're looking for "r-x" anywhere in the line and then taking the 8th through 10th characters of the lines found.
find /students -mindepth 1 -maxdepth 1 -type d -perm -005 | ...
"Why you shouldn't parse the output of ls(1)"
ls -lad */ | grep 'r-x' | sort | uniq -c
-d is used to list ONLY directories.
*/ tells *nix to search ONLY the current directory.
ls -lR |grep "^d" | cut -c8-10 | grep 'r-x' | sort | uniq -c