Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invalid fstrim.service commandline #2591

Open
dpgeekzero opened this issue Jun 10, 2019 · 4 comments

Comments

Projects
None yet
3 participants
@dpgeekzero
Copy link

commented Jun 10, 2019

Issue Report

Bug

Container Linux Version

NAME="Container Linux by CoreOS"
ID=coreos
VERSION=2079.5.1
VERSION_ID=2079.5.1
BUILD_ID=2019-06-05-2258
PRETTY_NAME="Container Linux by CoreOS 2079.5.1 (Rhyolite)"
ANSI_COLOR="38;5;75"
HOME_URL="https://coreos.com/"
BUG_REPORT_URL="https://issues.coreos.com"
COREOS_BOARD="amd64-usr"

Environment

Dell PowerEdge R640

Expected Behavior

● fstrim.service - Discard unused blocks
   Loaded: loaded (/usr/lib/systemd/system/fstrim.service; static; vendor preset: disabled)
   Active: inactive (dead) since Mon 2019-06-10 00:00:51 UTC; 18h ago
  Process: 32120 ExecStart=/sbin/fstrim -av (code=exited, status=0/SUCCESS)
 Main PID: 32120 (code=exited, status=0/SUCCESS)

Jun 10 00:00:50 node-03.dev systemd[1]: Starting Discard unused blocks...
Jun 10 00:00:51 node-03.dev systemd[1]: Started Discard unused blocks.

Actual Behavior

● fstrim.service - Discard unused blocks on filesystems from /etc/fstab
   Loaded: loaded (/usr/lib/systemd/system/fstrim.service; static; vendor preset: disabled)
   Active: failed (Result: exit-code) since Mon 2019-06-10 18:54:43 UTC; 2s ago
  Process: 20986 ExecStart=/sbin/fstrim -Av (code=exited, status=32)
 Main PID: 20986 (code=exited, status=32)

Jun 10 18:54:43 node-05.dev systemd[1]: Starting Discard unused blocks on filesystems from /etc/fstab...
Jun 10 18:54:43 node-05.dev fstrim[20986]: fstrim: failed to parse /etc/fstab: No such file or directory
Jun 10 18:54:43 node-05.dev systemd[1]: fstrim.service: Main process exited, code=exited, status=32/n/a
Jun 10 18:54:43 node-05.dev systemd[1]: fstrim.service: Failed with result 'exit-code'.
Jun 10 18:54:43 node-05.dev systemd[1]: Failed to start Discard unused blocks on filesystems from /etc/fstab.

Reproduction Steps

  1. systemctl start fstrim.service
  2. systemctl status fstrim.service

Other Information

Newer builds of Container Linux do not populate the /etc/fstab file, so the fstrim.service should be updated.

The ExecStart for fstrim.service is ExecStart=/sbin/fstrim -Av. It should probably be changed to ExecStart=/sbin/fstrim -av

@ajeddeloh

This comment has been minimized.

Copy link

commented Jun 10, 2019

I'd be hesitant to use -a since that may trim filesystems that user does not want trimmed, but yeah, this shouldn't error. Perhaps the unit should have a ConditionPathExists=/etc/fstab instead?

@dpgeekzero

This comment has been minimized.

Copy link
Author

commented Jun 10, 2019

If entries /etc/fstab have a special meaning, then should the file have been removed?

@ajeddeloh

This comment has been minimized.

Copy link

commented Jun 11, 2019

/etc/fstab doesn't really have special meaning. Systemd doesn't even use it directly, a generator reads it and generates mount units which systemd then uses. The default filesystems for CL have their own mount units which means /etc/fstab isn't needed by default.

@lucab

This comment has been minimized.

Copy link
Member

commented Jun 12, 2019

I'm not sure where this unit is coming from and who is consuming it, but another option is to make a templated unit and use %I as the mountpoint arg from the instantiated service.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.