mirror of
https://github.com/systemd/systemd
synced 2025-10-05 16:03:15 +02:00
fsck,quotacheck: drop support for traditional /forcefsck, /fastboot, and /forcequotacheck files
Instead, please use the kernel command line options with the same name. I am not sure these files are System V complieant or not, but at least they are very traditional way to control fsck or quotacheck. However, the concept of the files are really broken, especially for fsck. As when we want to fsck the root filesystem, we need to access the filessystem, but it may be broken... Let's drop such traditional ways to control fsck and quotacheck. We already support kernel command line options to control the behaviors. Maybe, also it is better to provide ways to control them by credentials.
This commit is contained in:
@@ -33,7 +33,6 @@
|
||||
|
||||
static bool arg_skip = false;
|
||||
static bool arg_force = false;
|
||||
static bool arg_show_progress = false;
|
||||
static const char *arg_repair = "-a";
|
||||
|
||||
static void start_target(const char *target, const char *mode) {
|
||||
@@ -105,23 +104,6 @@ static int parse_proc_cmdline_item(const char *key, const char *value, void *dat
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void test_files(void) {
|
||||
|
||||
#if HAVE_SYSV_COMPAT
|
||||
if (access("/fastboot", F_OK) >= 0) {
|
||||
log_error("Please pass 'fsck.mode=skip' on the kernel command line rather than creating /fastboot on the root file system.");
|
||||
arg_skip = true;
|
||||
}
|
||||
|
||||
if (access("/forcefsck", F_OK) >= 0) {
|
||||
log_error("Please pass 'fsck.mode=force' on the kernel command line rather than creating /forcefsck on the root file system.");
|
||||
arg_force = true;
|
||||
}
|
||||
#endif
|
||||
|
||||
arg_show_progress = access("/run/systemd/show-status", F_OK) >= 0;
|
||||
}
|
||||
|
||||
static double percent(int pass, unsigned long cur, unsigned long max) {
|
||||
/* Values stolen from e2fsck */
|
||||
|
||||
@@ -249,7 +231,7 @@ static int run(int argc, char *argv[]) {
|
||||
if (r < 0)
|
||||
log_warning_errno(r, "Failed to parse kernel command line, ignoring: %m");
|
||||
|
||||
test_files();
|
||||
bool show_progress = access("/run/systemd/show-status", F_OK) >= 0;
|
||||
|
||||
if (!arg_force && arg_skip)
|
||||
return 0;
|
||||
@@ -328,7 +310,7 @@ static int run(int argc, char *argv[]) {
|
||||
|
||||
console = fopen("/dev/console", "we");
|
||||
if (console &&
|
||||
arg_show_progress &&
|
||||
show_progress &&
|
||||
pipe(progress_pipe) < 0)
|
||||
return log_error_errno(errno, "pipe(): %m");
|
||||
|
||||
|
@@ -38,16 +38,6 @@ static int parse_proc_cmdline_item(const char *key, const char *value, void *dat
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void test_files(void) {
|
||||
|
||||
#if HAVE_SYSV_COMPAT
|
||||
if (access("/forcequotacheck", F_OK) >= 0) {
|
||||
log_error("Please pass 'quotacheck.mode=force' on the kernel command line rather than creating /forcequotacheck on the root file system. Proceeding anyway.");
|
||||
arg_force = true;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
static int run(int argc, char *argv[]) {
|
||||
int r;
|
||||
|
||||
@@ -63,8 +53,6 @@ static int run(int argc, char *argv[]) {
|
||||
if (r < 0)
|
||||
log_warning_errno(r, "Failed to parse kernel command line, ignoring: %m");
|
||||
|
||||
test_files();
|
||||
|
||||
if (!arg_force) {
|
||||
if (arg_skip)
|
||||
return 0;
|
||||
|
@@ -21,11 +21,4 @@ L$ /var/log/README - - - - ../..{{DOC_DIR}}/README.logs
|
||||
# /run/lock/subsys is used for serializing SysV service execution, and
|
||||
# hence without use on SysV-less systems.
|
||||
d /run/lock/subsys 0755 root root -
|
||||
|
||||
# /forcefsck, /fastboot and /forcequotacheck are deprecated in favor of the
|
||||
# kernel command line options 'fsck.mode=force', 'fsck.mode=skip' and
|
||||
# 'quotacheck.mode=force'
|
||||
r! /forcefsck
|
||||
r! /fastboot
|
||||
r! /forcequotacheck
|
||||
{% endif %}
|
||||
|
Reference in New Issue
Block a user