cancel
Showing results for 
Search instead for 
Did you mean: 

Alfresco can not start postgresql as root user

joost
Champ in-the-making
Champ in-the-making

Dearest alfresco-lovers,

Please can anyone help me ?

I can not start my alfresco install anymore. it gives:
"pg_ctl.bin: cannot be run as root
Please log in (using, e.g., "su") as the (unprivileged) user that will
own the server process.
/opt/alfresco/postgresql/scripts/ctl.sh : postgresql  could not be started"

I did a clean install on a(n other) test-ubuntu desktop as root, and it gives the same mistake during installation. This one was starting during boot-up, but i can not restart postgresql.

Then i did again a clean install on this test system, but now as user "postgres". Now alfresco was working fine but user postgres has to login, and has to manually start alfresco. I made my own alfresco-boot like I found here: "https://issues.alfresco.com/jira/browse/MNT-9912",  and put it in init.d, but no boot…

I have seeked for more the 6 hours how to manipulate postgresql so that it can start as root, but whith no result…

I hope anyone can help me, otherwise alfresco will lose a lover…

Joost van der Wulp from Belgium
http://vanderwulp.dynpc.org:8080/share
6 REPLIES 6

resplin
Elite Collaborator
Elite Collaborator
It is not recommended to run Alfresco as root. You would normally start Alfresco as an unprivileged user, and give it access to controlled ports using port redirection. If you really want to run as root, you need to edit the control scripts.

Are you trying to save your data, or just get a working install?

If you don't need to fix your current install, you can use the Ubuntu install script:

https://github.com/loftuxab/alfresco-ubuntu-install

Or you can configure Alfresco to use an external DB instead of the embedded PostgreSQL.

http://docs.alfresco.com/5.0/concepts/intro-db-setup.html

joost
Champ in-the-making
Champ in-the-making
Dearest Resplin,
thank you very much for your help. It is incredible kind of you you help me so much!
I am not saving data: I have all user in a CSV-file, and ihad a sync relation with a webdav-drive. It is because alfresco could do this, i am using alfresco !
I understand you say not to install as root, but if I install as other user, i can not load alfresco at boot. Tried everything, but no boot…

Now i have tried to install alfresco with the local Mysql. I had a lot of pain… could not log in, during login, got this message: The remote server is unavailable or your credentials were not recognized.

I found in logs:
12:05:04,862 ERROR [org.alfresco.repo.admin.ConfigurationChecker] [localhost-startStop-1] CONTENT INTEGRITY ERROR: System content not found in content store.
12:05:04,862 ERROR [org.alfresco.repo.admin.ConfigurationChecker] [localhost-startStop-1] Ensure that the 'dir.root' property is pointing to the correct data location.
12:05:04,871 ERROR [org.springframework.web.context.ContextLoader] [localhost-startStop-1] Context initialization failed
org.alfresco.error.AlfrescoRuntimeException: 00200001 Ensure that the 'dir.root' property is pointing to the correct data location.

so it has someething to do with the database. I deleted the database, and created a new one. Now it is working fine…

But alfresco is not loading @ startup. Do you know why ? Can you help me ?

Joost van der Wulp from Belgium

resplin
Elite Collaborator
Elite Collaborator
The error message says that the problem is not with the database, but with your content store. In your alfresco-global.properties, the dir.root property points to where your content is stored on disk, and this property is not pointing at a directory that matches your database.

1. Verify that the directory points to the correct location.
2. If you reinstalled to get a blank database, you should also clear that directory so it is empty and can be initialized.

This is a helpful list of common mistakes when administering Alfresco:

http://docs.alfresco.com/community/concepts/ten-mistakes.html

Useful documentation is here:

http://docs.alfresco.com/5.0/concepts/global-props-intro.html

doudou225
Champ in-the-making
Champ in-the-making
Hi dear. I want to do a simple backup of the postgresql database using the pg_dump command but i dont have permission to do so even with the sudo. I realise that i should to it with the postgres user. Whenever i change to the postgres user i am prompted for the password i dont know. Please tell me the default postgres user password. I am using alfresco 5 community edition. Or is there another way to do the backing up?

bdmc
Champ in-the-making
Champ in-the-making
If you want to log in to the postgres user, do the following:

sudo bash
su - postgres

That will only require your own password, and will not prompt for the postgres users's password.

Then, if you want to set, or reset, the postgres user's password, do the following after the "sudo bash", but before the "su - postgres":

passwd postgres

It will ask you for the new password twice, and then you are done.


Brian

eswbitto
Confirmed Champ
Confirmed Champ
@doudou225,

You should look in your alfresco-global.properties file "usually" the postgresql password is the same as your admin password.

You should also look at this.

http://fcorti.com/2013/02/06/alfresco-backup-script/