Skip to content

Commit

Permalink
dist: fix local-fs.target dependency
Browse files Browse the repository at this point in the history
systemd man page says:

systemd-fstab-generator(3) automatically adds dependencies of type Before= to
all mount units that refer to local mount points for this target unit.

So "Before=local-fs.taget" is the correct dependency for local mount
points, but we currently specify "After=local-fs.target", it should be
fixed.

Also replaced "WantedBy=multi-user.target" with "WantedBy=local-fs.target",
since .mount are not related with multi-user but depends local
filesystems.

Fixes scylladb#8761
  • Loading branch information
syuu1228 committed Nov 6, 2023
1 parent 6cc5bca commit 6e241d9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
3 changes: 1 addition & 2 deletions dist/common/scripts/scylla_coredump_setup
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,7 @@ ExternalSizeMax=1024G
[Unit]
Description=Save coredump to scylla data directory
Conflicts=umount.target
Before=scylla-server.service
After=local-fs.target
Before=local-fs.target scylla-server.service
DefaultDependencies=no
[Mount]
Expand Down
7 changes: 3 additions & 4 deletions dist/common/scripts/scylla_raid_setup
Original file line number Diff line number Diff line change
Expand Up @@ -257,19 +257,18 @@ if __name__ == '__main__':
dev_type = 'realpath'
LOGGER.error(f'Failed to detect uuid, using {dev_type}: {mount_dev}')

after = 'local-fs.target'
after = ''
wants = ''
if raid and args.raid_level != '0':
after += f' {md_service}'
after += f'\nAfter={md_service}'
wants = f'\nWants={md_service}'
opt_discard = ''
if args.online_discard:
opt_discard = ',discard'
unit_data = f'''
[Unit]
Description=Scylla data directory
Before=scylla-server.service
After={after}{wants}
Before=local-fs.target scylla-server.service{after}{wants}
DefaultDependencies=no
[Mount]
Expand Down

0 comments on commit 6e241d9

Please sign in to comment.