I am working on Ubuntu 16.04 and am confused in postgresql service files.
I installed the postgresql deb package from repo and it gave me 3 files to start the service: - /etc/init.d/postgresql - /lib/systemd/system/postgresql.service - /lib/systemd/system/[email protected]
I tried to google to understand the differences between them. Till now only thing I learnt is that init.d was the old method of starting the services while systemd is the new one
So in my case when I invoke the following what makes the service start ?
# service postgresql start
I tried adding an exit 0 in start function of init.d but still the service starts. So that script is redundant ?
I need to change some configs in the start invocation of the service and don't know if I should make change in .service file or @.service file
Contents of .service file are:
# cat /lib/systemd/system/postgresql.service [Unit] Description=PostgreSQL RDBMS [Service] Type=oneshot ExecStart=/bin/true ExecReload=/bin/true RemainAfterExit=on [Install] WantedBy=multi-user.target
What is the /bin/true for ? The actual code to start the service appears in @.service file
Which is used when ?
This is totally confusing me :(