Hm sounds like that’s not the right file to check … Re-reading the previous posts, can you try to :
systemctl restart postgresql@9.6-main.service
systemctl status postgresql@9.6-main.service | cat
(notice the | cat at the end of the second command which is a trick to prevent systemctl from truncating the output where the precious info is hiding…)
root@my:~# systemctl restart postgresql@9.6-main.service
Job for postgresql@9.6-main.service failed because the control process exited with error code.
See "systemctl status postgresql@9.6-main.service" and "journalctl -xe" for details.
root@my:~# systemctl status postgresql@9.6-main.service | cat
● postgresql@9.6-main.service - PostgreSQL Cluster 9.6-main
Loaded: loaded (/lib/systemd/system/postgresql@.service; disabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Wed 2019-03-06 06:56:33 UTC; 26s ago
Process: 17352 ExecStart=postgresql@9.6-main --skip-systemctl-redirect 9.6-main start (code=exited, status=1/FAIL
URE)
Mar 06 06:56:02 my.domain.tdl systemd[1]: Starting PostgreSQL Cluster 9.6-main...
Mar 06 06:56:33 my.domain.tdl postgresql@9.6-main[17352]: The PostgreSQL server failed to start. Please check the l
og output.
Mar 06 06:56:33 my.domain.tdl systemd[1]: postgresql@9.6-main.service: Control process exited, code=exited status=1
Mar 06 06:56:33 my.domain.tdl systemd[1]: Failed to start PostgreSQL Cluster 9.6-main.
Mar 06 06:56:33 my.domain.tdl systemd[1]: postgresql@9.6-main.service: Unit entered failed state.
Mar 06 06:56:33 my.domain.tdl systemd[1]: postgresql@9.6-main.service: Failed with result 'exit-code'.
root@my:~#
root@my:~# journalctl -u postgresql@9.6-main
-- Logs begin at Thu 2019-03-07 07:26:06 UTC, end at Thu 2019-03-07 19:39:50 UTC. --
Mar 07 18:34:47 my.domain.tdl systemd[1]: Starting PostgreSQL Cluster 9.6-main...
Mar 07 18:35:18 my.domain.tdl postgresql@9.6-main[20117]: The PostgreSQL server failed to start. Please ch
Mar 07 18:35:18 my.domain.tdl systemd[1]: postgresql@9.6-main.service: Control process exited, code=exited
Mar 07 18:35:18 my.domain.tdl systemd[1]: Failed to start PostgreSQL Cluster 9.6-main.
Mar 07 18:35:18 my.domain.tdl systemd[1]: postgresql@9.6-main.service: Unit entered failed state.
Mar 07 18:35:18 my.domain.tdl systemd[1]: postgresql@9.6-main.service: Failed with result 'exit-code'.
lines 1-7/7 (END)
root@my:~# systemctl restart postgresql@9.6-main
Job for postgresql@9.6-main.service failed because the control process exited with error code.
See "systemctl status postgresql@9.6-main.service" and "journalctl -xe" for details.
root@my:~# journalctl -u postgresql@9.6-main
-- Logs begin at Thu 2019-03-07 07:26:06 UTC, end at Thu 2019-03-07 19:46:11 UTC. --
Mar 07 18:34:47 my.domain.tdl systemd[1]: Starting PostgreSQL Cluster 9.6-main...
Mar 07 18:35:18 my.domain.tdl postgresql@9.6-main[20117]: The PostgreSQL server failed to start. Please ch
Mar 07 18:35:18 my.domain.tdl systemd[1]: postgresql@9.6-main.service: Control process exited, code=exited
Mar 07 18:35:18 my.domain.tdl systemd[1]: Failed to start PostgreSQL Cluster 9.6-main.
Mar 07 18:35:18 my.domain.tdl systemd[1]: postgresql@9.6-main.service: Unit entered failed state.
Mar 07 18:35:18 my.domain.tdl systemd[1]: postgresql@9.6-main.service: Failed with result 'exit-code'.
Mar 07 19:45:29 my.domain.tdl systemd[1]: Starting PostgreSQL Cluster 9.6-main...
Mar 07 19:46:00 my.domain.tdl postgresql@9.6-main[21072]: The PostgreSQL server failed to start. Please ch
Mar 07 19:46:00 my.domain.tdl systemd[1]: postgresql@9.6-main.service: Control process exited, code=exited
Mar 07 19:46:00 my.domain.tdl systemd[1]: Failed to start PostgreSQL Cluster 9.6-main.
Mar 07 19:46:00 my.domain.tdl systemd[1]: postgresql@9.6-main.service: Unit entered failed state.
Mar 07 19:46:00 my.domain.tdl systemd[1]: postgresql@9.6-main.service: Failed with result 'exit-code'.
lines 1-13/13 (END)
Meeeh, I don’t understand why this is so complicated to find the appropriate log file … Yet it would be useful to know this for the future Also I don’t think reinstalling the app is gonna solve this …
Anyway … What about if you do :
systemctl restart postgresql@9.6-main # Just to retrigger the error
root@my:~# systemctl restart postgresql@9.6-main # Just to retrigger the error
Job for postgresql@9.6-main.service failed because the control process exited with error code.
See "systemctl status postgresql@9.6-main.service" and "journalctl -xe" for details.
root@my:~# ls -thor /var/log | tail -n 10
-rw-r----- 1 root 244K Mar 8 00:26 mail.warn
-rw-r----- 1 root 13K Mar 8 00:29 mail.log
-rw-r----- 1 root 861K Mar 8 00:29 mail.info
-rw-r----- 1 root 8.5K Mar 8 00:32 debug
-rw-r----- 1 root 24K Mar 8 00:32 fail2ban.log
-rw-rw-r-- 1 root 1.9K Mar 8 01:00 wtmp
-rw-rw-r-- 1 root 292 Mar 8 01:00 lastlog
-rw-r----- 1 root 264K Mar 8 01:00 auth.log
-rw-r----- 1 root 13M Mar 8 01:03 syslog
-rw-r----- 1 root 13M Mar 8 01:03 daemon.log
root@my:~#
root@my:~# /usr/lib/postgresql/9.6/bin/postgres -D /var/lib/postgresql/9.6/main -c config_file=/etc/postgresql/9.6/main/po
stgresql.conf
"root" execution of the PostgreSQL server is not permitted.
The server must be started under an unprivileged user ID to prevent
possible system security compromise. See the documentation for
more information on how to properly start the server.
root@my:~#
You know i had trouble with root and admin privileges on my armbian/Yunohost/ cubietruck image based system during the the yunohost installation in the first place – did the last updates change anything in this diction dealing with PostgreSQL?
admin@my:~$ /usr/lib/postgresql/9.6/bin/postgres -D /var/lib/postgresql/9.6/main -c config_file=/etc/postgresql/9.6/main/p
ostgresql.conf
LOG: skipping missing configuration file "/var/lib/postgresql/9.6/main/postgresql.auto.conf"
2019-03-08 07:14:43.302 UTC [29577] FATAL: data directory "/var/lib/postgresql/9.6/main" has wrong ownership
2019-03-08 07:14:43.302 UTC [29577] HINT: The server must be started by the user that owns the data directory.
admin@my:~$