Chown: filebeat.yml: operation not permitted - mysql

I started learning how to code two months ago, so everything is very new to me. Currently I'm trying to learn how to use logstash from the elastic website (learning how to move from mysql to elasticsearch using logstash). I've got some problems and I don't know how to solve this issue:
I tried to follow the instructions from the link:
https://www.elastic.co/guide/en/logstash/current/advanced-pipeline.html
and
https://www.elastic.co/guide/en/beats/libbeat/6.4/config-file-permissions.html
After I tried:
sudo ./filebeat -e -c filebeat.yml -d "publish"
I've got an error message saying:
"config file ("filebeat.yml") must be owned by the beat user (uid=0) or root"
So I tried
"chown 0 filebeat.yml" and "chown root filebeat.yml"
But it says : "chown: filebeat.yml: Operation not permitted"
How can I solve this problem?
I've also tried to use
"--strict.perms=false"
but it says "-bash: --strict.perms=false: command not found"
Can anyone please help me with this?

Try sudo -i enter your password root and run as it again

sudo ./filebeat -e --strict.perms=false
This starts filebeat with the flag "--strict.perms=false" set at start.

Related

Report generating test failed

I've been trying to make scheduled reports with zabbix 5.4 but i keen getting the following error when i try to test:
Cannot fetch data: chrome failed to start:
Sorry, home directories outside of /home are not currently supported.
See https://forum.snapcraft.io/t/11209 for details.
.
I don't know where my errors lay. i installed google chrome and i followed all the instruction and created /var/lib/zabbix/ also chown zabbix:zabbix /var/lib/zabbix/ chmod 755 /var/lib/zabbix
but nothing .please help me i you know my error
I forgot to create a Zabbix user with a directory, that's why I got this kind of error.
addgroup --system --quiet zabbix
adduser --quiet --system --disabled-login --ingroup zabbix --home /var/lib/zabbix --no-create-home zabbix

ERROR! The server quit without updating PID file on El captian

I have problem mysql starting, i was update to El captian on mac.
In terminal,
brew install mysql
mysql.server start
but it not working
this is error message.
Starting MySQL... ERROR! The server quit without updating PID file(/usr/local/var/mysql/Heo-MacBook-Pro.local.pid).
help me please!
I had the same problem using brew command to start mysql service.
If you are using MacOS, go to System Preferences and click on MySQL icon. Probably you'll see information message about permission denied in some directories. All you need to do is to give permission to that.
That's worked for me.
Open your terminal
Execute this command: sudo chown -R mysql /usr/local/mysql/data
Try this first:
/usr/local/var/mysql/support-files/mysql.server restart
If that doesn’t fix
Remove or backup the /etc/my.cnf
also try this method:
sudo /usr/local/var/mysql/support-files/mysql.server start
Starting MySQL
. ERROR! ....................
remove the .err files like so:
rm *.err /usr/local/var/mysql/data/
Solution working for my case:
Check your error log at /usr/local/var/mysql/Heo-MacBook-Pro.local.err
If there is something like this in the log: ...[Note] Unable to delete pid file: Permission denied..., which means mysql does not have the permission to your mysql folder
Use the following command in terminal to grant the permission: sudo chown -R mysql /usr/local/var/mysql/
The Problem could also be a version mismatch. My db was installed with Homebrew as version 5, later unintentionally upgraded to version 8.
Check the most recent error log at /usr/local/var/mysql/<your-computers-name.some.domain>.err
You can conveniently read the last couple of lines (e.g. 40) of the file with tail -n 40 <your-computers-name.some.domain>.err
You may find a hint about upgrading istructions in this case.

add services to init.d on Ubuntu

I'm trying to simplify commands on my ubuntu server.
For now, to start / stop / restart apache2, we have to type those commands :
stop : /etc/apache2/bin/apachectl -k stop
start : /etc/apache2/bin/apachectl -f /usr/local/apache2/conf/httpd.conf
restart : /etc/apache2/bin/apachectl restart
and kinda same for MySql :
stop : mysqladmin -u root shutdown
start : mysqld_safe --user=mysql --log &
What I wish is to be able to use /etc/init.d/apache2 start or /etc/init.d/mysql start to make it simple and not having to always look at the Wiki to find the exact command to use each time...
I tried to find samples of files to put in init.d folder, but found nothing.
I also wanted to know how to do the same with service apache2 start (and same for stop/restart and MySql).
Is there a difference between using /etc/init.d/xx start and service xx start ?
Thanks for you help !
Just put the executable file i.e apachectl in /etc/init.d/ and than try with /etc/init.d/apache{tab} restart/start/stop and all for mysql too it will work.
Actually init.d contains the shell script file that is executable.
Take care the file should be executable like below
chmod +x /etc/init.d/apachectl

Permission denied errors when creating app with custom OpenShift cartridge

I'm using OpenShift Origin and developing a cartridge for the first time. When my bin/install and bin/control scripts are running I've noticed "Permission denied" errors when they try to access anything in the cartridge usr dir. In the node platform.log I see the offending command that OpenShift runs looks like this (where my bin/control start tries to run a script in usr):
/sbin/runuser -s /bin/sh 5351e627ee5a934f290001d2 -c "exec /usr/bin/runcon 'unconfined_u:system_r:openshift_t:s0:c0,c1004' /bin/sh -c \"set -e; /var/lib/openshift/5351e627ee5a934f290001d2/mycart/bin/control start \""
Since the usr dir is a symlink I originally thought it was related to that, but now I think it's related to selinux (which I don't know much about). If I do a "ls -Z" on my app's cartridge dir the files are "system_u:object_r:openshift_var_lib_t:s0:c0,c1004" but the contents of the usr dir are "unconfined_u:object_r:default_t:s0", so it doesn't match what's in the above command.
I used the oo-admin-cartridge command to install the cartridge to my Origin VM.
Any ideas on how to fix this?
What I ended up doing was running "chcon -R -u system_u -t bin_t usr/" before installing the cartridge with oo-admin-cartridge. Built-in cartridges are not affected by this problem (checked nodejs), so I feel like it might be a oo-admin-cartridge bug. I would expect it to massage the selinux permissions instead of using whatever I provide.

Something goes wrong with the SSH while setting up hadoop

I'm a new fish for hadoop.I installed Ubuntu 12.10 on my computer and I wanna install Hadoop in pseudo-distributed mode on one single node.I searched and get lots of tutorials but I have a problem with the SSH.I did what the tutorial said.
I am sure the problem is about the SSH.I get the openssh-server,and had done this:
hadoop00#WebsoftStation:~$ssh-keygen -t dsa -P "" -f ~/.ssh/id_dsa
hadoop00#WebsoftStation:~/.ssh$cat ~/.ssh/id_dsa.pub >> authorized_keys
Then I can successfully ssh my localhost like this:
hadoop00#WebsoftStation:~$ssh localhost
It worked.
So I changed the path to hadoop and then:
hadoop00#WebsoftStation:/usr/local/hadoop$ sudo bin/start-all.sh
[sudo] password for hadoop00:
starting namenode, logging to /usr/local/hadoop/libexec/../logs/hadoop-root-namenode-WebsoftStation.out
root#localhost's password:
root#localhost's password: localhost: Permission denied, please try again.
So,what's the problem?
You have setup password-less ssh for only your current account. Since, when you can use ssh localhost without any problem, the thing you need to do next is giving execution permission to your scripts.
Execute the following commands:
chmod +x bin/*.sh ---> assigns execution permission to all the scripts
./start.all ----> executes the script
Note: Hadoop can also be run without having password-less ssh setup using hadoop-daemon.sh script. The only advantage with password-less ssh is that, the ./start.all, script will take the trouble of doing that on behalf of you in each of the nodes.
You need to change permissions for your Hadoop folder to be owned by the hadoop00 user:
cd /usr/local/
sudo chown -R hadoop00:hadoop00 /usr/local/hadoop
Then you can cd into the sbin folder and run things without sudo. If you use sudo you're running the scripts as root which has different environment variables etc which is why you have a different behavior.
Why are you using sudo this is clearly a permission problem.
Try running this without sudo
bin/start-all.sh