User Tools

Site Tools


howto:setting_up_a_postgresql_database_for_rts2

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Last revisionBoth sides next revision
howto:setting_up_a_postgresql_database_for_rts2 [2011/12/08 13:52] – [How to set up a PostgreSQL database for RTS2] wildihowto:setting_up_a_postgresql_database_for_rts2 [2017/04/05 12:18] – [Setting up RTS2 users] jtello
Line 2: Line 2:
  
   * Install PostgreSQL server, on Debian something like    * Install PostgreSQL server, on Debian something like 
-<xterm2>sudo apt-get install postgresql-server</xterm2> +<code><xterm2>sudo apt-get install postgresql-server</xterm2></code>
   * Create database user - replace **user** with your username:   * Create database user - replace **user** with your username:
-<xterm2>+<code><xterm2>
 user@host:~$ sudo su postgres user@host:~$ sudo su postgres
 [sudo] password for user: [sudo] password for user:
Line 10: Line 10:
 Shall the new role be a superuser? (y/n) y Shall the new role be a superuser? (y/n) y
 USER CREATED USER CREATED
-</xterm2>+</xterm2></code>
   * see remark below, if necessary: ALTER USER user WITH PASSWORD 'password';   * see remark below, if necessary: ALTER USER user WITH PASSWORD 'password';
   * Currently if you would like to run RTS2 services like **XML-RPCd** or **EXECUTOR**, you will need to add user **root** same way as above   * Currently if you would like to run RTS2 services like **XML-RPCd** or **EXECUTOR**, you will need to add user **root** same way as above
   * As user postgres    * As user postgres 
-<xterm2> createdb stars +<code><xterm2> createdb stars 
-</xterm2>+</xterm2></code>
   * Create RTS2 databases. Please see src/sql/README, and run (replaces stars in this and bellow if you would like to use other name for the database):   * Create RTS2 databases. Please see src/sql/README, and run (replaces stars in this and bellow if you would like to use other name for the database):
-<xterm2>+<code><xterm2>
 user@host:~$ cd rts2/src/sql user@host:~$ cd rts2/src/sql
 user@host:~/rts2/src/sql$ ./rts2-builddb stars user@host:~/rts2/src/sql$ ./rts2-builddb stars
-</xterm2>+</xterm2></code>
   * Add users to group observers in database stars:   * Add users to group observers in database stars:
-<xterm2>+<code><xterm2>
 user@host:~$ psql stars user@host:~$ psql stars
 Welcome to psql 8.3.8, the PostgreSQL interactive terminal. Welcome to psql 8.3.8, the PostgreSQL interactive terminal.
Line 33: Line 33:
 GROUP ALTERED GROUP ALTERED
 stars=# stars=#
-</xterm2>+</xterm2></code>
   * Check is database is up and running - run rts2-xmlrpcd in interactive mode:   * Check is database is up and running - run rts2-xmlrpcd in interactive mode:
-<xterm2>+<code><xterm2>
 user@host:~$ sudo rts2-xmlrpcd -i user@host:~$ sudo rts2-xmlrpcd -i
-</xterm2>+</xterm2></code>
  
 If it will run and not complain about database, then you setup data properly. If it will run and not complain about database, then you setup data properly.
Line 49: Line 49:
  
 To populate user tables, do: To populate user tables, do:
-<xterm2>+<code><xterm2>
 user@host:~$ psql stars user@host:~$ psql stars
 Welcome to psql 8.3.8, the PostgreSQL interactive terminal. Welcome to psql 8.3.8, the PostgreSQL interactive terminal.
Line 58: Line 58:
  \q to quit  \q to quit
 stars=# insert into users values ('rts2', 'rts2', NULL, 'rts2@example.com', 1); stars=# insert into users values ('rts2', 'rts2', NULL, 'rts2@example.com', 1);
-</xterm2>+</xterm2></code>
  
 Which will create user rts2, with password rts2. 1 is user ID, you of course would like to keep this unique, otherwise psql will complain. You can then user rts2 as login and rts2 as password for XML-RPC access through rts2-xmlrpcd Which will create user rts2, with password rts2. 1 is user ID, you of course would like to keep this unique, otherwise psql will complain. You can then user rts2 as login and rts2 as password for XML-RPC access through rts2-xmlrpcd
 +
 +Note it is likely the database was different when the previous instruction was written to the version when this next note was added:
 +Since the table headers are:
 +usr_login | usr_tmp |    usr_email     | usr_id | usr_execute_permission |                                             usr_passwd                                             | allowed_devices
 +to add a new user 'rts2' with password 'password' it should be:
 +<code> stars=# insert into users values ('rts2', , 'rts2@example.com', 3, f,'password',); </code>
 +
 +Also it is apparent passwords should be somehow hashed so this almost works but it doesn't.
howto/setting_up_a_postgresql_database_for_rts2.txt · Last modified: 2017/04/05 00:00 (external edit)