« Linux : Création d'un service systemd » : différence entre les versions

De www.yakakliker.org
(Page créée avec « <code>sudo /etc/systemd/system/application.service</code> == Exemples == <syntaxhighlight lang="bash"> [Unit] Description=nexus service After=network.target [Service] Type=forking LimitNOFILE=65536 ExecStart=/opt/nexus/bin/nexus start ExecStop=/opt/nexus/bin/nexus stop User=nexus Restart=on-abort [Install] WantedBy=multi-user.target </syntaxhighlight><syntaxhighlight lang="bash"> [Unit] Description=Gunicorn instance to serve application After=network.target [... »)
 
Aucun résumé des modifications
Ligne 32 : Ligne 32 :
WantedBy=default.target
WantedBy=default.target
</syntaxhighlight>
</syntaxhighlight>
‎<html>
<a href="https://www.compteurdevisite.com" title="compteur web gratuit sans pub"><img src="https://counter6.optistats.ovh/private/compteurdevisite.php?c=b4epghealnwlf7wuq7gn3ygll9aywrfx" border="0" title="compteur web gratuit sans pub" alt="compteur web gratuit sans pub"></a>
‎</html>
‎ <html>
<script src='https://storage.ko-fi.com/cdn/scripts/overlay-widget.js'></script>
<script>
  kofiWidgetOverlay.draw('yakakliker', {
    'type': 'floating-chat',
    'floating-chat.donateButton.text': 'Café',
    'floating-chat.donateButton.background-color': '#00b9fe',
    'floating-chat.donateButton.text-color': '#fff'
  });
</script>
‎</html>

Version du 24 avril 2025 à 16:46

sudo /etc/systemd/system/application.service

Exemples

[Unit]
Description=nexus service
After=network.target

[Service]
Type=forking
LimitNOFILE=65536
ExecStart=/opt/nexus/bin/nexus start
ExecStop=/opt/nexus/bin/nexus stop
User=nexus
Restart=on-abort

[Install]
WantedBy=multi-user.target
[Unit]
Description=Gunicorn instance to serve application
After=network.target

[Service]
User=application
Group=application
WorkingDirectory=/home/application/www/flask
Environment="PATH=/home/application/www/flask"
ExecStart=/home/application/.pyenv/versions/3.9.20/bin/gunicorn -w 4 -c gunicorn_conf.py 'application:app' --bind 127.0.0.1:8000

[Install]
WantedBy=default.target


compteur web gratuit sans pub