Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/Contributing.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,7 @@ specify the user and database name and run it as user `postgres`:

[source,sh]
----
sudo sudo -u postgres openqa-setup-db your_username openqa-local`
sudo su -u postgres openqa-setup-db your_username openqa-local
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
sudo su -u postgres openqa-setup-db your_username openqa-local
sudo -u postgres openqa-setup-db your_username openqa-local

or (if really needed)

Suggested change
sudo su -u postgres openqa-setup-db your_username openqa-local
sudo su - postgres openqa-setup-db your_username openqa-local

su does not have -u option

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

personally I use sudo -u postgres and I would have remove the su but it is another reference which give the command as sudo su -u postgres. https://github.com/os-autoinst/openQA/pull/6665/files#diff-4d6d1050121df87969e32770abd50500a1fbda9f136db4fbb374fe05a236f2c2R393

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the reference you are mentioning gives sudo su - postgres, the missing u is not a typo 😉

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why not just using the sudo -u postgres?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The sudo sudo -u postgres command is useful if you're not already root. If you just run sudo -u postgres as your normal user you might be prompted for the password of the postgres user (depending on the sudo configuration) which you probably wouldn't know.

----

NOTE: To remove the database again, you can use e.g. `dropdb openqa-local` as
Expand Down