Fabric and init - init

I am using fabric to restart tomcat and even though it says tomcat restarted successfully it does not. So, as per the FAQ, I set pty=False and tried again. But, now, I get this error:
sudo: /etc/init.d/tomcat restart
out: sudo: sorry, you must have a tty to run sudo
Any ideas around this problem?

To anyone reading this, this is not a problem with fabric but with the way sudo accounts have been set up. This property in /etc/sudoers file controls this;
Defaults requiretty

Related

LDAP breaks after upgrading to stream

so I just started upgrading all of our centos 8 servers to centos stream and the first one seemed to go pretty smoothly with just these commands:
dnf install centos-release-stream
dnf swap centos-{linux,stream}-repos
dnf distro-sync
but then when I tried to log in with my AD creds it wouldn't let me in. I already tried rejoining the domain and making sure my creds are still good. The only error is in the messages log which says:
Credentials cache I/O operation failed I found something that says it's because the cache files don't exist in /tmp so I copied them over from one of my other servers but still no luck. No other errors or anything useful in other log files just incorrect password logs in secure. I was just wondering if anyone else has run into this issue.
systemctl stop sssd-kcm
rm /var/lib/sss/secrets/*
systemctl start sssd-kcm

Mongodb: How to auto restart on crashes?

I'm using Ubuntu 18.04 & Mongodb 3.2.22.
Now, I want to make sure that it'll be always up and running (if it crashes - auto restart).
I searched for a solution and noticed that some people uses respawn on a file named /etc/init/mongodb.conf. The thing is, I don't have this file.
Currently when I want to restart I use sudo service mongod restart.
Any idea how to accomplish that?
if you have set it up via apt, then the systemd service file should be at /etc/systemd/system/multi-user.target.wants/mongodb.service.
Under ther service tab in the file, add "Restart=always" and do a systemctl daemon-reload

Stuck in starting meteor

This is really frustrating me. I have a DO VPS with ubuntu 14.04 (64) installed.
I installed VestaCP as control panel on that and have hosted some PHP based personal project.
I also installed meteor on it but never used, now when I am trying to create a project and run it ('meteor create rt' then 'cd rt' then 'meteor')
It is giving the following error :
[[[[[ /home/admin/code/rt ]]]]]
=> Started proxy.
Unexpected mongo exit code 1. Restarting.
Unexpected mongo exit code 1. Restarting.
Unexpected mongo exit code 1. Restarting.
Can't start Mongo server.
root#RD:/home/admin/code/rt#
Could anyone please help? Please ask me for more informations if required.
**** EDIT ****
I created a fresh DigitalOcean server and it is giving the same error on that. Some issue with Digital Ocean? File System of Digital Ocean? I am confused. I am trying it on different flavours of Linux and same result. All are fresh linux installations.
I finally got the solution. Posting it here for others.
This was the problem as a few environment variables which mongodb looks for while starting was not set
Set the variables LC_ALL and LANG and it works fine (mostly setting LC_ALL will do)
first, type locale command and see the output, you will see that it will say something about LC_ALL not set.
Now, add these two lines in /etc/environment and it worked.
LC_ALL=en_US.UTF-8
LANG=en_US.UTF-8
This solution is for Ubuntu 12.04 +
Other variants may require similar work.
Unexpected mongo exit code 1 is still an uncaught exception as far as i think.
You can try by updating your c/c++ compilers uptodate. Have a look here.
It says :
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update
sudo apt-get install gcc-4.6
sudo apt-get install g++-4.6
All the best!
So we have narrowed the issue down to meteor's mongo installation on your box (though I think we were pretty sure of this all along). Let's attempt to debug that a bit. The way I have done this in the past is to try to open meteor's mongo with the mongod provided by meteor. You will perform these procedures without running the meteor server. This should give you the warning that is causing Mongo to exit. First you need to find this. In my instance installed on Mint (which should be similar to Ubuntu) it is at:
~/.meteor/packages/meteor-tool/.1.1.3.4sddkj++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/dev_bundle/mongodb/bin/mongod
You can look at that location on your Ubuntu box or you can run something like this to get the location:
find ~/.meteor/ -name mongod
Once you find the location then go to the directory of your meteor project you are attempting to run and in that directory you should find this location:
<your meteor project>/.meteor/local
cd into that directory and run the following command:
~/.meteor/packages/meteor-tool/.1.1.3.4sddkj++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/dev_bundle/mongodb/bin/mongod --dbpath ./
From there you can analyze the output (or update the question so we can see the output) and this should show you the mongo error you are receiving on startup and allow you to fix it.
I've got the same issues trying to start a meteor app and exactly the mongodb server is being terminated in an unexpectly manner. Generally the virtual linux server from some dealers like the one you mentioned are coming without a swap partition (check in /etc/fstab file) so if you have not enough memory to allocate MongoDB server then meteor app can't be started. You can create a swap partition or instal swapspace
sudo apt-get install swapspace
After that I was able to start the meteor app... Just be patient as swap memory is not as faster as RAM.
Since due some "smart" StackExchange policy I cannot up-vote or comment to working solution...)
Quoted answer works also on Digital Ocean on CentOS 7 x64 vmlinuz-3.10.0-123.8.1.el7.x86_64
first, type locale command and see the output, you will see that it will say something about LC_ALL not set.
Now, add these two lines in /etc/environment and it worked.
I changed the locale setting to match my needs.
Fixed on my Debian 8 with the following bash command, (use sudo if needed)
localedef -i en_US -f UTF-8 en_US.UTF-8

restart openerp 7 server on Xubuntu

I am coding a custom module on Oerp7 on Xubuntu 12.04, and today, suddently (after some moduifications in the code I think), the restart server command still do not affecting my module.
i restart with this command :
sudo /etc/init.d/openerp-server restart
but the compiled (.pyc) files stayed unchange.
If I delete the module in the addons dir, the module don't properly work giving me a message saying that models are absent. that is normal; but why restart don't change anything. even if I modify the init.py or openerp.py files.
According tome is as restarting by this command now make nothing, while yesterday it did.
So, please, how could I fix that now.
You need to have -u modulename in the command line that starts the OpenERP server. So either modify the /etc/init.d/openerp-server script to have it there, or just start the server manually while you are developing.
Try
sudo /etc/init.d/openerp-server stop
ps aux | grep openerp
to see if the server really stopped.
Start the server with
sudo /etc/init.d/openerp-server start
Look also in the logs (/var/log/openerp/openerp-server.log for ex.) to see what heppens.

Stop: Unknown instance mongodb (Ubuntu)

I am new to Mongodb. When I run the following command:
sudo service mongodb start
It shows me "mongodb start/running, process 3566". But when I try to stop by giving the below command:
sudo service mongodb stop
It shows stop: Unknown instance:. Do anybody have any idea how to slove this issue.
And if I give sudo service mongodb restart, I'm getting the below message:
stop: Unknown instance:
mongodb start/running, process 3644
PS: If I'm using just mongod, I could start the server and could connect the mongo shell by giving mongo.
Please suggest me how to fix the issue and how to connect mongo shell after giving service mongodb start. Thanks in advance.
I just ran into this.
Chances are the issue is in your conf file (obviously, since you reinstalled the seeded)
In the mongodb.conf do not set fork = true if calling it as a service. This will prevent the service call from being able to access it with service mongodb.conf status/stop/restart.
Removing a fork=True line, however, will alleviate the issue.
See comments; use the other solution even though this one is accepted.
The reason you get the Unknown instance error is because upstart is tracking the wrong PID for the instance of forked mongod process. But the proper solution to this is not running the process in foreground by removing fork=true line from the config like #GoingTharn suggesting, but rather helping upstart to capture the right PID of the forked process by adding
expect daemon
to the /etc/init/mongodb.conf
I faced exactly the same problem and did the followings:
Removed the file mongod.lock (in my case this file was located at /var/lib/mongodb/)
Used the following command from my mongo client
mongo --repair
And that fixed the issue. It may be noted that I had a system crash prior to this problem appeared. Therefore, what I believe, the problem was caused due to the unclean shutdown of the server demon.
If you are unsure of the reason, you may wish to have a look at the log file (in my case I found it under /var/log/mongodb/). That might give you some useful hints.
Thanks.
I faced it as you had.Maybe it is because my computer crash unexpectedly.I use the command: sudo top(ubuntu), and I found mongo running.I killed it and start mongo.Every thing turns right.
I fixed it by myself. Below is what I did:
apt-get install mongodb
And overwrote .conf file. After that everything works fine. I hope this would help someone.