Ich werde die Stelle aufschreiben, an der das offizielle Dokument steckt. → Start the stack automatically on boot
Wie für den Fluss, wie im obigen Artikel, Wir werden ctlscript.sh verwenden, das App-Steuerungsskript von Bitnami.
sudo cp installdir/ctlscript.sh /etc/init.d/bitnami-APPNAME
Die Punkte dieses Artikels sind wie folgt.
Der Teil, der zum Einfügen in das Skript aufgefordert wird
### 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
Bitte füge dies nach ** #! / Bin / bash ** hinzu. Wenn Sie es vor #! / Bin / bash schreiben, Wie unten gezeigt, schlägt die Ausführung beim Start des Betriebssystems aufgrund eines Formatfehlers fehl.
$ 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.
Wenn Sie es richtig hinzufügen, gelingt der automatische Start wie unten gezeigt.
$ 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