Cloudron makes it easy to run web apps like WordPress, Nextcloud, GitLab on your server. Find out more or install now.


Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Bookmarks
  • Search
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo

Cloudron Forum

Apps | Demo | Docs | Install
  1. Cloudron Forum
  2. Support
  3. Correct chown and chmod for /platformdata, /boxdata, and /appdata After Changing Default Data Directory

Correct chown and chmod for /platformdata, /boxdata, and /appdata After Changing Default Data Directory

Scheduled Pinned Locked Moved Solved Support
storage
6 Posts 2 Posters 204 Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    rnphil
    wrote on last edited by joseph
    #1

    Hi everyone,

    We recently changed the Default Data Directory in Cloudron, but it ended up causing permission issues, so we had to revert the changes and manually adjust the permissions. Since then, some services, including PostgreSQL, are no longer working correctly.

    For example, PostgreSQL fails to start with the following error:

    Feb 19 13:42:15 ==> Detected existing installation
    Feb 19 13:42:15 ==> Copying updated config
    Feb 19 13:42:15 ==> Updating existing postgresql
    Feb 19 13:42:15 pg_ctl: could not access directory "/var/lib/postgresql/14/main": Permission denied
    

    We suspect that some file ownership or permissions might still be incorrect, especially in the following directories:

    /platformdata
    /boxdata
    /appsdata

    Could someone confirm the correct chown and chmod settings for these directories to ensure Cloudron operates properly?

    Thanks in advance!

    1 Reply Last reply
    1
    • girishG girish marked this topic as a question on
    • girishG Offline
      girishG Offline
      girish
      Staff
      wrote on last edited by
      #2

      As a default, everything is owned by yellowtent user.

      However, subdirectories inside those paths are mounted into app and service containers. Each container has it's own user space and will change the ownership of the files as needed.

      For example, platformdata/postgresql will be used by the postgres container . All the start scripts of containers, will change the ownership of the data. For example, the postgres container already does chown -R postgres.postgres on start up.

      Feb 19 13:42:15 pg_ctl: could not access directory "/var/lib/postgresql/14/main": Permission denied

      Haven't seen this one before. Can you check the permissions of /home/yellowtent/platformdata/postgresql ?

      1 Reply Last reply
      0
      • girishG Offline
        girishG Offline
        girish
        Staff
        wrote on last edited by
        #3

        This is how my directory looks. I think in your case there is some issue with chmod and not chown related.

        root@my:/home/yellowtent/platformdata# ls -ln postgresql/
        total 4
        drwxr-xr-x 3 808 808 4096 Jan  3 17:42 14
        root@my:/home/yellowtent/platformdata# ls -ln postgresql/14
        total 4
        drwx------ 20 106 109 4096 Feb  5 13:55 main
        root@my:/home/yellowtent/platformdata# ls -ln postgresql/14/main
        total 104
        -rw------- 1 106 109    3 Jan  3 17:42 PG_VERSION
        drwx------ 6 106 109 4096 Feb 18 09:00 base
        -rw-r--r-- 1 106 109  691 Jan  3 17:42 custom.conf
        drwx------ 2 106 109 4096 Feb 17 11:39 global
        drwx------ 2 106 109 4096 Jan  3 17:42 pg_commit_ts
        drwx------ 2 106 109 4096 Jan  3 17:42 pg_dynshmem
        -rw------- 1 106 109  811 Feb  5 13:55 pg_hba.conf
        -rw------- 1 106 109 1636 Jan  3 17:42 pg_ident.conf
        drwx------ 4 106 109 4096 Feb 18 09:05 pg_logical
        drwx------ 4 106 109 4096 Jan  3 17:42 pg_multixact
        drwx------ 2 106 109 4096 Jan  3 17:42 pg_notify
        drwx------ 2 106 109 4096 Jan  3 17:42 pg_replslot
        drwx------ 2 106 109 4096 Jan  3 17:42 pg_serial
        drwx------ 2 106 109 4096 Jan  3 17:42 pg_snapshots
        drwx------ 2 106 109 4096 Feb  5 13:55 pg_stat
        drwx------ 2 106 109 4096 Feb 19 15:20 pg_stat_tmp
        drwx------ 2 106 109 4096 Feb 16 22:01 pg_subtrans
        drwx------ 2 106 109 4096 Jan  3 17:42 pg_tblspc
        drwx------ 2 106 109 4096 Jan  3 17:42 pg_twophase
        drwx------ 4 106 109 4096 Jan  3 17:42 pg_vectors
        drwx------ 3 106 109 4096 Feb 17 11:06 pg_wal
        drwx------ 2 106 109 4096 Jan  3 17:42 pg_xact
        -rw------- 1 106 109   88 Jan  3 17:42 postgresql.auto.conf
        -rw------- 1 106 109  968 Feb  5 13:55 postgresql.conf
        -rw------- 1 106 109   96 Feb  5 13:55 postmaster.opts
        -rw------- 1 106 109   98 Feb  5 13:55 postmaster.pid
        
        R 1 Reply Last reply
        0
        • girishG girish

          This is how my directory looks. I think in your case there is some issue with chmod and not chown related.

          root@my:/home/yellowtent/platformdata# ls -ln postgresql/
          total 4
          drwxr-xr-x 3 808 808 4096 Jan  3 17:42 14
          root@my:/home/yellowtent/platformdata# ls -ln postgresql/14
          total 4
          drwx------ 20 106 109 4096 Feb  5 13:55 main
          root@my:/home/yellowtent/platformdata# ls -ln postgresql/14/main
          total 104
          -rw------- 1 106 109    3 Jan  3 17:42 PG_VERSION
          drwx------ 6 106 109 4096 Feb 18 09:00 base
          -rw-r--r-- 1 106 109  691 Jan  3 17:42 custom.conf
          drwx------ 2 106 109 4096 Feb 17 11:39 global
          drwx------ 2 106 109 4096 Jan  3 17:42 pg_commit_ts
          drwx------ 2 106 109 4096 Jan  3 17:42 pg_dynshmem
          -rw------- 1 106 109  811 Feb  5 13:55 pg_hba.conf
          -rw------- 1 106 109 1636 Jan  3 17:42 pg_ident.conf
          drwx------ 4 106 109 4096 Feb 18 09:05 pg_logical
          drwx------ 4 106 109 4096 Jan  3 17:42 pg_multixact
          drwx------ 2 106 109 4096 Jan  3 17:42 pg_notify
          drwx------ 2 106 109 4096 Jan  3 17:42 pg_replslot
          drwx------ 2 106 109 4096 Jan  3 17:42 pg_serial
          drwx------ 2 106 109 4096 Jan  3 17:42 pg_snapshots
          drwx------ 2 106 109 4096 Feb  5 13:55 pg_stat
          drwx------ 2 106 109 4096 Feb 19 15:20 pg_stat_tmp
          drwx------ 2 106 109 4096 Feb 16 22:01 pg_subtrans
          drwx------ 2 106 109 4096 Jan  3 17:42 pg_tblspc
          drwx------ 2 106 109 4096 Jan  3 17:42 pg_twophase
          drwx------ 4 106 109 4096 Jan  3 17:42 pg_vectors
          drwx------ 3 106 109 4096 Feb 17 11:06 pg_wal
          drwx------ 2 106 109 4096 Jan  3 17:42 pg_xact
          -rw------- 1 106 109   88 Jan  3 17:42 postgresql.auto.conf
          -rw------- 1 106 109  968 Feb  5 13:55 postgresql.conf
          -rw------- 1 106 109   96 Feb  5 13:55 postmaster.opts
          -rw------- 1 106 109   98 Feb  5 13:55 postmaster.pid
          
          R Offline
          R Offline
          rnphil
          wrote on last edited by
          #4

          @girish

          After applying this 4 commands, It is working properly again, all systems are 🟢.

          chown -R 106:109 /home/yellowtent/platformdata/postgresql/14/main
          chmod -R 700 /home/yellowtent/platformdata/postgresql/14/main

          chown 808:808 /home/yellowtent/platformdata/postgresql/14
          chmod 755 /home/yellowtent/platformdata/postgresql/14

          Hope that these permissions don't bother us again in the future, and will soon try again to change the Default Data Directory.

          Thank you very much for your directory output and help.

          girishG 1 Reply Last reply
          0
          • R rnphil

            @girish

            After applying this 4 commands, It is working properly again, all systems are 🟢.

            chown -R 106:109 /home/yellowtent/platformdata/postgresql/14/main
            chmod -R 700 /home/yellowtent/platformdata/postgresql/14/main

            chown 808:808 /home/yellowtent/platformdata/postgresql/14
            chmod 755 /home/yellowtent/platformdata/postgresql/14

            Hope that these permissions don't bother us again in the future, and will soon try again to change the Default Data Directory.

            Thank you very much for your directory output and help.

            girishG Offline
            girishG Offline
            girish
            Staff
            wrote on last edited by
            #5

            @rnphil did you get a chance to see the permissions before you ran the commands? wonder what went wrong.

            R 1 Reply Last reply
            0
            • girishG girish has marked this topic as solved on
            • girishG girish

              @rnphil did you get a chance to see the permissions before you ran the commands? wonder what went wrong.

              R Offline
              R Offline
              rnphil
              wrote on last edited by
              #6

              @girish

              When we initially changed the default data directory and restarted the entire Cloudron server, something went wrong. As a hotfix, we applied some basic permissions, which probably broke PostgreSQL. However, we don’t know which permissions were wrong, as I didn’t log them at the time.

              This morning, we tried changing the default data directory again, but instead of restarting the whole Cloudron, we restarted all services individually, and this time we didn’t get any errors.

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • Bookmarks
              • Search