Stopping postgresql from starting on ubuntu startup - linux

Ubuntu 16.04.1 LTS
I have tried:
sudo update-rc.d -f postgresql remove
and
sudo vim /etc/postgresql/9.5/main/start.conf
then i change the word "auto" to "disabled"
Then i reboot the computer, and when it starts, i login and do:
sudo service --status-all | grep postgresql
Which returns:
[ + ] postgresql
So it is still starting when the server starts.
What is left for me to do? I don't want this service running when the computer starts, only when i manually start it with:
sudo service postgresql start

Use systemctl command to manage postgresql service:
stop service:
systemctl stop postgresql
start service:
systemctl start postgresql
show status of service:
systemctl status postgresql
disable service(not auto-start any more)
systemctl disable postgresql
enable service postgresql(auto-start)
systemctl enable postgresql

Ok. it's fixed thanks to Koen De Groote.
I did:
echo manual | sudo tee /etc/init/postgresql.override
and
sudo systemctl disable postgresql.service
and
sudo systemctl disable postgresql
....I don't know which one of them did it, but its not starting any more... Thank you...

Related

Failed to start mongod.service: Unit mongod.service not found on Ubuntu 20.04

i followed the official instruction of mongodb install_intruction on my Ubuntu 20.04 LTS,
when i started mongodb by this line:
sudo systemctl start mongod
i got an error like this:
Failed to start mongod.service: Unit mongod.service not found.
of course i tried to reload as mongdb instruction:
sudo systemctl daemon-reload
it still shows:
Failed to start mongod.service: Unit mongod.service not found.
then i tried:
systemctl list-unit-files --type=service
to find mongod.service but i couldnt find it. and i tried:
ls /lib/systemd/system
that didnt work either there is no mongod.service file
i really need a hand!!!
It's too late to answer, but may be it will help someone.
In my case, if my run ls /lib/systemd/system | grep mongo there was no file relating to Mongo. So, I created one service file manually.
Step 1.
sudo touch /lib/systemd/system/mongod.service
Step 2.
Open file in vim/nano and paste below script.
[Unit]
Description=MongoDB Database Server
Documentation=https://docs.mongodb.org/manual
After=network-online.target
Wants=network-online.target
[Service]
User=mongodb
Group=mongodb
EnvironmentFile=-/etc/default/mongod
ExecStart=/usr/bin/mongod --config /etc/mongod.conf
PIDFile=/var/run/mongodb/mongod.pid
# file size
LimitFSIZE=infinity
# cpu time
LimitCPU=infinity
# virtual memory size
LimitAS=infinity
# open files
LimitNOFILE=64000
# processes/threads
LimitNPROC=64000
# locked memory
LimitMEMLOCK=infinity
# total threads (user+kernel)
TasksMax=infinity
TasksAccounting=false
# Recommended limits for mongod as specified in
# https://docs.mongodb.com/manual/reference/ulimit/#recommended-ulimit-settings
[Install]
WantedBy=multi-user.target
This is default service file for mongod. Now run sudo systemctl start mongod. It will hopefully work.
Do a reinstall, after purging the current installation.
sudo apt purge mongodb-org*
sudo rm -r /var/log/mongodb
sudo rm -r /var/lib/mongodb
Run the command without sudo for the first time
systemctl start mongod.service

I'm not able to communicate with Kibana server

I'm getting this error kibana server is not ready yet can anyone help.
Just stop and start your kibana service.
sudo systemctl stop kibana.service
sudo systemctl start kibana.service
Restart the Kibana By using following cmnds
sudo service kibana stop
sudo service kibana start

Failed to start couchbase-server.service: Unit couchbase-server.service is masked

couchbase service stopped , so i started it manually by exec following command:
sudo service couchbase-server start and got response
Failed to start couchbase-server.service: Unit couchbase-server.service is masked.
I have ubuntu 16.04LTS and couchbase 5.1
you can unmask your service
sudo systemctl unmask couchbase-server
sudo systemctl start couchbase-server
Go to $CouchbaseHome and run following command to start and stop manually
Start
 ./bin/couchbase-server \-- -noinput -detached
Shutdown
./bin/couchbase-server -k

chkconfig --list does not show newly added service

I created the service script.
etc/init.d/oracle11se
The below command succeeds.
chkconfig --add oracle11se
The below command runs successfully.
/etc/init.d/oracle11se start
But the command
chkconfig --list oracle11se
does not show the newly added service. Also the service does not start on reboot.
OS release is redhat 7.2.
systemctl has replaced chkconfig.
This is the command you should use: systemctl status oracle11se.service.
If you want to list active services: systemctl list-units --type service.

Cannot restart network service

I was trying to configure a static IP address on my Linux machine (Fedora 19 ). However when I was trying to restart my network.services using systemctl restart network.service, I was unable to do so.
[root#xyz network-scripts]# systemctl restart network.service
Job failed. See system journal and 'systemctl status' for details.
I tried to reboot my system and re execute the command, but still I am getting the same error. Also I am enable to access internet on my system.
Can anyone help me out with this.
To restart network services, you can use this command
service networking restart
You can also use
service networking stop
then
service networking start
restart the nm-applet with this command from terminal:
killall nm-applet; nohup nm-applet &
or restart the the network manager service using:
sudo systemctl restart network-manager
Restore radio frequencies by running the following command;
sudo service NetworkManager restart
If that does not work, run this one;
rfkill unblock wifi

Resources