Where the process of the service?

Peter Krauss

At UBUNTU, service postgresql status lists

  Process: 18534 ExecStart=/bin/true (code=exited, status=0/SUCCESS)
 Main PID: 18534 (code=exited, status=0/SUCCESS)

but when I test sudo ps -ax | grep 18534 nothing is listed.


NOTES

EDIT1 for @DanielB request, but I need a simple command that shows any service PID.

Here a dump more /lib/systemd/system/postgresql.service,

# systemd service for managing all PostgreSQL clusters on the system. This
# service is actually a systemd target, but we are using a service since
# targets cannot be reloaded.

[Unit]
Description=PostgreSQL RDBMS

[Service]
Type=oneshot
ExecStart=/bin/true
ExecReload=/bin/true
RemainAfterExit=on

[Install]
WantedBy=multi-user.target

EDIT2

The PostgreSQL above was my localhost server... Now I am testing in a "new, clean and shine" DigitalOcean Droplet with UBUNTU 16 LTS and Postgresql 9.X...

root@myServer:~# service postgresql status
● postgresql.service - PostgreSQL RDBMS
   Loaded: loaded (/lib/systemd/system/postgresql.service; enabled; vendor preset: enabled)
   Active: active (exited) since Dom 2016-12-18 17:47:09 UTC; 2 weeks 4 days ago
 Main PID: 8703 (code=exited, status=0/SUCCESS)
    Tasks: 0
   Memory: 0B
      CPU: 0
   CGroup: /system.slice/postgresql.service

Dez 18 17:47:09 myServer systemd[1]: Starting PostgreSQL RDBMS...
Dez 18 17:47:09 myServer systemd[1]: Started PostgreSQL RDBMS.
Dez 18 17:47:14 myServer systemd[1]: Started PostgreSQL RDBMS.


root@myServer:~# sudo ps -ax | grep  8703
 3702 pts/0    S+     0:00 grep --color=auto 8703

root@myServer:~# sudo service postgresql restart

root@myServer:~# sudo ps -ax | grep  8703
 3760 pts/0    S+     0:00 grep --color=auto 8703


root@myServer:~# service postgresql status
● postgresql.service - PostgreSQL RDBMS
   Loaded: loaded (/lib/systemd/system/postgresql.service; enabled; vendor preset: enabled)
   Active: active (exited) since Sex 2017-01-06 16:06:07 UTC; 8s ago
  Process: 3755 ExecStart=/bin/true (code=exited, status=0/SUCCESS)
 Main PID: 3755 (code=exited, status=0/SUCCESS)

Jan 06 16:06:07 myServer systemd[1]: Starting PostgreSQL RDBMS...
Jan 06 16:06:07 myServer systemd[1]: Started PostgreSQL RDBMS.


sudo ps -ax | grep  3755
 3780 pts/0    S+     0:00 grep --color=auto 3755
user1686

There is none, because as you can see yourself from the unit's contents, postgresql.service does not actually start any daemon. It exists merely as a 'parent' service to group together various instances of [email protected] (i.e. to reload all of them at once). Instead take a look at:

systemctl status postgresql@\*.service

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Linux: process into a service

From Dev

Android service in separate process

From Dev

Difference between a process and service?

From Dev

How to kill a service process?

From Dev

Where is multiprocessing.Process

From Dev

Where to process data in Laravel

From Dev

Service + android:process "vs" IntentService

From Dev

Camera frames in a service / background process

From Dev

Start a service in a separate process android

From Dev

pgrep defunct process to restart service

From Dev

Trying to process different scenarios in Service

From Dev

How to detect if a process is installing as a service

From Dev

Installing process as service directory decision

From Dev

How to make a program/process a service ?

From Dev

Service in a global process in not getting created

From Dev

Find out where a process writes to

From Dev

Where is child_process.js?

From Dev

MySql process order of where condition

From Dev

Where is the TFS build process going?

From Dev

where did sidekiq process run?

From Dev

Find out where a process writes to

From Dev

Where is the TFS build process going?

From Dev

Where to put Bluemix Service documentation

From Dev

WCF service method creates a Process to run MsTest, the process will not execute

From Dev

Android + OpenCV: process camera frames in a service

From Dev

Does Android kill each Service or the whole Process?

From Dev

Process hosting the camera service has died unexpectedly

From Dev

What are the Advantages and Disadvantages of running a service in different process?

From Dev

Crittercism not working on android service with separate process