cPanel version change or /scripts/upcp --force changes /etc/init.d/httd in EA4

Spork Schivago

Well-Known Member
Jan 21, 2016
597
64
28
corning, ny
cPanel Access Level
Root Administrator
I'm not sure if you care or not, but here's a patch for internal case EA-4938.

/scripts/upcp gets ran and eventually initiates the bash script /usr/local/cpanel/scripts/remdefssl. On line 26 of remdefssl, /usr/local/cpanel/scripts/initsslhttpd gets executed.

/usr/local/cpanel/scripts/initsslhttpd is a very simple bash script that executes another script based on what Apache version is installed. On line 16, you can see it sets a variable, $script, to /usr/local/cpanel/scripts/initsslhttpd2_4, which is just a symbolic link to /usr/local/cpanel/scripts/initsslhttpd2_2. On line 17 of the initsslhttpd script, initsslhttpd2_2 gets executed. Either directly, or by the symbolic link that initsslhttpd2_4 points to (initsslhttpd2_2).

If you look at /usr/local/cpanel/scripts/initsslhttpd2_2, on lines 15 through 17, you see where the script deletes the EasyApache 4 /etc/init.d/httpd script (plus a few others). On line 29 of /usr/local/cpanel/scripts/initsslhttpd2_2 (or 2_4), you see where the /etc/init.d/httpd script is recreated, using the older EasyApache 3 style /etc/init.d/httpd script.

Whether the initsslhttpd2_2 script should still be executed or not, I don't know. But I do know that the patch I've attached removes the older EasyApache 3 style /etc/init.d/httpd script and replaces it with the newer EasyApache 4 /etc/init.d/httpd script.

Perhaps the developers could use the patch if initsslhttpd2_2 is actually still supposed to be executed. If not, perhaps anyone who runs CentOS 6 (maybe all CentOS distro's are affected) can benefit from this patch. Although /scripts/restartsrv_apache can restart Apache, I feel there's probably a lot of scripts that simply restart it via service httpd restart

Or even use service httpd status. A big one might be people who use Let's Encrypt crontab entries. For people who use this patch, they're more than likely going to need to put an entry in /etc/cpanelsync.exclude so /usr/local/cpanel/scripts/initsslhttpd2_2 doesn't get replaced.

Hopefully this can help EA-4938 get fixed a bit quicker. I created a ticket about this issue, ticket # 7609925 in case any cPanel technicians want to read it.
 
Last edited by a moderator:

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,908
2,218
463
Hello,

Internal case EA-4938 is open to address an issue where the "/etc/init.d/httpd" file changes when forcing an update of cPanel or when updating to a new version of cPanel. You can run the following command as a temporary workaround:

Code:
yum reinstall ea-apache24
I'll update this thread with the outcome of the case once it's resolved. Could you let us know if the custom workaround you described is not better handled with the above command?

Thank you.
 

Spork Schivago

Well-Known Member
Jan 21, 2016
597
64
28
corning, ny
cPanel Access Level
Root Administrator
The command you provided does work, the problem is every time upcp is ran, /etc/init.d/httpd gets replaced with the EA3 version and yum reinstall ea-apache24 must be reran, right? Another work around that was provided to me was to run:
Code:
/scripts/migrate_ea3_to_ea4 --run --reinstall
If cPanel implements my patch, then /etc/init.d/httpd is always replaced with the correct copy whenever upcp executes /usr/local/cpanel/scripts/initsslhttpd2_2 or /usr/local/cpanel/scripts/initsslhttpd2_4.

I've ran yum reinstall ea-apache24 and it does put the correct copy of httpd inside /etc/init.d/httpd, however, when upcp is ran again, that /etc/init.d/httpd will get replaced when initsslhttpd2_2 or initsslhttpd2_4 is ran (every night I think on my system) and yum reinstall ea-apache24 or /scripts/migrate_ea3_to_ea4 --run --reinstall will have to be ran, every time this happens.

If you need me to clarify a bit more, I can...

The problem isn't that /etc/init.d/httpd isn't getting installed or updated, it's that /etc/init.d/httpd gets replaced every single time upcp executes /usr/local/cpanel/scripts/initsslhttpd2_2 or initsslhttpd2_4. Until /usr/local/cpanel/scripts/initsslhttpd2_2 is fixed or completely removed so it doesn't get executed, this will continue to be a problem.
 

Spork Schivago

Well-Known Member
Jan 21, 2016
597
64
28
corning, ny
cPanel Access Level
Root Administrator
If you view in a text editor:
Code:
/usr/local/cpanel/scripts/initsslhttpd2_2
You'll see what I'm talking about on line 29. That's the script upcp executes when it's ran and that's the script that replaces the EA4 init.d httpd script with the EA3 version. It's almost like the devs just forgot about the script. All my patch does is replace the /usr/local/cpanel/scripts/initsslhttpd2_2 EA3 init.d httpd stuff with the correct EA4 version, that way, whenever upcp gets ran, there's no need to ever run yum reinstall ea-apache24 or /scripts/migrate_ea3_to_ea4 --run --reinstall.

Instead of a workaround, my patch is an actual fix for the cPanel developers / team.