J'écrirai l'endroit où se trouve le document officiel. → Start the stack automatically on boot
Quant au flux, comme dans l'article ci-dessus, Nous utiliserons ctlscript.sh, qui est le script de contrôle d'application de Bitnami.
sudo cp installdir/ctlscript.sh /etc/init.d/bitnami-APPNAME
Les points de cet article sont les suivants.
La partie à insérer dans le 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
Veuillez ajouter ceci après ** #! / Bin / bash **. Si vous l'écrivez avant #! / Bin / bash, Comme indiqué ci-dessous, l'exécution échoue au démarrage du système d'exploitation en raison d'une erreur de format.
$ systemctl status bitnami-APPs.service
● bitnami-APPs.service - LSB: Start daemon at boot time
Loaded: loaded (/etc/init.d/bitnami-APPs; generated)
Active: failed (Result: exit-code) since Tue 2020-07-28 23:21:13 JST; 1min 13s ago
Docs: man:systemd-sysv-generator(8)
Process: 512 ExecStart=/etc/init.d/bitnami-APPs start (code=exited, status=203/EXEC)
Jul 28 23:21:13 on20200516 systemd[1]: Starting LSB: Start daemon at boot time...
Jul 28 23:21:13 on20200516 systemd[512]: bitnami-APPs.service: Failed to execute command: Exec format error
Jul 28 23:21:13 on20200516 systemd[512]: bitnami-APPs.service: Failed at step EXEC spawning /etc/init.d/bitnami-APPs: Exec format error
Jul 28 23:21:13 on20200516 systemd[1]: bitnami-APPs.service: Control process exited, code=exited, status=203/EXEC
Jul 28 23:21:13 on20200516 systemd[1]: bitnami-APPs.service: Failed with result 'exit-code'.
Jul 28 23:21:13 on20200516 systemd[1]: Failed to start LSB: Start daemon at boot time.
Si vous l'ajoutez correctement, il réussira le démarrage automatique comme indiqué ci-dessous.
$ systemctl status bitnami-APPs.service
● bitnami-APPs.service - LSB: Start daemon at boot time
Loaded: loaded (/etc/init.d/bitnami-APPs; generated)
Active: active (running) since Tue 2020-07-28 23:24:56 JST; 41s ago
Docs: man:systemd-sysv-generator(8)
Process: 514 ExecStart=/etc/init.d/bitnami-APPs start (code=exited, status=0/SUCCESS)
Tasks: 46 (limit: 682)
Memory: 283.5M
CGroup: /system.slice/bitnami-APPs.service
├─ 569 /bin/sh /opt/bitnami/mysql/bin/mysqld_safe --defaults-file=/opt/bitnami/mysql/my.cnf --mysqld=mysqld.bin --socket=/opt/bitnami/mysql/tmp/my>
├─ 899 /opt/bitnami/mysql/bin/mysqld.bin --defaults-file=/opt/bitnami/mysql/my.cnf --basedir=/opt/bitnami/mysql --datadir=/opt/bitnami/mysql/data >
├─1155 /opt/bitnami/apache2/bin/httpd.bin -f /opt/bitnami/apache2/conf/httpd.conf
├─1169 /opt/bitnami/apache2/bin/httpd.bin -f /opt/bitnami/apache2/conf/httpd.conf
├─1170 /opt/bitnami/apache2/bin/httpd.bin -f /opt/bitnami/apache2/conf/httpd.conf
├─1171 /opt/bitnami/apache2/bin/httpd.bin -f /opt/bitnami/apache2/conf/httpd.conf
├─1172 /opt/bitnami/apache2/bin/httpd.bin -f /opt/bitnami/apache2/conf/httpd.conf
└─1173 /opt/bitnami/apache2/bin/httpd.bin -f /opt/bitnami/apache2/conf/httpd.conf
Jul 28 23:24:18 on20200516 systemd[1]: Starting LSB: Start daemon at boot time...
Jul 28 23:24:48 on20200516 bitnami-APPs[567]: /opt/bitnami/mysql/scripts/ctl.sh : mysql started at port 3306
Jul 28 23:24:56 on20200516 bitnami-APPs[1151]: Syntax OK
Jul 28 23:24:56 on20200516 bitnami-APPs[1150]: /opt/bitnami/apache2/scripts/ctl.sh : httpd started at port 80
Jul 28 23:24:56 on20200516 systemd[1]: Started LSB: Start daemon at boot time.
Recommended Posts