systemd:systemd
Différences
Ci-dessous, les différences entre deux révisions de la page.
Les deux révisions précédentesRévision précédenteProchaine révision | Révision précédenteDernière révisionLes deux révisions suivantes | ||
systemd:systemd [2017/05/06 12:49] – root | systemd:systemd [2017/10/08 09:29] – root | ||
---|---|---|---|
Ligne 3: | Ligne 3: | ||
* [[https:// | * [[https:// | ||
+ | * Recharge / redémarre systemd : | ||
< | < | ||
$ systemctl daemon-reload | $ systemctl daemon-reload | ||
- | $ systemctl daemon-rexec | + | $ systemctl daemon-reexec |
</ | </ | ||
+ | * Affiche la liste des dépendances d'une unité : | ||
< | < | ||
$ systemctl list-dependencies nfs-client.target | $ systemctl list-dependencies nfs-client.target | ||
Ligne 16: | Ligne 18: | ||
</ | </ | ||
+ | * Afficher une propriété d'un service : | ||
+ | < | ||
+ | $ systemctl show -p " | ||
+ | Wants=rpcbind.socket network-online.target auth-rpcgss-module.service rpc-statd-notify.service nfs-config.service rpc-statd.service nfs-idmapd.service | ||
+ | </ | ||
+ | |||
+ | * Liste l' | ||
+ | < | ||
+ | $ systemd-cgls | ||
+ | </ | ||
+ | |||
+ | * Affiche les uités : | ||
< | < | ||
$ systemctl list-unit-files --type=mount | $ systemctl list-unit-files --type=mount | ||
Ligne 50: | Ligne 64: | ||
</ | </ | ||
- | Overrider | + | * Modifie |
< | < | ||
$ sudo systemctl edit crond.service | $ sudo systemctl edit crond.service | ||
Ligne 58: | Ligne 72: | ||
$ sudo systemctl edit crond.service -full | $ sudo systemctl edit crond.service -full | ||
</ | </ | ||
+ | |||
+ | * Date pour timer : | ||
+ | < | ||
+ | Minimal form | ||
+ | Sat, | ||
+ | Mon,Sun 12-*-* 2, | ||
+ | Wed *-1 ==> Wed *-*-01 00:00:00 | ||
+ | Wed-Wed,Wed *-1 ==> Wed *-*-01 00:00:00 | ||
+ | Wed, 17:48 | ||
+ | Wed-Sat,Tue 12-10-15 1:2:3 ==> Tue-Sat 2012-10-15 01:02:03 | ||
+ | *-*-7 0:0:0 ==> *-*-07 00:00:00 | ||
+ | 10-15 ==> *-10-15 00:00:00 | ||
+ | monday *-12-* 17:00 ==> Mon *-12-* 17:00:00 | ||
+ | Mon,Fri *-*-3,1,2 *: | ||
+ | 12, | ||
+ | mon,fri *-1/2-1,3 *: | ||
+ | 03-05 08: | ||
+ | 08: | ||
+ | 05:40 ==> *-*-* 05:40:00 | ||
+ | Sat,Sun 12-05 08: | ||
+ | Sat,Sun 08: | ||
+ | 2003-03-05 05:40 | ||
+ | 2003-03-05 | ||
+ | 03-05 ==> *-03-05 00:00:00 | ||
+ | hourly | ||
+ | daily ==> *-*-* 00:00:00 | ||
+ | monthly | ||
+ | weekly | ||
+ | *: | ||
+ | </ | ||
+ | |||
+ | Some other options like **OnCalendar** are available : | ||
+ | * **OnActiveSec** defines a timer relative to the moment the timer itself is activated. | ||
+ | * **OnBootSec** defines a timer relative to when the machine was booted up. | ||
+ | * **OnStartupSec** defines a timer relative to when systemd was started. | ||
+ | * **OnUnitActiveSec** defines a timer relative to when the unit the timer is activating was last activated. | ||
+ | * **OnUnitInactiveSec** defines a timer relative to when the unit the timer is activating was last deactivated. | ||
+ | |||
+ | Exemple : | ||
+ | < | ||
+ | [Unit] | ||
+ | Description=Execute backup every day at midnight | ||
+ | |||
+ | [Timer] | ||
+ | OnCalendar=*-*-* 00:00:00 | ||
+ | Unit=backup.service | ||
+ | |||
+ | [Install] | ||
+ | WantedBy=multi-user.target | ||
+ | </ | ||
+ | |||
+ | * 2 moyens d' | ||
+ | * **loginctl enable-linger [user]** : Active les processus persistant pour le user donné (si pas de user alors user courant). L' | ||
+ | * Dans le fichier ''/ | ||
+ |
systemd/systemd.txt · Dernière modification : 2017/11/08 20:55 de root