starting confluence as root
Asked by Julio Valdez:

Hi,

I receive the following after attempting to start confluence as root. What are my options so I can start confluence?

[root@xxxxx%](mailto:root@xxxxx%) start-confluence.sh

To run Confluence in the foreground, start the server with start-confluence.sh -fg  
executing using dedicated user: confluence  
/sbin/runuser: user confluence does not exist  
You have mail in /var/spool/mail/root

Thank You


Answers:
author: Higashi
body: Never start an service as root, as this is secrity risk.

create dedicated unprivilaged user for your service:

```
root@localhost ~]# adduser confluence
```

change ovnership of confluence files to this user:

```
root@localhost ~]# chown -R confluence:confluence /opt/atlassian-confluence
```

where /opt/atlassian-confluence is path where you have your service installed. Do the same ownership change to the confluence data directory.

Than start confluence, as usual.

You can also modifiy "start-confluence.sh" script to run as a root, but I would strongly discouraged it.

Confluence 4.3 script is based on variable $CONF_USER, that is set by user.sh so you might want to change it. On conflu 4.3 it looks like this:

```
root@localhost ~]# cat user.sh # START INSTALLER MAGIC ! DO NOT EDIT !CONF_USER="confluence" ### END INSTALLER MAGIC ! DO NOT EDIT !export CONF_USER
```

so setting it to root would solve this, but I wouldn't do it if I were you.   

comments: author: Milan
body: Doesn't help me :-(

\[root@mdb4 bin\]# ls -la start-confluence.sh

-rwxr-xr-x 1 confluence confluence 1275 Oct 18 02:51 start-confluence.sh

\[root@mdb4 bin\]# /opt/atlassian/confluence/bin/start-confluence.sh

To run Confluence in the foreground, start the server with start-confluence.sh -fg

executing using dedicated user: confluence

bash: /opt/atlassian/confluence/bin/startup.sh: Permission denied


author: Higashi
body: Milan, just as Henrique Lechner said:

make sure that every bash script in /opt/atlassian/confluence/bin/ is exectutable. To do so, you can add -x flag to those files:

chmod +x /opt/atlassian/confluence/bin/\*sh

You start confluence by executing *start-confluence.sh* but this script will execute other scripts. ex.: *catalina.sh* , *startup.sh*. so they must be also executable.


author: thehallofshields
body: I've tried chmod on both root and confluence and still get permission denied. This is on CentOS 6.7. Any suggestions?


author: Karol Kapica
body: Hi,

Do you know how to change a root user on the Windows system?

Cheers,

Karol


author: HenriqueA
body: Hi Milan Ristic,

Looks like you do have permission over start-confluence.sh but you still don't have it over "/opt/atlassian/confluence/bin/startup.sh" which is called by the first.

Could you please verify if the file have the confluence as owner and if it has the permission 755 (-rwxr-xr-x)?

If not, just execute these commands as root:

# chmod 755 /opt/atlassian/confluence/bin/startup.sh

# chown -R confluence:confluence /opt/atlassian/confluence

The first command will change the permission of the file and the second will re-apply user and group "confluence" to all files on your instance.

Regards,

Henrique Lechner


Tags: confluence-administration