-bash: / usr / sbin / mail: Nenhum arquivo ou diretório

0

Eu tenho tido problemas de e-mail por um tempo agora e decidi que hoje eu iria consertá-los! Bem, agora estou preso. O problema era que, quando eu digito mail , ele não exibe meu e-mail, verificando meus links de links simbólicos estava vinculado a msmtp . Eu tentei atualizar o symlink para postfix , mas isso não está funcionando e uma strace run está me dizendo que está funcionando:

sudo strace ln -sf /usr/sbin/mail /usr/sbin/postfix
execve("/bin/ln", ["ln", "-sf", "/usr/sbin/mail", "/usr/sbin/postfix"], [/* 13 vars */]) = 0
brk(NULL)                               = 0x136f000
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)
access("/etc/ld.so.preload", R_OK)      = -1 ENOENT (No such file or directory)
open("/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=62599, ...}) = 0
mmap(NULL, 62599, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7f9edbd88000
close(3)                                = 0
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)
open("/lib/x86_64-linux-gnu/libc.so.6", O_RDONLY|O_CLOEXEC) = 3
read(3, "7ELF
ls -l /usr/sbin | grep "\->"
...
lrwxrwxrwx  1 root root           14 Jul 18 09:28 mail -> /usr/bin/msmtp
...
 mail
-bash: /usr/sbin/mail: No such file or directory
sudo find / -iname "mail"
...
/usr/sbin/mail
...
sudo find / -iname "postfix"
/etc/ufw/applications.d/postfix
/etc/resolvconf/update-libc.d/postfix
/etc/network/if-up.d/postfix
/etc/network/if-down.d/postfix
/etc/ppp/ip-up.d/postfix
/etc/ppp/ip-down.d/postfix
/etc/insserv.conf.d/postfix
/etc/init.d/postfix
/etc/postfix
/usr/share/doc/postfix
/usr/share/bash-completion/completions/postfix
/usr/share/lintian/overrides/postfix
/usr/share/postfix
/usr/sbin/postfix   #<=
/usr/lib/python3/dist-packages/fail2ban/tests/files/logs/postfix
/usr/lib/postfix
/var/spool/postfix
/var/lib/postfix
You have new mail in /home/serveradmin/Maildir
sudo strace ln -sf /usr/sbin/mail /usr/sbin/postfix
execve("/bin/ln", ["ln", "-sf", "/usr/sbin/mail", "/usr/sbin/postfix"], [/* 13 vars */]) = 0
brk(NULL)                               = 0x136f000
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)
access("/etc/ld.so.preload", R_OK)      = -1 ENOENT (No such file or directory)
open("/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=62599, ...}) = 0
mmap(NULL, 62599, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7f9edbd88000
close(3)                                = 0
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)
open("/lib/x86_64-linux-gnu/libc.so.6", O_RDONLY|O_CLOEXEC) = 3
read(3, "7ELF
ls -l /usr/sbin | grep "\->"
...
lrwxrwxrwx  1 root root           14 Jul 18 09:28 mail -> /usr/bin/msmtp
...
 mail
-bash: /usr/sbin/mail: No such file or directory
sudo find / -iname "mail"
...
/usr/sbin/mail
...
sudo find / -iname "postfix"
/etc/ufw/applications.d/postfix
/etc/resolvconf/update-libc.d/postfix
/etc/network/if-up.d/postfix
/etc/network/if-down.d/postfix
/etc/ppp/ip-up.d/postfix
/etc/ppp/ip-down.d/postfix
/etc/insserv.conf.d/postfix
/etc/init.d/postfix
/etc/postfix
/usr/share/doc/postfix
/usr/share/bash-completion/completions/postfix
/usr/share/lintian/overrides/postfix
/usr/share/postfix
/usr/sbin/postfix   #<=
/usr/lib/python3/dist-packages/fail2ban/tests/files/logs/postfix
/usr/lib/postfix
/var/spool/postfix
/var/lib/postfix
You have new mail in /home/serveradmin/Maildir
%pre%%pre%%pre%%pre%%pre%>%pre%%pre%%pre%%pre%P\t%pre%%pre%%pre%%pre%%pre%"..., 832) = 832 fstat(3, {st_mode=S_IFREG|0755, st_size=1868984, ...}) = 0 mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f9edbd87000 mmap(NULL, 3971488, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f9edb7a9000 mprotect(0x7f9edb969000, 2097152, PROT_NONE) = 0 mmap(0x7f9edbb69000, 24576, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1c0000) = 0x7f9edbb69000 mmap(0x7f9edbb6f000, 14752, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7f9edbb6f000 close(3) = 0 mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f9edbd86000 mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f9edbd85000 arch_prctl(ARCH_SET_FS, 0x7f9edbd86700) = 0 mprotect(0x7f9edbb69000, 16384, PROT_READ) = 0 mprotect(0x60c000, 4096, PROT_READ) = 0 mprotect(0x7f9edbd98000, 4096, PROT_READ) = 0 munmap(0x7f9edbd88000, 62599) = 0 brk(NULL) = 0x136f000 brk(0x1390000) = 0x1390000 open("/usr/lib/locale/locale-archive", O_RDONLY|O_CLOEXEC) = 3 fstat(3, {st_mode=S_IFREG|0644, st_size=2981280, ...}) = 0 mmap(NULL, 2981280, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7f9edb4d1000 close(3) = 0 stat("/usr/sbin/postfix", 0x7fff872ed280) = -1 ENOENT (No such file or directory) lstat("/usr/sbin/postfix", {st_mode=S_IFLNK|0777, st_size=14, ...}) = 0 stat("/usr/sbin/mail", 0x7fff872ed0d0) = -1 ENOENT (No such file or directory) symlink("/usr/sbin/mail", "/usr/sbin/postfix") = -1 EEXIST (File exists) unlink("/usr/sbin/postfix") = 0 symlink("/usr/sbin/mail", "/usr/sbin/postfix") = 0 lseek(0, 0, SEEK_CUR) = -1 ESPIPE (Illegal seek) close(0) = 0 close(1) = 0 close(2) = 0 exit_group(0) = ? +++ exited with 0 +++
%pre%%pre%%pre%%pre%>%pre%%pre%%pre%%pre%P\t%pre%%pre%%pre%%pre%%pre%"..., 832) = 832 fstat(3, {st_mode=S_IFREG|0755, st_size=1868984, ...}) = 0 mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f9edbd87000 mmap(NULL, 3971488, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f9edb7a9000 mprotect(0x7f9edb969000, 2097152, PROT_NONE) = 0 mmap(0x7f9edbb69000, 24576, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1c0000) = 0x7f9edbb69000 mmap(0x7f9edbb6f000, 14752, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7f9edbb6f000 close(3) = 0 mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f9edbd86000 mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f9edbd85000 arch_prctl(ARCH_SET_FS, 0x7f9edbd86700) = 0 mprotect(0x7f9edbb69000, 16384, PROT_READ) = 0 mprotect(0x60c000, 4096, PROT_READ) = 0 mprotect(0x7f9edbd98000, 4096, PROT_READ) = 0 munmap(0x7f9edbd88000, 62599) = 0 brk(NULL) = 0x136f000 brk(0x1390000) = 0x1390000 open("/usr/lib/locale/locale-archive", O_RDONLY|O_CLOEXEC) = 3 fstat(3, {st_mode=S_IFREG|0644, st_size=2981280, ...}) = 0 mmap(NULL, 2981280, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7f9edb4d1000 close(3) = 0 stat("/usr/sbin/postfix", 0x7fff872ed280) = -1 ENOENT (No such file or directory) lstat("/usr/sbin/postfix", {st_mode=S_IFLNK|0777, st_size=14, ...}) = 0 stat("/usr/sbin/mail", 0x7fff872ed0d0) = -1 ENOENT (No such file or directory) symlink("/usr/sbin/mail", "/usr/sbin/postfix") = -1 EEXIST (File exists) unlink("/usr/sbin/postfix") = 0 symlink("/usr/sbin/mail", "/usr/sbin/postfix") = 0 lseek(0, 0, SEEK_CUR) = -1 ESPIPE (Illegal seek) close(0) = 0 close(1) = 0 close(2) = 0 exit_group(0) = ? +++ exited with 0 +++

No entanto, quando olho para o symlink:

%pre%

Eu decidi desinstalar msmtp para o bem usando sudo apt-get remove msmtp --purge , que funcionou. Eu tentei criar o link simbólico novamente usando sudo ln -sf /usr/sbin/mail /usr/sbin/postfix . Agora, sempre que eu digito e-mail, ocorre o seguinte erro:

%pre%

No entanto:

%pre%

O que está causando o problema com meu comando mail e como posso corrigi-lo com sucesso?

Saída de sudo find / -iname "postfix" :

%pre%     
por CertifcateJunky 24.07.2018 / 15:40

1 resposta

2

O -f em seu comando substituiu o binário /usr/sbin/postfix por um link.

Quando você reverter a ordem subseqüentemente, não haverá binário para vincular, embora eu espere um erro.

Você precisa reinstalar o binário /usr/sbin/postfix de um backup ou reinstalar; o ln -sf /usr/sbin/postfix /usr/sbin/mail corretamente solicitado agora fornecerá o link desejado.

No Ubuntu 16.04, o programa normal mail está em /usr/bin/ , embora por padrão /usr/sbin/ seja anterior na lista PATH .

    
por 24.07.2018 / 17:13