JBoss user permissions - linux

I've upgraded from JBoss EAP 6.2.0GA to 6.3.0GA, and run into this problem after installing ActiveMQ as an embedded module. The same configuration is working on my Windows computer, so I believe it is some sort of CentOS permissions issue.
INFO [org.apache.activemq.store.SharedFileLocker] (Starting ActiveMQ Broker) Database activemq-data/kahadb/lock is locked... waiting 10 seconds for the database to be unlocked. Reason: java.io.IOException: Failed to create directory 'activemq-data/kahadb'
Note that it has no problem writing logs or anything. It's just this damn activemq related permission.
The issue only occurs if I run it as a service.
i.e.
service jboss-as start
If I run bin/standalone.sh & it works fine.
I've given the jboss.jboss user ownership over everything related to JBoss now, and chmod is 755 for everything. (There's a lot of confusing info about jboss:jboss or jboss.jboss to refer to the user in the jboss group. But neither works.)
chown -fR jboss.jboss /usr/share/jboss-eap-6.3/
chown jboss.jboss /usr/share/jboss-as
chown jboss.jboss /etc/init.d/jboss-as
chown jboss.jboss /etc/jboss-as/jboss-as.conf
I've done
ln -s -T /usr/share/jboss-eap-6.3 /usr/share/jboss-as
ln -s -T /usr/share/jboss-eap-6.3/bin/init.d/jboss-as-standalone.sh /etc/init.d/jboss-as
ln -s -T /usr/share/jboss-eap-6.3/bin/init.d/jboss-as.conf /etc/jboss-as/jboss-as.conf
My mgmt-groups.properties has:
jboss=jboss, admin, SuperUser
not that I know particularly how this helps.
My mgmt-users.properties has:
jboss=6ca43af9943e59f1563a1ff04472a8f9
suggesting that add-user.sh did something.
I haven't edited standalone.xml with regards to security or permissions.
grep 'jboss' /etc/group
shows:
jboss:x:502:
Anyone ?

Ok, worked it out from turning on the DEBUG logs and stepping through.
The difference is that when you do service X start, it is running it from /etc/rc.d/init.d/ directory, instead of when you do it directly, where it's running it from the /bin/ directory.
[org.apache.activemq.broker.BrokerService] (Starting ActiveMQ Broker) Using Persistence Adapter: KahaDBPersistenceAdapter[/etc/rc.d/init.d/activemq-data/kahadb]
ESC[0mESC[0m13:31:46,998 INFO [org.apache.activemq.store.SharedFileLocker] (Starting ActiveMQ Broker) Database activemq-data/kahadb/lock is locked... waiting 10 seconds for the database to be unlocked. Reason: java.io.IOException: Failed to create directory 'activemq-data/kahadb'
So this worked:
chown -R jboss.jboss /etc/rc.d/init.d/
chmod -R 755 /etc/rc.d/init.d/

Related

Gave nobody user owner ship of directory, now missing. Can I revert back by just doing the opposite command?

I upgraded my server from easy apache 3 to 4 and gained some permission issues, I ran:
chown -R nobody /home/myuser/public_html
in the server, which corrected this, now that directory is no where to be seen on cpanel but the site is still live.
Can I put the directory back but simply using:
chown -R myuser /home/nobody/public_html when ssh'd in as root?
Self managed server so my host won't help me.
Thanks Brad
Yes, you can change the permission using below command.
chown -R myuser /home/myuser/public_html

Elasticsearch: Change permissions of old folder index to work with yum-installed elasticsearch

I used a specific library that used an embedded version of elasticsearch. Now as we are growing, I want to start elasticsearch as a service.
I followed this guide to install it using yum on a linux machine. I pointed ES to the new directory using
path:
logs: /home/ec2-user/.searchindex/logs
data: /home/ec2-user/.searchindex/data
When I start the service
sudo service elasticsearch start
I get a permission denied error:
java.io.FileNotFoundException: /home/ec2-user/.searchindex/logs/elasticsearch_index_search_slowlog.log (Permission denied)
at java.io.FileOutputStream.open0(Native Method)
....
I guess this has to do with the folder permission, I changed folder permission using:
sudo chown elasticsearch:elasticsearch -R .searchindex
But that didn't help.
Any help?
Your user elasticsearch can't write in the logging folder : /home/ec2-user/.searchindex/logs
Check the permissions with ls -l
Set write permission with the chmod command :e.g. : sudo chmod -R u+wx .searchindex
The issue occurred because .searchindex is located in ec2-user directory which obviously is inaccessible by elasticsearch user created to manage the elasticsearch service.
Moving the folder to /var/lib/elasticsearch did the trick.

CentOS 7 Symfony 2 Unable to create the cache directory Issue [duplicate]

I've downloaded 2.0.4... I can't get pass the "can't create cache directory" cause of permissions problem...
I've tried chmod 777 -R symfony
-- to all folders, still can't create cache dir
I've tried setfacl but it says unrecognized -m option....
My system does not support chmod +a
I've done chown -R myuser:apache symfony
-- still nothing
I've tried umask(0000) and umask(0002) in console.php/app_dev.php/app.php
-- still nothing
When I refresh the page to http://localhost/symfony/web/app_dev.php, I get a SElinux alert... is this causing something? I'm not sure... all symfony content is word writable.
I'm not sure if it's me... but it's driving me nuts, maybe I just should stop using symfony2.
I'm using Fedora 13.
It seems that you will need to switch SELinux to Permissive state. You can do so executing as root user:
setenforce 0
PHP's umask may have no effect when default apache umask is different.
Originally I used to use setfact, but this adds overhead for deployment.
What worked for me on ubuntu servers is:
Set default apache umask.
Edit /etc/apache2/envvars and add this line in the end of file:
umask 0002
Reload apache service
Add your deploy user to www-data group, add www-data to your deploy user group.
adduser www-data `whoami`
adduser `whoami` www-data
Logout or restart server for this to take effect.
Remove app/cache, app/logs dirs
Try to load page in browser, notice how app/cache dir is created by www-data user and has write group permission. Try to clear cache in console and verify that no errors occurred.
Remove app/cache, app/logs dirs
Run cache:clear, notice how app/cache dir is created by user deploy user and has write group permission. Try to load page in browser, and verify that no errors occurred.
Now you can forget about cache and logs permissions on this particular server for all subsequent projects.

How to configure access permissions for Cassandra on Linux Ubuntu

Thank-you for reading this. I am stuck at step three on this tutorial pertaining to installing Cassandra: http://wiki.apache.org/cassandra/GettingStarted#Step_3:_Start_Cassandra
I can only run this software as root. (shouting this over fictional helicopter noise) This seem like a terrible way to run the software.
When starting the Cassandra server as my normal user I receive the following errors:
1.) 15:46:00,147 |-ERROR in ch.qos.logback.core.rolling.RollingFileAppender[FILE] - openFile(/var/log/cassandra/system.log,true) call failed. java.io.FileNotFoundException: /var/log/cassandra/system.log (Permission denied)
2.) ERROR 20:46:00 Doesn't have write permissions for /var/lib/cassandra/data directory
I tried changing the permissions several times and nothing has worked. I tried changing the /var/log/cassandra/system.log permissions for read/write for the cassandra group on the operating-system (OS). The command I used to do this was, sudo chmod 664 /var/log/cassandra/system.log. I found this page helpful in determining how to change the permissions:http://www.linux.org/threads/file-permissions-chmod.4094/
Then, I added my user-name to the cassandra group. From my understanding running the /usr/sbin/cassandra -f command as my user should allow me to access the /var/log/cassandra/system.log file, which would solve one of the errors, error number 1 above.
Respectfully,
user
Give the user you want permissions to the data and commitlog dirs.
sudo chown -R cassandra:cassandra /var/lib/cassandra/data
sudo chown -R cassandra:cassandra /var/lib/cassandra/commitlog
I found a solution! I ran sudo -u cassandra /usr/sbin/cassandra -f and then ran into problems with the commitlog directory Phact mentions in his answer. I then ran Phact's recursive chown command, sudo chown -R cassandra:cassandra /var/lib/cassandra/commitlog and the Cassandra server started up correctly just as it would if I was running the program as the root user. :D :D :D

Cherokee: accessing uwsgi configuration file

I'm running into a permissions problem with Cherokee+uWSGI on Ubuntu Server 13.10 intended for a Django production environment. When I start uWSGI manually as root user prior to launching cherokee, everything goes smooth:
sudo uwsgi --ini /home/instytut21/instytut21l/instytut21/uwsgi.ini
But when I try to access the site through the server (running as www-data) without that, I keep getting a 503 Service Unavailable response and the following message in the logs:
sudo cat /var/log/cherokee/instytut21.error.log
realpath() of /home/instytut21/instytut21.pl/instytut21/uwsgi.ini failed:
[core/utils.c line 3574]
I've spent a good while trying to figure out what causes the problem. I've tried giving ownership to $USER:www-data and www-data:www-data with all kinds of file permissions ranging from 600 to 777.
I don't want to run the server as root for security reasons. How can I make the ini file accessible to cherokee?
I finally found a solution to a similar problem at www-data permissions? . I slightly modified it and solved my problem by executing the following commands.
Own the whole directory by me and group www-data:
sudo chown -R $USER:www-data /home/instytut21/instytut21.pl/
Grant all permissions to the group:
sudo chmod -R g+rwx /home/instytut21/instytut21.pl/
Ensure all uploaded filed get the same permissions:
sudo chmod -R g+s /home/instytut21/instytut21.pl/

Resources