fstab-generator: Generate explicit dependencies on systemd-fsck@.service instead of using FsckPassNo
[tomegun: * order all fsck instances after fsck-root * check for OOM * added notes in the manpages]
This commit is contained in:
parent
7f5806d709
commit
64e70e4b86
|
@ -62,7 +62,8 @@
|
||||||
system
|
system
|
||||||
check. <filename>systemd-fsck-root.service</filename> is
|
check. <filename>systemd-fsck-root.service</filename> is
|
||||||
responsible for file system checks on the root
|
responsible for file system checks on the root
|
||||||
file system.</para>
|
file system. The root file system check is performed
|
||||||
|
before the other file systems.</para>
|
||||||
|
|
||||||
<para><filename>systemd-fsck</filename> will
|
<para><filename>systemd-fsck</filename> will
|
||||||
forward file system checking progress to the
|
forward file system checking progress to the
|
||||||
|
|
|
@ -61,6 +61,11 @@
|
||||||
reloaded. This will instantiate mount and swap units
|
reloaded. This will instantiate mount and swap units
|
||||||
as necessary.</para>
|
as necessary.</para>
|
||||||
|
|
||||||
|
<para>The <term><varname>passno</varname></term> field
|
||||||
|
is treated like a simlpe boolean, and the ordering information
|
||||||
|
is discarded. However, the root filesystem is checked
|
||||||
|
before all the other filesystems.</para>
|
||||||
|
|
||||||
<para>See
|
<para>See
|
||||||
<citerefentry><refentrytitle>systemd.mount</refentrytitle><manvolnum>5</manvolnum></citerefentry>
|
<citerefentry><refentrytitle>systemd.mount</refentrytitle><manvolnum>5</manvolnum></citerefentry>
|
||||||
and
|
and
|
||||||
|
|
|
@ -209,17 +209,30 @@ static int add_mount(
|
||||||
"Before=%s\n",
|
"Before=%s\n",
|
||||||
post);
|
post);
|
||||||
|
|
||||||
|
if (passno > 0) {
|
||||||
|
_cleanup_free_ char *fsck = NULL;
|
||||||
|
|
||||||
|
fsck = unit_name_from_path_instance("systemd-fsck", what, ".service");
|
||||||
|
if (!fsck)
|
||||||
|
return log_oom();
|
||||||
|
|
||||||
|
fprintf(f,
|
||||||
|
"Requires=%s\n"
|
||||||
|
"After=%s\n",
|
||||||
|
fsck,
|
||||||
|
fsck);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
fprintf(f,
|
fprintf(f,
|
||||||
"\n"
|
"\n"
|
||||||
"[Mount]\n"
|
"[Mount]\n"
|
||||||
"What=%s\n"
|
"What=%s\n"
|
||||||
"Where=%s\n"
|
"Where=%s\n"
|
||||||
"Type=%s\n"
|
"Type=%s\n",
|
||||||
"FsckPassNo=%i\n",
|
|
||||||
what,
|
what,
|
||||||
where,
|
where,
|
||||||
type,
|
type);
|
||||||
passno);
|
|
||||||
|
|
||||||
if (!isempty(opts) &&
|
if (!isempty(opts) &&
|
||||||
!streq(opts, "defaults"))
|
!streq(opts, "defaults"))
|
||||||
|
|
|
@ -10,7 +10,7 @@ Description=File System Check on %f
|
||||||
Documentation=man:systemd-fsck@.service(8)
|
Documentation=man:systemd-fsck@.service(8)
|
||||||
DefaultDependencies=no
|
DefaultDependencies=no
|
||||||
BindsTo=%i.device
|
BindsTo=%i.device
|
||||||
After=systemd-readahead-collect.service systemd-readahead-replay.service %i.device
|
After=systemd-readahead-collect.service systemd-readahead-replay.service %i.device systemd-fsck-root.service
|
||||||
Before=shutdown.target
|
Before=shutdown.target
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
|
|
Loading…
Reference in a new issue