Hello,
I'm trying to run Postgresql on an Odroid-XU4 board.
I moved the database from /var/lib/postgres/data to /home/postgres/data
Here is what I have:
$this->bbcode_second_pass_code('', '$ ls -l /home/postgres
total 0
drwx------ 1 postgres postgres 456 Mar 25 21:49 data')
The database has been initialized with:
$this->bbcode_second_pass_code('', 'initdb --locale $LANG -E UTF8 -D '/home/postgres/data'')
And correctly built:
$this->bbcode_second_pass_code('', '$ sudo ls /home/postgres/data
[sudo] password for albator:
base pg_clog pg_dynshmem pg_ident.conf pg_multixact pg_replslot pg_snapshots pg_stat_tmp pg_tblspc PG_VERSION postgresql.auto.conf
global pg_commit_ts pg_hba.conf pg_logical pg_notify pg_serial pg_stat pg_subtrans pg_twophase pg_xlog postgresql.conf')
I have copied the /usr/lib/systemd/system/postgresql.service to /etc/systemd/system/postgresql.service and edited it to change the default PGROOT and PIDFile paths.
I start the service with:
$this->bbcode_second_pass_code('', '$ sudo systemctl start postgresql.service')
and I always get:
$this->bbcode_second_pass_code('', '$ sudo journalctl -xe
Mar 25 22:09:49 arcadia systemd[1]: Starting PostgreSQL database server...
-- Subject: Unit postgresql.service has begun start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit postgresql.service has begun starting up.
Mar 25 22:09:49 arcadia postgres[1403]: "/home/postgres/data" is missing or empty. Use a command like
Mar 25 22:09:49 arcadia postgres[1403]: su - postgres -c "initdb --locale en_US.UTF-8 -D '/home/postgres/data'"
Mar 25 22:09:49 arcadia postgres[1403]: with relevant options, to initialize the database cluster.
Mar 25 22:09:49 arcadia systemd[1]: postgresql.service: Control process exited, code=exited status=1
Mar 25 22:09:49 arcadia systemd[1]: Failed to start PostgreSQL database server.
-- Subject: Unit postgresql.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit postgresql.service has failed.
--
-- The result is failed.
Mar 25 22:09:49 arcadia systemd[1]: postgresql.service: Unit entered failed state.
Mar 25 22:09:49 arcadia systemd[1]: postgresql.service: Failed with result 'exit-code'.
Mar 25 22:09:49 arcadia sudo[1399]: pam_unix(sudo:session): session closed for user root
Mar 25 22:10:01 arcadia sudo[1413]: albator : TTY=pts/0 ; PWD=/home/albator ; USER=root ; COMMAND=/usr/bin/journalctl -xe
Mar 25 22:10:01 arcadia sudo[1413]: pam_unix(sudo:session): session opened for user root by albator(uid=0)')
One last thing: if I keep the data in /var/lib/postgres/data, it works.
Did I miss something?
Thanks in advance for your help!