dimanche , 7 avril 2024

Démarrer automatiquement une stack Bitnami lors du boot du serveur

Debian-like Distributions (Debian, Ubuntu, …)

  • If the stack was installed as the root user, copy the installdir/ctlscript.sh script to the /etc/init.d directory. It’s advisable to rename this script to something more specific, such as bitname-APPNAME. Use the following command:
    Note: Only use sudo if the stack was installed as root
    sudo cp installdir/ctlscript.sh /etc/init.d/bitnami-APPNAME
    

    If the stack was installed as a different user, create the script below at /etc/init.d/bitnami-APPNAME, replacing USERNAME with the name of the user account that the stack was installed under:

     #!/bin/bash
     su USERNAME -c "installdir/ctlscript.sh $@"
    

    Then, make the script executable:

    Note: Only use sudo if the stack was installed as root
    sudo chmod +x /etc/init.d/bitnami-APPNAME
    
  • Add or modify the following lines at the beginning of the /etc/init.d/bitnami-APPNAME script. Remember to update the Provides line to reflect the actual name of the script.
     ### BEGIN INIT INFO
     # Provides:          bitnami-APPNAME
     # Required-Start:    $remote_fs $syslog
     # Required-Stop:     $remote_fs $syslog
     # Default-Start:     2 3 4 5
     # Default-Stop:      0 1 6
     # Short-Description: Start daemon at boot time
     # Description:       Enable services provided by daemon.
     ### END INIT INFO
    
  • Add the script to the default runlevels and enable it, following the example below:
    Note: Only use sudo if the stack was installed as root
    sudo update-rc.d -f bitnami-APPNAME defaults
    sudo update-rc.d -f bitnami-APPNAME enable
    

Reboot your system and the servers should start automatically.

To revert the changes, use the commands below:

Note: Only use sudo if the stack was installed as root

cd /etc/init.d sudo update-rc.d -f bitnami-APPNAME remove


https://docs.bitnami.com/installer/faq/linux-faq/#how-to-start-the-stack-automatically-on-boot

Ledger Wallet

Check Also

Upgrader un stack Lamp Bitnami

Attention : Dans ce tutoriel, nous allons réaliser un upgrade vers un stack configuré avec …

Laisser un commentaire

Votre adresse e-mail ne sera pas publiée. Les champs obligatoires sont indiqués avec *