systemctl enable pgbouncer Issues

Issues related to applications and software problems
Post Reply
User avatar
BeeRich
Posts: 28
Joined: 2008/01/05 09:59:33

systemctl enable pgbouncer Issues

Post by BeeRich » 2020/08/28 12:06:45

Hi folks.

Trying to get pgbouncer as a required startup daemon. I'm having some issues as I'm new to systemd and how it should be set up. I have postgresql on the same box and need this operational first. I am assuming the After directive is needed here.

It asks for my password to start the service (systemctl start pgbouncer), which impedes the service starting up using systemctl enable pgbouncer.

Given that I can make a /usr/lib/systemd/system/pgbouncer.service on my own, should I take that route or can I rely on systemctl enable pgbouncer?

I'm having trouble deciphering between the two. systemctl enable pgbouncer requires a password which will obviously not be available upon a reboot of any nature. So I don't see how enabling a service protected by a password, can happen. The service and the log are in the same directory, owned by the pgbouncer user, so it's protected by that user's ownership.

Any insight appreciated. Cheers
Cheers, daBee

tunk
Posts: 768
Joined: 2017/02/22 15:08:17

Re: systemctl enable pgbouncer Issues

Post by tunk » 2020/08/28 13:05:12

start= start it now, does not start at next reboot
enable= enable start at boot
I'm not quite sure, but I think both requires a service file.

User avatar
TrevorH
Forum Moderator
Posts: 29493
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: systemctl enable pgbouncer Issues

Post by TrevorH » 2020/08/28 15:42:19

Enable tells it to start the service automatically on boot. That already runs as root so I doubt if it will prompt for a password. Using --now on systemctl enable also tells it to start the service now and also enable it automatically at boot. That's the same as running enable and start in two commands.

It's only asking for a password because you have to be root to start services.
CentOS 6 will die in November 2020 - migrate sooner rather than later!
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 is dead, do not use it.
Full time Geek, part time moderator. Use the FAQ Luke

User avatar
BeeRich
Posts: 28
Joined: 2008/01/05 09:59:33

Re: systemctl enable pgbouncer Issues

Post by BeeRich » 2020/08/28 17:41:58

Yes, I'm clear on the instructions of both start and enable. However I think I am finding that it's not started up upon reboot. I originally enabled it but I was finding it was not running. So another start is required, which needs the password. There has to be a way to make sure it's always up.

I will restart tonight to see what's going on.
Cheers, daBee

User avatar
BeeRich
Posts: 28
Joined: 2008/01/05 09:59:33

Re: systemctl enable pgbouncer Issues

Post by BeeRich » 2020/08/31 00:21:37

Well, she's up and staying stable. Will report back if it fails.
Cheers, daBee

Post Reply

Return to “CentOS 7 - Software Support”