Hhvm Unable to read pid file /var/run/hhvm/pid for any meaningful pid after reboot - linux

I have hhvm installed on my server and it was working perfect until I had restart the server. On the log of hhvm i see this error:
Unable to read pid file /var/run/hhvm/pid for any meaningful pid
I tried to give permission to that file doing
sudo chmod +rw /var/run/hhvm/pid
bu still that problem occured. I really need to fix this issue but i have no idea what i have to do :(
any help will be really appreciated,
My OS is ubuntu 12.4

If HHVM isn't running, you can just delete that file. The error is saying that it doesn't contain a valid PID, most likely because it wasn't cleaned up properly on reboot so it still has the old PID in it.

I had the same problem. It turned out that another service was listening on port 9000.

Typical launch command:
hhvm --mode daemon -d hhvm.server.type=fastcgi -d hhvm.server.port=9000 -c /etc/hhvm/server.ini

Related

ubuntu backup-manager Permission denied

I've recently installed backup manager onto my ubuntu machine to have automated backup going. The problem is when I go to set up the automatization using this code -
it comes us up saying this "bash: /etc/backup-manager.sh: Permission denied"
I do not understand this error. I've tried change the user who read/writes to someone other than root and that didn't work. I tried changed the chmod number from 770 to 700 and still didn't work.
any info on this is welcome. Thank you to those who help :)
those wondering I am using this tutorial giving to me by the host. https://documentation.online.net/en/dedicated-server/tutorials/backup/configure-backup/start
I'm using the desktop version of ubuntu 16 incase that is needed
The sudo doesn't do what you want in this case. What happens is that the shell evaluates the redirection and attempts to open the /etc/backup-manager.sh for you before the sudo cat even gets started. That fails because the shell still runs as you unprivileged user. You have to say sudo -i to open a new root shell, execute the commands and exit again.
Alternatively you could try sudo nano /etc/backup-manager.sh and paste the contents there. This would work because the editor is run as root and does the file opening itself when you save.

PM2 - Autostart on Raspbian (Raspberry Pi) does not work

Ok guys,
this is driving me nuts... Can't get my nodejs application to autostart#boot on a raspberry pi...
Machine: Raspberry 2 (Raspbian Jessie)
Tried almost every possible solution I found on Google.
This is what I've ended up with:
Installed pm2
$ sudo npm install -g pm2
This will install it as a init.d script and run the application as pi user
$ sudo pm2 startup raspberry -u pi
[PM2] Generating system init script in /etc/init.d/pm2-init.sh
[PM2] Making script booting at startup...
[PM2] -raspberry- Using the command:
su -c "chmod +x /etc/init.d/pm2-init.sh && update-rc.d pm2-init.sh defaults"
[PM2] Done.
I've read that the script refers to the wrong .pm2 folder (looks in the root folder, not the user's folder) so I changed that
$ sudo vi /etc/init.d/pm2-init.sh
Changed export PM2_HOME="/root/.pm2" to export PM2_HOME="/home/pi/.pm2"
$ cd /opt/mycoolnodeproject
Starting my node project with pm2
$ pm2 start server.js -x --name "node-project"
Save active processes so it will restart them upon restart (if the pi crashes, it would save it on shutdown automatically)
$ pm2 dump
So now the server is up and running and works fine... until I reboot! I thought that pm2 would autostart my node application but for some reason it doesn't... :(
Any idea what the problem might be?
Btw: I've also tried to call startup like this sudo env PATH=$PATH:/usr/local/bin pm2 startup raspberry -u pi, but that didn't work either.
Regards,
Sascha
Mia's comment made me checking the issue list of PM2 again and someone figured out how to do it! :)
https://github.com/Unitech/pm2/issues/1654
The solution:
sudo pm2 startup systemd -u <username>
Works like a charm! :)
Sascha
I was able to get PM2 to start at bootup correctly on my RPi with this command:
sudo env PATH=$PATH:/usr/local/bin pm2 startup systemd -u pi --hp /home/pi
The --hp /home/pi part seemed to be the difference. That is what was left out of a lot of solutions I found that didn't work.
I also searched for days without success but then,
I got it to work quite simply.
In Raspian click Menu,Preferences,Main Menu Editor
Click Preferences and check Default applications for LXSession
Click OK and close main menu editor
Now click Menu and Under Preferences click on Default applications for LXSession
LXSession configuration opens
Click Autostart
Under Manual autostarted applications paste in your java command line
click add
close the LXSession configuration application and reboot your pi
your java app should run after reboot
Here's a workaround based on this article (the suggested workaround didn't help me):
Make a mini startup init.d script to resurrect the pm2 process yourself
#! /bin/sh
# /etc/init.d/pm2
#
# help documentation:
#https://debian-administration.org/article/28/Making_scripts_run_at_boot_time_with_Debian
pm2 resurrect
Make it executable
chmod 755 /etc/init.d/blah
Update system symbolic links
update-rc.d pm2 defaults
Reboot, go to your website (and look at the date; make sure it's not browser cached)
I'm going to describe the debug steps that led me to the solution, since I think that it can be usefull. If you just want the solution I invite you to go to the end of this answer.
Debug steps
In my case I was setting up pm2 startup like this:
sudo pm2 startup systemd -u pi
And it wasn´t working. pm2 just refused to start at boot. In order to know what was going on I followed this instructions.
Next I had a look at the systemctl units:
systemctl list-units
And saw this red line in the output
pm2-pi.service failed failed PM2 process manager
Then I had a look to the corresponding log (note the username at the end of the filename: pm2-pi)
journalctl -u pm2-pi
So the reason was that pi user had not enugh permissions to access the JSON module conf file.
May 28 12:36:52 raspberrypi pm2[534]: Error: EACCES: permission denied, open '/root/.pm2/module_conf.json'
Solution
I could have changed the json permissions but I decided to run PM2 as root user. If this is dangerous, please let me know.
sudo pm2 startup -u root
My issue was to do with user names, using root rather than my non-root user. I fixed it by editing the service file directly. There's probably a better way to fix it e.g. by running the startup command differently. But a simple work-around (manual file change) worked.
When I ran the startup command:
sudo pm2 startup systemd -u XXX
It created a file for the reboot service here:
/etc/systemd/system/pm2-XXX.service
In this file some of the paths are for root and not my user XXX:
Environment=PM2_HOME=/root/.pm2
PIDFile=/root/.pm2/pm2.pid
So I changed the paths to that of the correct user:
Environment=PM2_HOME=/home/XXX/.pm2
PIDFile=/home/XXX/.pm2/pm2.pid
And after a reboot the process starts up as expected.

pid file disappears after starting pgpool with ubuntu and postgresql

I´ve installed postgresql 9.1 on ubuntu 12.04 with pgpoolII-3.3.3 and pgPoolAdmin
If I try to run pgpool from a terminal with sudo pgpool it seems to start. Viewing ubuntu file explorer I can see how a pgpool.pid file is created at /var/run/pgpool/pgpool.id (this is the path in pgpool.conf)
But after one second the file disappears.
I have tried to change the owner of the directory and the directory permissions but nothing seems to fix it.
If after that I try to stop pgpool wiht sudo pgpool -m fast stop I got an error: Error. pid file not found
It seems like the file is created and suddenly destroyed. I´m wondering why.
If I try to run pgpool from pgPoolAdmin I got this error: pgpool start failed. pgpool.pid not found.
Like other times, it´s maybe and stupid issue and I´m not being able to solve it as i don´t have a high level of knowledge on those systems.
Any idea about what to try?
Xrry Christmas
Solved. I think the problem was caused by a permission problem. After trying
sudo mkdir /var/run/pgpool
sudo chmod 777 /var/run/pgpool
sudo chown postgres/postgres /var/run/pgpool
sudo postgresql service restart
It seems to be working now.
check the tmp directory using ls -la command and delete the file .s.PGSQL.9999 and .s.PGSQL.9898 and restart the server
Upon configuring PgPool-II, I found some documentation explaining that using the default directory /var/run/pgpool for the PID file was a bad idea, for that file could be erased when the service reboots.
The contents of the /var/run directory (including the pgpool
directory) may be removed by the operating system during a reboot. The
/var/run/pgpool directory should NOT be used as the location for the
pgpool.pid file.
The issue seems to occur when using Ubuntu.
So a possible solution would be to store the PID file in a directory named so as to not match the name of a service that could be rebooted. For instance, you could change the pgpool.conf file :
pid_file_name = '/var/run/pgpool4ever/pgpool.pid'
I could not try it on my own as I do not use Ubuntu, but maybe this could help someone facing a similar problem. Although I am not sure that it is very wise to go past basic Ubuntu way of working....

Error with Mongo starting Meteor

I am using a fresh Linux install. I am trying to install Meteor. Using Ubuntu 12.04, Centos and Ubuntu 13.04. I installed Node.js, Meteor and Meteorite.
Error:
Unexpected mongo exit code 100. Restarting.
Unexpected mongo exit code 100. Restarting.
Unexpected mongo exit code 100. Restarting.
Can't start mongod
MongoDB had an unspecified uncaught exception.
This can be caused by MongoDB being unable to write to a local database.
Check that you have permissions to write to .meteor/local. MongoDB does
not support filesystems like NFS that do not allow file locking.
I've tried:
Deleting .meteor/local/db/mongod.lock
Also I tried to change the permissions for the whole project with chmod.
Do you recommend any Ubuntu distribution?
Thanks in advance.
I have run in this problem before (after meteor update or abnormal meteor termination) and these solutions worked for me before.
Restart your machine.
Delete the file .meteor/local/db/mongod.lock and run meteor again.
Execute meteor reset and start again, but this command will erase your database.
Hope it helps.
It some time depends on your locale settings.
Meteor reset and delete mongod.lock didn't help in my case.
I've fixed it by running
export LC_ALL=C
you can add this line to
sudo vim /usr/local/bin/meteor
All I had to do was run "killall mongod" in the terminal. After that it worked again. I believe it may have cleared parts of the database though.
For me a combination of the suggestions worked out. The answer that has gotten 2 down votes! and this one from another page.
sudo vim /usr/local/bin/meteor
export LC_ALL="en_US.UTF-8"
then make sure which port your mongodb is running at by issuing the following:
meteor mongo
You will get a response like this:
connecting to: 127.0.0.1:3001/meteor
now that you know the port on which the mongo is configured, add the following to the same file we have been editing:
export MONGO_URL=mongodb://127.0.0.1:3001/meteor
Now you are good to go. Of course "meteor reset" works but if you dont want to loose your data, stick with those two export lines.
I have found that setting MONGO_URL helps avoid issue
export MONGO_URL=mongodb://localhost:27017/your_db
If you're having this issue running Ubuntu inside Vagrant/VirtualBox, then the problem come from working in the synced vagrant folder.
The workaround is to initialize the .meteor directory in the home directory and to mount it in the synced folder. Assuming your meteor app is called MyApp and the /vagrant is the synced folder, here's how to do it:
cd ~
meteor create MyApp
cd MyApp
meteor
cd /vagrant/MyApp
sudo mount --bind ~/MyApp/.meteor/ .meteor
meteor
I had a similar issue. It was due to the fact that my project directory was part of my Dropbox and there was some conflicted files in the .meteor/local/db directory. Removing these solved the problem.
I encounter the same issue when my disk space ran low.
Freeing up some space in the disk fixed the problem for me.
I encountered this problem when I ran meteor in VMWare, ubuntu 14.04 guest on a Windows 7 host. The problem was that I was running meteor/mongo in a shared directory. When I used a non-shared directory (~/meteor/project) the problem disappeared.
Following the steps that #Oscar mentions further up should sort you out.
However in my case meteor reset wouldn't work, telling me this:
reset: Meteor is running.
This command does not work while Meteor is running your application. Exit the running Meteor development server.
For which I tracked the process down, like this:
$ ps aux | grep meteor --color=auto
which gave me this info:
$ myUser 71981 0.5 0.0 2849208 3644 ?? S Mon02pm 4:25.27 /Users/myUser/.meteor/packages/meteor-tool/.1.1.10.1b51q9m++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/dev_bundle/mongodb/bin/mongod --bind_ip 127.0.0.1 --smallfiles --port 2001 --dbpath /Users/jgt/Documents/Projects/todos/.meteor/local/db --oplogSize 8 --replSet meteor
As you can see I'm on Mac, but this works fine on any Unix based OS.
So then you only need to kill the process by it's id, like this:
$ kill -9 71981
And finally run again meteor reset
That's it, got it working now. Hope it helps.
One option is to wait until you have your app on a staging or production server, and then test it on an Android emulator provided by Android Studio or BlueStacks.
I am having this issue on WSL for Ubuntu on Windows. The only solution that worked for me was creating a remote mongodb with mLabs and ran the following
export MONGO_URL=mongodb://username:password#randomurl.mlab.com:port#/project
Recently I got the same case, which I run meteor on WSL for Ubuntu on windows 10. I resolved this case by updating WSL to version 2.
Note :
Make sure your Windows build is higher than the minimum WSL 2 requirements. And don't forget to set version 2 as WSL default version after updating.
wsl --set-version [linux_dist] 2
For windows 10, I moved all my Meteor projects in drive C. So far working.

Can't launch sonar 2.8 (permission denied to execute wrapper )

I'm new to Sonar, and i was trying to install Sonar 2.8 on my server (Linux 64 on HP-UX)
When i tried to launch it (sonar.sh start) i got the following message
[myHomeDirectory]/sonar/2.8/bin/linux-x86-64/./wrapper: Execute permission denied.
what drives me crazy is that i've putthe whole package on 777 permissions, so i really don't understand what's exactly happening.
Can anyone help with this please ?
Thanks in advance !
I hit a similar issue hence why I came to this post. I was attempting to install SonarQube's scanner in a Docker container but when I was running it, I was getting something along the lines of:
/root/sonar-scanner-2.6.1/bin//sonar-scanner: 103: exec: : Permission denied
I had given the whole /root/ folder all permissions so I was curious about the permission denied. In the end for me it wasn't anything to do with permissions. I simply needed to RTFM.
Sonar-scanner needs a JRE to run and my Docker container didn't have one installed. So if anyone else does the same thing as me, I hope this saves you a few minutes of head scratching.
Not really convinced in the way you are launching it. To get Sonar running I recommend running it on tomcat, providing you just want to use the default database that comes with Sonar. The steps would be:
Install Tomcat
Navigate to your /war directory within your sonar instance and run the command: $] ./build-war.sh.
When this finishes you should see a sonar.war file in the same directory.
Rename the war file ROOT.war instead of sonar.war: $] mv sonar.war ROOT.war
This ensures that sonar runs on tomcat's default port.
Move the war file into the tomcat webapps directory: $] mv ROOT.war /tomcathome/webapps
Navigate to the tomcat /bin folder and run the command $] ./catalina.sh start
Type your server hostname in your browser with a port :8080 at the end and you should see sonar running.
These steps will have sonar running on the default database, though. If you want a MySQL database i'd look at sonar tutorials on how to do that.
I finally came out with the conclusion that the binary file (wrapper) is simply not compiled to run under HP-UX
when launching a file command on wrapper under a Linux i get : <ELF-64 executable object file> which doesn't match the <ELF-64 executable object file - IA64> required by HP-UX running on a Itanium processor
Please check if you have java installed on the machine. Java should be installed on the machine before running sonar-runner.
Use this to check java : java -version

Resources