# Vagrant: changing ownership of ‘/shared/postgres\_run’: Operation not permitted

**URL:** https://meta.discourse.org/t/vagrant-changing-ownership-of-shared-postgres-run-operation-not-permitted/37197
**Category:** Self-hosting
**Created:** [2015 年 12 月 28 日午後 8:56 UTC](https://meta.discourse.org/t/vagrant-changing-ownership-of-shared-postgres-run-operation-not-permitted/37197 "2015-12-28T20:56:18Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![aventurella](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/aventurella/32/122051_2.png) [@aventurella](https://meta.discourse.org/u/aventurella)
#### Post date: [2015 年 12 月 28 日午後 8:56 UTC](https://meta.discourse.org/t/vagrant-changing-ownership-of-shared-postgres-run-operation-not-permitted/37197/1 "2015-12-28T20:56:18Z")

</div>

I am running my install from vagrant under the vmware fusion provider. Only have altered the cloned Vagrant file as follows:

```
config.vm.provider "vmware_fusion" do |v|
    v.vmx["memsize"] = "2048"
    v.vmx["numvcpus"] = "2"
 end

```

and changing the image:

```
config.vm.define :dockerhost do |config|
    config.vm.box = "netsensia/ubuntu-trusty64-salt"
    # config.vm.box_url
    ...

```

the box `vagrant up`s just fine. Then I `sudo -i` and `cd /var/discourse`. From here I `./launcher bootstrap app` I have also done `./launcher rebuild app` as well. I get the following output, specifically of note are these 2 lines:

`exec failed with the params "chown postgres:postgres /shared/postgres_run"`

AND

```
I, [2015-12-28T20:53:21.029322 #36] INFO -- : > chown postgres:postgres /shared/postgres_run
chown: changing ownership of ‘/shared/postgres_run’: Operation not permitted

```

Full output:

```
root@ubuntu:/var/discourse# ./launcher rebuild app
Ensuring discourse docker is up to date
Fetching origin
Warning: Permanently added the RSA host key for IP address '192.30.252.131' to the list of known hosts.
Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
error: Could not fetch origin
Discourse Docker is up-to-date
cd /pups && git pull && /pups/bin/pups --stdin
Already up-to-date.
I, [2015-12-28T20:53:21.014149 #36] INFO -- : Loading --stdin
I, [2015-12-28T20:53:21.024743 #36] INFO -- : > mkdir -p /shared/postgres_run
I, [2015-12-28T20:53:21.028621 #36] INFO -- :
I, [2015-12-28T20:53:21.029322 #36] INFO -- : > chown postgres:postgres /shared/postgres_run
chown: changing ownership of ‘/shared/postgres_run’: Operation not permitted
I, [2015-12-28T20:53:21.034387 #36] INFO -- :

FAILED
--------------------
RuntimeError: chown postgres:postgres /shared/postgres_run failed with return #<Process::Status: pid 39 exit 1>
Location of failure: /pups/lib/pups/exec_command.rb:105:in `spawn'
exec failed with the params "chown postgres:postgres /shared/postgres_run"
461135b5c8234734231d018bdcfc13594df737388496356bb889e07644446119
**FAILED TO BOOTSTRAP** please scroll up and look for earlier error messages, there may be more than one
root@ubuntu:/var/discourse#

```

Has anyone else encountered this? If so can you let me know what I am doing wrong?

The above output was from a rebuild. Here is the output from a totally clean start:

```
12:59 $ vagrant ssh
Welcome to Ubuntu 14.04 LTS (GNU/Linux 3.13.0-24-generic x86_64)

 * Documentation: https://help.ubuntu.com/
Last login: Tue Apr 29 05:37:43 2014
vagrant@ubuntu:~$ sudo -i
root@ubuntu:~# cd /vagrant
root@ubuntu:/vagrant# ./launcher bootstrap app

WARNING: We are about to start downloading the Discourse base image
This process may take anywhere between a few minutes to an hour, depending on your network speed

Please be patient

Unable to find image 'discourse/discourse:1.0.15' locally
1.0.15: Pulling from discourse/discourse
0a85502c06c9: Pulling fs layer
7c89512ebc1d: Pulling fs layer
d69c7fe24577: Pulling fs layer
f51580829cf9: Pulling fs layer
c7dcd5c3a8a2: Pulling fs layer
cb7b58c22b11: Pulling fs layer
f51580829cf9: Verifying Checksum
f51580829cf9: Download complete
c7dcd5c3a8a2: Verifying Checksum
c7dcd5c3a8a2: Download complete
cb7b58c22b11: Verifying Checksum
cb7b58c22b11: Download complete
0a85502c06c9: Verifying Checksum
0a85502c06c9: Download complete
7c89512ebc1d: Verifying Checksum
7c89512ebc1d: Download complete
d69c7fe24577: Verifying Checksum
d69c7fe24577: Download complete
0a85502c06c9: Pull complete
7c89512ebc1d: Pull complete
d69c7fe24577: Pull complete
f51580829cf9: Pull complete
c7dcd5c3a8a2: Pull complete
cb7b58c22b11: Pull complete
Digest: sha256:1ac1b72f327c650456140aa12631305b9d1e1293035e57acce844b7efbd6a9df
Status: Downloaded newer image for discourse/discourse:1.0.15
cd /pups && git pull && /pups/bin/pups --stdin
Already up-to-date.
I, [2015-12-28T21:01:31.757433 #37] INFO -- : Loading --stdin
I, [2015-12-28T21:01:31.763553 #37] INFO -- : > mkdir -p /shared/postgres_run
I, [2015-12-28T21:01:31.769122 #37] INFO -- :
I, [2015-12-28T21:01:31.770498 #37] INFO -- : > chown postgres:postgres /shared/postgres_run
chown: changing ownership of ‘/shared/postgres_run’: Operation not permitted
I, [2015-12-28T21:01:31.779272 #37] INFO -- :

FAILED
--------------------
RuntimeError: chown postgres:postgres /shared/postgres_run failed with return #<Process::Status: pid 40 exit 1>
Location of failure: /pups/lib/pups/exec_command.rb:105:in `spawn'
exec failed with the params "chown postgres:postgres /shared/postgres_run"
5aa0fdb27a24de22e4ca5271a99c1d7e71139bef22aa75376e9c6e6bb7e7bd51
**FAILED TO BOOTSTRAP** please scroll up and look for earlier error messages, there may be more than one
root@ubuntu:/vagrant#

```

---

<div class="post-metadata">

### Author: ![Himanshu\_Chhangani](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/himanshu_chhangani/32/40772_2.png) [@Himanshu\_Chhangani](https://meta.discourse.org/u/Himanshu_Chhangani)
#### Post date: [2016 年 7 月 13 日午前 10:54 UTC](https://meta.discourse.org/t/vagrant-changing-ownership-of-shared-postgres-run-operation-not-permitted/37197/2 "2016-07-13T10:54:30Z")

</div>

If you have disabled SELinux, you’d better disable it in docker also.

> vi /etc/sysconfig/docker  
> OPTIONS=‘–selinux-enabled’ – Comment out this line by adding a # in beginning.
