# Redémarrage automatique d'un service

**URL:** <https://www.debian-fr.org/t/redemarrage-automatique-dun-service/84002>\
**Category:** Support Debian\
**Tags:** systemd\
**Created:** [Février 16, 2021, 7:36 UTC](https://www.debian-fr.org/t/redemarrage-automatique-dun-service/84002 "2021-02-16T07:36:51Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![anon84813274](https://www.debian-fr.org/letter_avatar_proxy/v4/letter/a/a6a055/32.png) [@anon84813274](https://www.debian-fr.org/u/anon84813274)\
**Post date:** [Février 16, 2021, 7:36 UTC](https://www.debian-fr.org/t/redemarrage-automatique-dun-service/84002/1 "2021-02-16T07:36:51Z")

</div>

Bonjour,  
Mon service displaylink-driver.service démarre bien au démarrage de l’hôte mais devrait démarrer aussi lors du branchement d’un périphérique usb (compatible DP) or ce n’est pas le cas ici (car après le débranchement du périphérique ou de la mise en veille, le service passe en loaded /inactive (dead) mais ne redémarre pas lors du rebranchement (mais quand je kill le service, il redémarre bien automatiquement). En gros je n’ai pas de HotPlug (je dois démarrer le service manuellement) et j’aurai voulu savoir si cela venait plus du systemd/udev mal configuré ou plus du driver ? j’ai farfouillé dans les confs mais pour moi ça m’a l’air ok donc j’aurai voulu votre avis !

infos :  
Micro-Star International Co., Ltd. GL62M 7RDX/MS-16J9, BIOS E16J9IMS.324 03/23/2018, EFI v2.50 by American Megatrends  
Linux version 5.10.0-1-amd64 / Debian 11  
DP Driver : 5.3.1.34  
evdi-dkms : 1.7.2 (1.9.0 not work, virtual screen ko but dkms install and run ok)  
DKMS : 2.8.4-1

[99-displaylink.rules.txt](https://www.debian-fr.org/uploads/short-url/up202tTho2Fk3RsHkcOtTU4Mog5.txt) (784 Octets) [debtr-systemd-displaylink-driver.html](https://www.debian-fr.org/uploads/short-url/1YaUu7s1FDezbIkJ70ERBp8SMFR.html) (6,5 Ko) [displaylink-debian.sh.txt](https://www.debian-fr.org/uploads/short-url/cp24VzKFtj9MtIhEDZ15MUrCrFK.txt) (24,2 Ko) [displaylink-driver.service.txt](https://www.debian-fr.org/uploads/short-url/6ni4POstNETVoWVx5OpPrPqUJnU.txt) (397 Octets) [evdi.html](https://www.debian-fr.org/uploads/short-url/xoNvCWloOPGFh9WjYzYmw3i76Js.html) (10,8 Ko) [suspend.sh.txt](https://www.debian-fr.org/uploads/short-url/nLEGWoOT7yjCaHd5RDAbv7iEah8.txt) (976 Octets) [udev.sh.txt](https://www.debian-fr.org/uploads/short-url/6DieYGjFn6NAMza8nBdBDK81b4U.txt) (2,1 Ko)

---

<div class="post-metadata">

**Author:** ![grandtoubab](https://www.debian-fr.org/user_avatar/www.debian-fr.org/grandtoubab/32/4505_2.png) [@grandtoubab](https://www.debian-fr.org/u/grandtoubab)\
**Post date:** [Février 16, 2021, 9:20 UTC](https://www.debian-fr.org/t/redemarrage-automatique-dun-service/84002/2 "2021-02-16T09:20:19Z")

</div>

ce n’est pas un service fourni par Debian

```auto
systemctl status displaylink-driver.service
Unit displaylink-driver.service could not be found.

```

vaut mieux te renseigner à la source DisplayLink  
[Threads in Forum : Linux and Open Source](https://www.displaylink.org/forum/forumdisplay.php?s=48d785956aa229e9261777569f80f5f4&f=29)

Pour en savoir plus sur un service systemd

> **[systemd.service](https://www.freedesktop.org/software/systemd/man/latest/systemd.service.html)**

> [@](#):
>
> `Restart=`
> 
> Configures whether the service shall be restarted when the service process exits, is killed, or a timeout is reached. The service process may be the main service process, but it may also be one of the processes specified with `ExecStartPre=` , `ExecStartPost=` , `ExecStop=` , `ExecStopPost=` , or `ExecReload=` . When the death of the process is a result of systemd operation (e.g. service stop or restart), the service will not be restarted. Timeouts include missing the watchdog «&nbsp;keep-alive ping&nbsp;» deadline and a service start, reload, and stop operation timeouts.
> 
> Takes one of `no` , `on-success` , `on-failure` , `on-abnormal` , `on-watchdog` , `on-abort` , or `always`
> 
> bla bla bla

---

<div class="post-metadata">

**Author:** ![anon84813274](https://www.debian-fr.org/letter_avatar_proxy/v4/letter/a/a6a055/32.png) [@anon84813274](https://www.debian-fr.org/u/anon84813274)\
**Post date:** [Février 16, 2021, 10:58 UTC](https://www.debian-fr.org/t/redemarrage-automatique-dun-service/84002/3 "2021-02-16T10:58:19Z")

</div>

> [@grandtoubab](#):
>
> ce n’est pas un service fourni par Debian

Oui il n’est effectivement pas founit par debian mais ce n’est pas vraiment le fourniseur que je remet en cause (car la seule distrib prise en charge officiellement est Ubuntu) mais je veux juste comprendre comment configurer le service.

> [@grandtoubab](#):
>
> When the death of the process is a result of systemd operation (e.g. service stop or restart), the service will not be restarted.

J’ai lu un peu la doc de systemd et j’ai une question : comment savoir quel type de signal a arrété le service quand je débranche le périphérique usb ?

.syslog

```plaintext
Jan 18 18:58:04 debian kernel: [3350.807534] evdi: [D] evdi_detect:94 (dev=0) poll connector state: disconnected
Jan 18 18:58:04 debian kernel: [3350.807543] evdi: [D] evdi_detect:94 (dev=0) poll connector state: disconnected
Jan 18 18:58:04 debian kernel: [3350.807551] evdi: [D] evdi_detect:94 (dev=0) poll connector state: disconnected
Jan 18 18:58:04 debian kernel: [3350.842231] evdi: [D] evdi_painter_dpms_notify:654 (dev=0) Notifying dpms mode: 3
Jan 18 18:58:04 debian kernel: [3350.842233] evdi: [W] evdi_painter_send_event:307 Painter is not connected!
Jan 18 18:58:04 debian kernel: [3350.842240] evdi: [D] evdi_painter_dpms_notify:654 (dev=0) Notifying dpms mode: 3
Jan 18 18:58:04 debian kernel: [3350.842253] evdi: [W] evdi_painter_send_event:307 Painter is not connected!
Jan 18 18:58:04 debian kernel: [3350.842261] evdi: [D] evdi_painter_dpms_notify:654 (dev=-1) Notifying dpms mode: 3
Jan 18 18:58:04 debian kernel: [3350.842262] evdi: [W] evdi_painter_send_event:307 Painter is not connected!
Jan 18 18:58:04 debian kernel: [3350.842271] evdi: [D] evdi_painter_dpms_notify:654 (dev=-1) Notifying dpms mode: 3
Jan 18 18:58:09 debian systemd[1]: displaylink-driver.service: Succeeded.
Jan 18 18:58:09 debian systemd[1]: Stopped DisplayLink Driver Service.
Jan 18 18:58:09 debian systemd[1]: displaylink-driver.service: Consumed 1min 7.803s CPU time.

```

---

<div class="post-metadata">

**Author:** ![Clochette](https://www.debian-fr.org/user_avatar/www.debian-fr.org/clochette/32/8757_2.png) [@Clochette](https://www.debian-fr.org/u/Clochette)\
**Post date:** [Février 16, 2021, 8:26 UTC](https://www.debian-fr.org/t/redemarrage-automatique-dun-service/84002/4 "2021-02-16T20:26:03Z")

</div>

Pour gérer une unit.service de systemd sur un event c’est à l’aide de systemd-udevd.service, mais je pratique pas ce type de bricolage à la maison …

Un lien expliquant comment suivre un event à l’aide de systemd sur de l’ambarqué :

[https://linuxembedded.fr/2018/03/kernel-udev-et-systemd-la-gestion-du-hotplug](https://linuxembedded.fr/2018/03/kernel-udev-et-systemd-la-gestion-du-hotplug)
