• 1

Multiple DB on a file system


I want to put multiple databases (Postgres, MySQL, etc) on a file system as a test (/db/postgres/data /db/mysql/...) but with selinux and the above info I can only do one. How is it possible to put multiple db's on / when it's context is root_t? Is there something magical about root_t that can only be used on /? Are there group contexts that can contain other contexts, say a db_root_t that contains postgresql_db_t and mysql_db_t (or what ever it uses)?



Re: Multiple DB on a file system

No this is actually a simple labelling issue.

I would set this up with labeling /db as var_t and then each directory with its postgres and mysql labels.

# semanage fcontext -a -t var_t '/db(/.*)?'
# semanage fcontext -a -t postgresql_db_t '/db/postgresql(/.*)?'
# semanage fcontext -a -t mysql_db_t '/db/mysql(/.*)?'
# restorecon -R -v /db

  • 1

Log in