J'ai créé une application en nodejs lié au webhook de github (au push sur la branche master). Ca fonctionne bien, mais lorsque je veux le lancer en mode service rien ne se passe au push.
et le service (/etc/systemd/system/github-webhook.service)
[Unit]
Description=Autodeploy when push on master using the Github's webhook
After=network.target
[Service]
Environment=PORT=8000
ExecStart=/usr/bin/node /var/www/github-autodeploy/app.js
Restart=on-failure
[Install]
WantedBy=multi-user.target
● github-webhook.service - Autodeploy when push on master using the Github's webhook
Loaded: loaded (/etc/systemd/system/github-webhook.service; enabled; vendor preset: enabled)
Active: active (running) since Fri 2019-10-18 08:18:51 UTC; 38s ago
Main PID: 1680 (node)
Tasks: 6 (limit: 1152)
CGroup: /system.slice/github-webhook.service
└─1680 /usr/bin/node /var/www/github-autodeploy/app.js
Oct 18 08:18:51 ip-172-31-26-250 systemd[1]: github-webhook.service: Service hold-off time over, scheduling restart.
Oct 18 08:18:51 ip-172-31-26-250 systemd[1]: github-webhook.service: Scheduled restart job, restart counter is at 1.
Oct 18 08:18:51 ip-172-31-26-250 systemd[1]: Stopped Autodeploy when push on master using the Github's webhook.
Oct 18 08:18:51 ip-172-31-26-250 systemd[1]: Started Autodeploy when push on master using the Github's webhook.
Oct 18 08:18:52 ip-172-31-26-250 node[1680]: Server started at port 8000
A chaque fois que je fais un systemctl status il me réaffiche stopped et started, ça vient peut être de la le problème ?
Ligne 17, tu spécies un fichier relatif. Alors que toi tu lance probablement ton code node dans le répertoire courant contenant script.sh. Met un chemin absolu et ça devrait régler le probléme (en faisant un systemctl restart github-webhook bien sûr).
git is great because Linus did it, mercurial is better because he didn't.
Ligne 17, tu spécies un fichier relatif. Alors que toi tu lance probablement ton code node dans le répertoire courant contenant script.sh. Met un chemin absolu et ça devrait régler le probléme (en faisant un systemctl restart github-webhook bien sûr).
C'était effectivement ça, merci beaucoup ça fonctionne bien
Mon service ne fonctionne pas
× Après avoir cliqué sur "Répondre" vous serez invité à vous connecter pour que votre message soit publié.
× Attention, ce sujet est très ancien. Le déterrer n'est pas forcément approprié. Nous te conseillons de créer un nouveau sujet pour poser ta question.
git is great because Linus did it, mercurial is better because he didn't.
git is great because Linus did it, mercurial is better because he didn't.