Server Maintenance Mode to Suspend All Services?

thowden

Well-Known Member
May 17, 2013
92
17
58
Australia
cPanel Access Level
Root Administrator
Hi All

I had a server run out of disk space earlier today and while it is currently being fixed, I went looking for an option to suspend the entire server or put it in a maintenance mode. But I cannot find anything.

I have stopped apache and exim from an ssh session while I add-in a new drive, but I expect there are other services that will be still interacting with external users or internally for logging etc.

While it is too late for this time around, but is there a function to present a 'Maintenance Mode' for an entire server and not just a single account?

Thanks
 

cPanelLauren

Product Owner II
Staff member
Nov 14, 2017
13,266
1,301
363
Houston
Hi @thowden

cPanel does not have a maintenance mode as you're suggesting though you can stop services such as. If you'd like to see this as part of the product I'd urge you to open a feature request using the link in my signature. Once open reply here with the link so that others may vote on it.


Thanks!
 

Steini Petur

Well-Known Member
Apr 24, 2016
118
33
78
Iceland
cPanel Access Level
Root Administrator
How is this in 2022 not a feature... It would be far easier to be able to put something like a nice Migration message or Maintainance message while transferring clients between hardwares, etc than just DEAD site like block port 80 443..etc
 

cPRex

Jurassic Moderator
Staff member
Oct 19, 2014
15,197
2,415
363
cPanel Access Level
Root Administrator
  • Like
Reactions: ajithpa

thowden

Well-Known Member
May 17, 2013
92
17
58
Australia
cPanel Access Level
Root Administrator
Hi

It was an issue that occurred for me a few years back and has not been needed since. The lack of comments from anyone else for 3 years also indicates that as a feature even if it did exist, it would rarely be used and I am certain there are more important tasks for the dev team.

@cPRex, the two tools suggested are helpful but mainly for single sites. My original issue was looking for a maintenance mode at the server level.

@Steini, I did a quick search and I found your feature request from 2 years ago, which has 9 'likes' in that time. Probably insufficient interest to get the dev team to consider spending time on it.

If anyone is reading this thread and likes the idea of a maintenance mode at server level, then head over to the feature requests area at
https://features.cpanel.net/topic/whmcpanel-maintenance-mode and add your vote.
 
  • Like
Reactions: cPRex

thowden

Well-Known Member
May 17, 2013
92
17
58
Australia
cPanel Access Level
Root Administrator
Hi

Agreed for the purpose of announcing outages, estimates of duration, etc.... but for a client hitting up a server connection for any service on a server, it would still be preferable to have a 'polite' - 'My name is Server and I have failed you, temporarily' type message that could link to the status pages for more info. Particularly for the smaller hosts that are trying to manage everything themselves.
 

Steini Petur

Well-Known Member
Apr 24, 2016
118
33
78
Iceland
cPanel Access Level
Root Administrator
Hi

It was an issue that occurred for me a few years back and has not been needed since. The lack of comments from anyone else for 3 years also indicates that as a feature even if it did exist, it would rarely be used and I am certain there are more important tasks for the dev team.

@cPRex, the two tools suggested are helpful but mainly for single sites. My original issue was looking for a maintenance mode at the server level.

@Steini, I did a quick search and I found your feature request from 2 years ago, which has 9 'likes' in that time. Probably insufficient interest to get the dev team to consider spending time on it.

If anyone is reading this thread and likes the idea of a maintenance mode at server level, then head over to the feature requests area at
https://features.cpanel.net/topic/whmcpanel-maintenance-mode and add your vote.
I ended doing a bit of a mix-match hack during the phase, What I ended up doing was the following

1. On server A, which will be migrated, we sent out a PA about the migration taking place at X hours, on day whatever
2. I had edited the template on the server before the day came for "Suspension" replaced the suspension logo to font-awesome for a dolly with a box on it and renamed it basically from Suspended contact host to , Migration in progress.
3. I listed all the suspended accounts which were suspended for reasons such as "Overdue on payment", Wrote also down custom suspension messages like breach of TOS.

Now I was pretty much ready, what I did next was I ran a cli command, to basically "ls /var/cpanel/userdata" for all the usernames, into a /path/to/list and then when we're ready to migrate, we ran the a for loop i.e for $i in cat /path/to/list ; do /usr/local/cpanel/scripts/suspendacct $i

Something like that, everyone 100's and 100's of the accounts got all suspended, but to them it was "Migration time", so they waited patiently, everyone was suspended, we ended up, doing The transfer and gave ourselves 6-8 hours, so no stress, we transfer everything over in suspended state, then unsuspend every account using similar for loop, and then we went through the genuine suspended list, and replicated that manually all 20-30 accounts suspended.. and after that it was just replace the IP part etc, shut down the other server, pickup the IP like you normally do, arp it to the server and boom like magic all sitse back up.

PS: This was far from ideal but this is my methodto the madness of maintaining order during my migrations of 800+ accounts.