This is mostly note to myself, when I will set this up for next time.
Every time I set up test environment for Gammu SMSD, I'm lost in PostgreSQL configuration. Simple reason is that I do not use it at all for any other reason.
Adding user and creating a database:
# su - postgres
postgres@rincewind:~> psql template1
psql (9.1.1)
Type "help" for help.
template1=# CREATE USER smsd WITH PASSWORD 'smsd';
CREATE ROLE
template1=# CREATE DATABASE smsd OWNER = smsd;
CREATE DATABASE
template1=# GRANT ALL PRIVILEGES ON DATABASE smsd TO smsd;
GRANT
template1=# \q
Next stem is to allow anybody to connect as smsd user. There might be better ways to do that, however I've chosen the simplest one - to trust any local connection - as testing of Gammu SMSD is anyway the only thing this database server does. Edit /var/lib/pgsql/data/pg_hba.conf
:
# "local" is for Unix domain socket connections only
local all all trust
# IPv4 local connections:
host all all 127.0.0.1/32 trust
# IPv6 local connections:
host all all ::1/128 trust
I suggest connecting to the postgres database instead of the template1 instead. The latter prevents other users - which you will not have I guess - from creating databases.