Wednesday, June 29, 2022

linux: debian: ubuntu: How to discover an application and its service to handle it


>PROBLEM

Scenario by example:
On a linux(debian, ubuntu, etc) system you want to discover the postgresql service, its version and how to stop/start.


>SOLUTION


Alternative ways to discover a service:

1. whereis

2. locate

3. ps aux 

Ex.: ps aux | grep postgres

/usr/lib/postgresql/13/bin/postgres -D /var/lib/postgresql/13/main -c config_file=/etc/postgresql/13/main/postgresql.conf

4. systemctl

returns all registerd services


Using systemctl (newer)

systemctl stop ssh

systemctl disable ssh

systemctl enable ssh

systemctl start ssh

systemctl status ssh


Using service

service  postgresql status

service  postgresql start

service  postgresql stop


>ENV

linux/debian

No comments:

Post a Comment