# Rm: não é possível remover '/var/run/postgresql': Diretório não está vazio

**URL:** <https://meta.discourse.org/t/rm-cannot-remove-var-run-postgresql-directory-not-empty/257046>\
**Category:** Self-hosting\
**Created:** [4 Março , 2023 12:09 UTC](https://meta.discourse.org/t/rm-cannot-remove-var-run-postgresql-directory-not-empty/257046 "2023-03-04T12:09:32Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![Blechpirat](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/blechpirat/32/221370_2.png) [@Blechpirat](https://meta.discourse.org/u/Blechpirat)\
**Post date:** [4 Março , 2023 12:09 UTC](https://meta.discourse.org/t/rm-cannot-remove-var-run-postgresql-directory-not-empty/257046/1 "2023-03-04T12:09:32Z")

</div>

Depois de ter um disco cheio e não conseguir mover minhas imagens, decidi apagar tudo, iniciar um novo contêiner do Discourse e usar o backup.

Apaguei `/var/discourse` e executei `docker system prune -a`.

Em seguida, segui o guia oficial. Mas… algo está errado:

```plaintext
./launcher rebuild app
x86_64 arch detected.
Ensuring launcher is up to date
Solicitando de origin
Launcher is up-to-date
2.0.20230222-0048: Pulling from discourse/base
Digest: sha256:XXXX
Status: Image is up to date for discourse/base:2.0.20230222-0048
docker.io/discourse/base:2.0.20230222-0048
/usr/local/lib/ruby/gems/3.2.0/gems/pups-1.1.1/lib/pups.rb
/usr/local/bin/pups --stdin
I, [2023-03-04T12:04:27.482399 #1] INFO -- : Reading from stdin
I, [2023-03-04T12:04:27.486188 #1] INFO -- : > locale-gen $LANG && update-locale
I, [2023-03-04T12:04:28.456925 #1] INFO -- : Generating locales (this might take a while)...
Generation complete.

I, [2023-03-04T12:04:28.457319 #1] INFO -- : > mkdir -p /shared/postgres_run
I, [2023-03-04T12:04:28.581971 #1] INFO -- :
I, [2023-03-04T12:04:28.583082 #1] INFO -- : > chown postgres:postgres /shared/postgres_run
I, [2023-03-04T12:04:28.588444 #1] INFO -- :
I, [2023-03-04T12:04:28.588792 #1] INFO -- : > chmod 775 /shared/postgres_run
I, [2023-03-04T12:04:28.591995 #1] INFO -- :
I, [2023-03-04T12:04:28.592147 #1] INFO -- : > rm -fr /var/run/postgresql
rm: cannot remove '/var/run/postgresql': Directory not empty
I, [2023-03-04T12:04:28.616079 #1] INFO -- :

FAILED
--------------------
Pups::ExecError: rm -fr /var/run/postgresql failed with return #<Process::Status: pid 16 exit 1>
Location of failure: /usr/local/lib/ruby/gems/3.2.0/gems/pups-1.1.1/lib/pups/exec_command.rb:117:in `spawn'
exec failed with the params "rm -fr /var/run/postgresql"
bootstrap failed with exit code 1
**FAILED TO BOOTSTRAP** please scroll up and look for earlier error messages, there may be more than one.
./discourse-doctor may help diagnose the problem.

```

Alguém pode me ajudar aqui?

---

_[View the full topic](https://meta.discourse.org/t/rm-cannot-remove-var-run-postgresql-directory-not-empty/257046)._
