[systemd-devel] [PATCH 10/12] Add fsckd service and socket, retarget systemd-fsck

Zbigniew Jędrzejewski-Szmek zbyszek at in.waw.pl
Wed Jan 28 07:00:18 PST 2015


On Wed, Jan 28, 2015 at 02:24:32PM +0100, Didier Roche wrote:
> 

> From 000f1b6ff4f5f80a2a13309590d255de6d6526ec Mon Sep 17 00:00:00 2001
> From: Didier Roche <didrocks at ubuntu.com>
> Date: Mon, 26 Jan 2015 17:30:00 +0100
> Subject: [PATCH 10/12] Add fsckd service and socket, retarget systemd-fsck
> 
> systemd-fsckd can be socket-activated by systemd-fsck process. Reflect that
> in the different unit files.
> ---
>  Makefile.am                        |  3 +++
>  units/.gitignore                   |  1 +
>  units/systemd-fsck-root.service.in |  4 +++-
>  units/systemd-fsck at .service.in     |  5 +++--
>  units/systemd-fsckd.service.in     | 16 ++++++++++++++++
>  units/systemd-fsckd.socket         | 15 +++++++++++++++
>  6 files changed, 41 insertions(+), 3 deletions(-)
>  create mode 100644 units/systemd-fsckd.service.in
>  create mode 100644 units/systemd-fsckd.socket
> 
> diff --git a/Makefile.am b/Makefile.am
> index a9d61f1..1eeba4f 100644
> --- a/Makefile.am
> +++ b/Makefile.am
> @@ -492,6 +492,7 @@ dist_systemunit_DATA = \
>  	units/slices.target \
>  	units/system.slice \
>  	units/x-.slice \
> +	units/systemd-fsckd.socket \
>  	units/systemd-initctl.socket \
>  	units/systemd-shutdownd.socket \
>  	units/syslog.socket \
> @@ -543,6 +544,7 @@ nodist_systemunit_DATA = \
>  	units/systemd-kexec.service \
>  	units/systemd-fsck at .service \
>  	units/systemd-fsck-root.service \
> +	units/systemd-fsckd.service \
>  	units/systemd-machine-id-commit.service \
>  	units/systemd-udevd.service \
>  	units/systemd-udev-trigger.service \
> @@ -596,6 +598,7 @@ EXTRA_DIST += \
>  	units/user/systemd-exit.service.in \
>  	units/systemd-fsck at .service.in \
>  	units/systemd-fsck-root.service.in \
> +	units/systemd-fsckd.service.in \
>  	units/systemd-machine-id-commit.service.in \
>  	units/user at .service.m4.in \
>  	units/debug-shell.service.in \
> diff --git a/units/.gitignore b/units/.gitignore
> index 6fdb629..26ae965 100644
> --- a/units/.gitignore
> +++ b/units/.gitignore
> @@ -28,6 +28,7 @@
>  /systemd-firstboot.service
>  /systemd-fsck-root.service
>  /systemd-fsck at .service
> +/systemd-fsckd.service
>  /systemd-machine-id-commit.service
>  /systemd-halt.service
>  /systemd-hibernate.service
> diff --git a/units/systemd-fsck-root.service.in b/units/systemd-fsck-root.service.in
> index 6d76578..bd3bdbc 100644
> --- a/units/systemd-fsck-root.service.in
> +++ b/units/systemd-fsck-root.service.in
> @@ -9,12 +9,14 @@
>  Description=File System Check on Root Device
>  Documentation=man:systemd-fsck-root.service(8)
>  DefaultDependencies=no
> +Wants=systemd-fsckd.socket
>  Before=local-fs.target shutdown.target
> +After=systemd-fsckd.socket
>  ConditionPathIsReadWrite=!/
>  
>  [Service]
>  Type=oneshot
>  RemainAfterExit=yes
>  ExecStart=@rootlibexecdir@/systemd-fsck
> -StandardOutput=journal+console
> +StandardOutput=journal
Just remove the line completely to use the admin default (here and in
other cases...).

>  TimeoutSec=0
> diff --git a/units/systemd-fsck at .service.in b/units/systemd-fsck at .service.in
> index 857e625..3ceb5f2 100644
> --- a/units/systemd-fsck at .service.in
> +++ b/units/systemd-fsck at .service.in
> @@ -10,12 +10,13 @@ Description=File System Check on %f
>  Documentation=man:systemd-fsck at .service(8)
>  DefaultDependencies=no
>  BindsTo=%i.device
> -After=%i.device systemd-fsck-root.service local-fs-pre.target
> +Wants=systemd-fsckd.socket
> +After=%i.device systemd-fsck-root.service local-fs-pre.target systemd-fsckd.socket
>  Before=shutdown.target
>  
>  [Service]
>  Type=oneshot
>  RemainAfterExit=yes
>  ExecStart=@rootlibexecdir@/systemd-fsck %f
> -StandardOutput=journal+console
> +StandardOutput=journal
>  TimeoutSec=0
> diff --git a/units/systemd-fsckd.service.in b/units/systemd-fsckd.service.in
> new file mode 100644
> index 0000000..27c325f
> --- /dev/null
> +++ b/units/systemd-fsckd.service.in
> @@ -0,0 +1,16 @@
> +#  This file is part of systemd.
> +#
> +#  systemd is free software; you can redistribute it and/or modify it
> +#  under the terms of the GNU Lesser General Public License as published by
> +#  the Free Software Foundation; either version 2.1 of the License, or
> +#  (at your option) any later version.
> +
> +[Unit]
> +Description=File System Check Daemon to report status
> +DefaultDependencies=no
> +Requires=systemd-fsckd.socket
> +Before=shutdown.target
> +
> +[Service]
> +ExecStart=@rootlibexecdir@/systemd-fsckd
> +StandardOutput=journal+console
> diff --git a/units/systemd-fsckd.socket b/units/systemd-fsckd.socket
> new file mode 100644
> index 0000000..96a034a
> --- /dev/null
> +++ b/units/systemd-fsckd.socket
> @@ -0,0 +1,15 @@
> +#  This file is part of systemd.
> +#
> +#  systemd is free software; you can redistribute it and/or modify it
> +#  under the terms of the GNU Lesser General Public License as published by
> +#  the Free Software Foundation; either version 2.1 of the License, or
> +#  (at your option) any later version.
> +
> +[Unit]
> +Description=fsck to fsckd communication Socket
> +Documentation=man:systemd-fsck at .service(8) man:systemd-fsck-root.service(8)
> +DefaultDependencies=no
> +Before=sockets.target
Is this necessary? It is pulled in by the fsck units already, I don't think we
need to start it separately.

> +
> +[Socket]
> +ListenStream=/run/systemd/fsckd

Zbyszek


More information about the systemd-devel mailing list