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

fix: skip unsupported kernel in systemd service #1261

Merged
merged 1 commit into from
Apr 21, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion build/package/nfpm/systemd/dfget-daemon.service
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ After=network.target

[Service]
Type=simple
ExecStartPre=/bin/bash /opt/dragonfly/fix.dfget-daemon.cpuset.sh
ExecStartPre=-/bin/sh /opt/dragonfly/fix.dfget-daemon.cpuset.sh
ExecStart=/usr/bin/dfget daemon
ExecReload=/bin/kill -HUP $MAINPID
Restart=always
Expand Down
5 changes: 5 additions & 0 deletions build/package/nfpm/systemd/fix.dfget-daemon.cpuset.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
#!/bin/sh

# skip unsupported and newly kernel
if [ ! -d /sys/fs/cgroup/cpuset,cpu,cpuacct ]; then
exit 0
fi

# fix cpu set not settled in old kernel
mkdir -p /sys/fs/cgroup/cpuset,cpu,cpuacct/dragonfly.slice/dfget-daemon.service
cat /sys/fs/cgroup/cpuset,cpu,cpuacct/cpuset.cpus > \
Expand Down