Unix
Jest wiele sposobów aby uruchomić IngenicoServer w tle czy jako daemon’a. Można użyć podsystemu PM2 (/posnet-server-autostart/), ale równie wygodnym sposobem jest systemd. Zakładając że IngenicoServer został rozpakowany w /opt/ingenicoserver, należy stworzyć plik ingenico.service
1 |
sudo vim /etc/systemd/system/ingenico.service |
Zawartość pliku powinna być następująca:
1 2 3 4 5 6 7 8 9 |
[Unit] Description=Ingenico Server service [Service] WorkingDirectory=/opt/ingenicoserver/ ExecStart=/opt/ingenicoserver/serverstart.sh [Install] WantedBy=multi-user.target |
Następnie wykonujemy 2 polecenia:
1 2 |
systemctl daemon-reload systemctl start ingenico.service |
Po czym wynik polecenia:
1 |
systemctl status ingenico.service |
powinien być podobny do tego:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
● ingenico.service - example systemd service unit file. Loaded: loaded (/etc/systemd/system/ingenico.service; enabled; vendor preset: enabled) Active: active (running) since Mon 2023-10-23 18:57:58 CEST; 1s ago Main PID: 637504 (serverstart.sh) Tasks: 26 (limit: 18974) Memory: 55.9M CPU: 1.128s CGroup: /system.slice/ingenico.service ├─637504 /bin/bash /opt/ingenicoserver/serverstart.sh ├─637575 npm "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" ├─637593 sh -c "node server.js" └─637594 node server.js paź 23 18:57:59 lab-host34 serverstart.sh[637594]: {"message":"Pinger is disabled in configuration. To enable it set ingenico.ping.active=true","level":"info","timestamp":"2023-10-23T19:57:59.246Z"} paź 23 18:57:59 lab-host34 serverstart.sh[637594]: {"message":"Checking license file /opt/ingenicoserver/c801c4f1-e232-436c-v5a1-9b0d2dd8f99a.lic .....","level":"info","timestamp":"2023-10-23T19:57:59.246Z"} paź 23 18:57:59 lab-host34 serverstart.sh[637594]: {"message":"license file: /opt/ingenicoserver/c801c4f1-e232-436c-v5a1-9b0d2dd8f99a.lic","level":"info","timestamp":"2023-10-23T19:57:59.247Z"} paź 23 18:57:59 lab-host34 serverstart.sh[637594]: NATIVE:2023-10-23 21:57:59 INFO: Native logger initialized paź 23 18:57:59 lab-host34 serverstart.sh[637594]: NATIVE:2023-10-23 21:57:59 INFO: Printer logger initialized paź 23 18:57:59 lab-host34 serverstart.sh[637594]: NATIVE:2023-10-23 21:57:59 INFO: Checking file: /opt/ingenicoserver/c801c4f1-e232-436c-v5a1-9b0d2dd8f99a.lic paź 23 18:57:59 lab-host34 serverstart.sh[637594]: {"message":"executed ok","level":"info","timestamp":"2023-10-23T19:57:59.456Z"} |