В UBUNTU, service postgresql status
списки статуса
Process: 18534 ExecStart=/bin/true (code=exited, status=0/SUCCESS)
Main PID: 18534 (code=exited, status=0/SUCCESS)
но когда я тестирую sudo ps -ax | grep 18534
ничего не указано.
ЗАМЕТКИ
EDIT1 для запроса @DanielB, но мне нужна простая команда, которая показывает любой PID службы .
Здесь дамп 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
PostgreSQL выше был моим локальным сервером ... Сейчас я тестирую в "новой, чистой и сияющей" капле DigitalOcean с UBUNTU 16 LTS и Postgresql 9.ИКС...
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