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édente | ||
| systemd:systemd [2017/05/06 10:39] – root | systemd:systemd [2017/11/08 20:55] (Version actuelle) – root | ||
|---|---|---|---|
| Ligne 2: | Ligne 2: | ||
| * [[http:// | * [[http:// | ||
| * [[https:// | * [[https:// | ||
| + | |||
| + | * Recharge / redémarre systemd : | ||
| + | < | ||
| + | $ systemctl daemon-reload | ||
| + | $ systemctl daemon-reexec | ||
| + | </ | ||
| + | |||
| + | * Affiche la liste des dépendances d'une unité : | ||
| + | < | ||
| + | $ systemctl list-dependencies nfs-client.target | ||
| + | nfs-client.target | ||
| + | ● ├─auth-rpcgss-module.service | ||
| + | ● ├─rpc-statd-notify.service | ||
| + | ● └─remote-fs-pre.target | ||
| + | </ | ||
| + | |||
| + | * 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 | ||
| + | UNIT FILE | ||
| + | -.mount | ||
| + | boot-efi.mount | ||
| + | dev-hugepages.mount | ||
| + | dev-mqueue.mount | ||
| + | home.mount | ||
| + | proc-fs-nfsd.mount | ||
| + | proc-sys-fs-binfmt_misc.mount static | ||
| + | sys-fs-fuse-connections.mount static | ||
| + | sys-kernel-config.mount | ||
| + | sys-kernel-debug.mount | ||
| + | tmp.mount | ||
| + | var-lib-machines.mount | ||
| + | var-lib-nfs-rpc_pipefs.mount | ||
| + | |||
| + | 13 unit files listed. | ||
| + | </ | ||
| + | |||
| + | < | ||
| + | $ systemctl list-unit-files --state=generated | ||
| + | UNIT FILE STATE | ||
| + | -.mount | ||
| + | boot-efi.mount | ||
| + | home.mount | ||
| + | livesys-late.service generated | ||
| + | livesys.service | ||
| + | netconsole.service | ||
| + | network.service | ||
| + | |||
| + | 7 unit files listed. | ||
| + | </ | ||
| + | |||
| + | * Modifie un service existant ou en crée un nouveau : | ||
| + | < | ||
| + | $ sudo systemctl edit crond.service | ||
| + | $ | ||
| + | $ #Liste edite le service et recopiant le père | ||
| + | $ sudo systemctl edit crond.service -l | ||
| + | $ 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.1494067161.txt.gz · Dernière modification : de root
