Ask Your Question

Disabled php-fpm but it still starts on boot

asked 2018-05-10 12:55:04 -0500

Shane gravatar image

I've installed php 5.6 from Remi's repo in order to test some older sites locally, however I don't need it to start on every boot, I usually use php 7.1 from the default system repository.

I've made sure to run systemctl disable php56-php-fpm and stop the service, however it still appears to start when booting my computer. systemctl status php56-php-fpm will say it's active (running).

Should I be doing anything else to stop it from starting automatically?

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted

answered 2018-05-13 02:17:41 -0500

remi gravatar image

updated 2018-05-14 04:21:55 -0500

php-fpm is started by the httpd service to make easier the upgrade from old versions where mod_php was the default way to install php.

So you cannot really avoid it to be started, but you can switch it to "ondemand" (in the pool configuration) to avoid memory usage, only the main process will be loaded.

edit flag offensive delete link more

answered 2018-05-10 15:07:00 -0500

sideburns gravatar image

Welcome to ask.fedora! When you disable a service, you tell systemd not to start the service automatically at boot. However, some other service can still start it if needed. If you really want to make sure that the service can't start at boot, you need to run, as root, systemctl mask $SERVICE, which makes it impossible to start the service until you unmask it. Judging by what you wrote, this would be too heavy-handed for you as you still want to be able to start it at need.

If so, considering creating a shell script (owned by root) at /etc/rc.d/rc.local, put in the command systemctl disable php56-php-fpm and making the script executable. At boot, this will activate the service rc-local.service which runs that script after everything else is done and does what you need. And, if you do it this way, you can always activate it from the command line when you need to.

edit flag offensive delete link more


Thanks for the help. If this is the case, is there a way to list the services that require php56-php-fpm?

Shane gravatar imageShane ( 2018-05-11 13:27:29 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools


Asked: 2018-05-10 12:55:04 -0500

Seen: 127 times

Last updated: May 14 '18