Installation problem. invoke-rc.d: policy-rc.d denied execution of restart

Hello everyone.

I have been using HestiaCP on many servers for a long time and encountered installation problems for the first time.

Hestia Control Panel 1.8.11, Ubuntu 22, Serv 1CPU 5Ghz/2Gb/40Gb

The installation stops with a line in the log:
invoke-rc.d: policy-rc.d denied execution of restart.

The policy-rc.d file was not found in the system, it is missing. From the recommendations on the network, I tried to create it with the content: “#!/bin/sh\n exit 0”, but it did not help

I need help, please tell me :roll_eyes:

=====

Thank you for downloading Hestia Control Panel! In a few moments,
we will begin installing the following components on your server:

   - NGINX Web / Proxy Server
   - Multi-PHP Environment

   - Vsftpd FTP Server
   - Firewall (iptables) + Fail2Ban Access Monitor

========================================================================


Installation backup directory: /root/hst_install_backups/210620240959
Installation log file: /root/hst_install_backups/hst_install-210620240959.log

Adding required repositories to proceed with installation:

[ * ] NGINX
[ * ] PHP
[ * ] Hestia Control Panel

Updating currently installed packages, please wait...|
The installer is now downloading and installing all required packages.
NOTE: This process may take 10 to 15 minutes to complete, please wait...
Extracting templates from packages: 100%


=====

[ * ] Configuring system settings...
[ * ] Configuring Hestia Control Panel...
[ * ] Configuring OpenSSL to improve TLS performance...
[ * ] Generating default self-signed SSL certificate...
[ * ] Adding SSL certificate to Hestia Control Panel...
[ * ] Enabling SFTP jail...
[ * ] Creating default admin account...

Log:

Creating config file /etc/php/8.2/mods-available/gd.ini with new version
Setting up rrdtool (1.7.2-3ubuntu6) ...
Setting up libc-devtools (2.35-0ubuntu3.8) ...
Setting up imagemagick (8:6.9.11.60+dfsg-1.3ubuntu0.22.04.3) ...
Processing triggers for libc-bin (2.35-0ubuntu3.8) ...
Processing triggers for man-db (2.10.2-1) ...
Processing triggers for install-info (6.8-4build1) ...
Processing triggers for php8.2-cli (8.2.20-2+ubuntu22.04.1+deb.sury.org+1) ...
Processing triggers for dictionaries-common (1.28.14) ...
aspell-autobuildhash: processing: en [en-common].
aspell-autobuildhash: processing: en [en-variant_0].
aspell-autobuildhash: processing: en [en-variant_1].
aspell-autobuildhash: processing: en [en-variant_2].
aspell-autobuildhash: processing: en [en-w_accents-only].
aspell-autobuildhash: processing: en [en-wo_accents-only].
aspell-autobuildhash: processing: en [en_AU-variant_0].
aspell-autobuildhash: processing: en [en_AU-variant_1].
aspell-autobuildhash: processing: en [en_AU-w_accents-only].
aspell-autobuildhash: processing: en [en_AU-wo_accents-only].
aspell-autobuildhash: processing: en [en_CA-variant_0].
aspell-autobuildhash: processing: en [en_CA-variant_1].
aspell-autobuildhash: processing: en [en_CA-w_accents-only].
aspell-autobuildhash: processing: en [en_CA-wo_accents-only].
aspell-autobuildhash: processing: en [en_GB-ise-w_accents-only].
aspell-autobuildhash: processing: en [en_GB-ise-wo_accents-only].
aspell-autobuildhash: processing: en [en_GB-ize-w_accents-only].
aspell-autobuildhash: processing: en [en_GB-ize-wo_accents-only].
aspell-autobuildhash: processing: en [en_GB-variant_0].
aspell-autobuildhash: processing: en [en_GB-variant_1].
aspell-autobuildhash: processing: en [en_US-w_accents-only].
aspell-autobuildhash: processing: en [en_US-wo_accents-only].
Processing triggers for php8.2-fpm (8.2.20-2+ubuntu22.04.1+deb.sury.org+1) ...
invoke-rc.d: policy-rc.d denied execution of restart.

Hi @AlYa,

The use of policy-rc.d is not common, at least not in Debian but I think it isn’t in Ubuntu too. Maybe your hosting created the Ubuntu image with this conf.

Anyway, check the content of the script to see why it is denying the restart for that package:

cat /usr/sbin/policy-rc.d

I’ve already tried to watch it - there is no such file in the system

root@b:~# cat /usr/sbin/policy-rc.d
cat: /usr/sbin/policy-rc.d: No such file or directory

You can create it and add an exit 0 to that script.

printf '#!/bin/sh\nexit 0' > /usr/sbin/policy-rc.d
chmod +x /usr/sbin/policy-rc.d

I have already tried to do this, I wrote above… and now I have run this script and repeated the installation, the result is as follows: invoke-rc.d: policy-rc.d denied execution of start.

Unpacking hestia-php (8.2.11) ...
Setting up hestia (1.8.11) ...
Setting up hestia-php (8.2.11) ...
Setting up hestia-nginx (1.25.2) ...
invoke-rc.d: policy-rc.d denied execution of start.

Then I’m sorry but no idea how to solve it.

Are you running it in a docker image?

1 Like

You can try to use the Ubuntu 20.04 image. Update the image to 22.04 and try to install hestia! See if the error still exists. If you try to install hestia with the docker image, I think it should not be supported.

No, docker is not used

Try this solution:

An understanding of this solution means you will have to create an installer command to avoid installing php 8.1.

Added installation logging (hst-install-ubuntu.sh), installation is interrupted for file execution:

$HESTIA/bin/v-change-user-shell admin nologin

If you run this file and allow the output, then the line “/usr/bin/chsh -s “$shell_path” “$user”” prompts for a password

/usr/local/hestia/bin# sudo bash v-change-user-shell admin nologin
Password:
chsh: PAM: Authentication failure

What in this file can interrupt the process?

The problem was solved as follows:

  1. In the installer line, I specified all the parameters and added “bash hst-install.sh […] --interactive no --force”.
  2. At the moment when the installation was interrupted, I pressed Enter on the line “[ * ] Creating default admin account…” and the installation continued