openwrt / openwrt/packages

sysstat init file is heavily broken

Open
#25,556 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Makefile
Stars
4.6k
Forks
4k
Avg merge
3d 12h
Merged PRs (30d)
134

Description

Maintainer: @neheb @krant @ratkaj
Environment: x86_64 23.05.5 / 24.10.0-rc2

Description:

Init file is broken. https://github.com/openwrt/packages/blob/master/utils/sysstat/files/sysstat.init

  1. Must use /var/log/sa instead of /var/log/sysstat for compatibility with sar hardcoded value /var/log/sa.
  2. Line 26 [ -d /var/log/sysstat ] || mkdir -p /var/log/sysstat must use a non hardcoded variable $sa_dir.
  3. Line 37 procd_set_param command $PROG -S DISK -F -L - does not run:
# /usr/lib/sysstat/sadc -S DISK -F -L -
Cannot open /var/log/sa/sa15: No such file or directory

It has to include $sa_dir variable and do not include -, like this may be:

/usr/lib/sysstat/sadc -S DISK -F -L 1 $sa_dir

Also it has to include an interval variable, from config file possibly.

  1. Lines 28-34:
{
		echo "HISTORY=$log_history"
		echo "COMPRESSAFTER=$compressafter"
		echo "SADC_OPTIONS=\"$sadc_options\""
		echo "ZIP=\"$zip\""
		echo "ENABLED=\"$enabled\""
	} > $SYSSTAT_CFG

The config file is getting overwritten every time and thus truncated to a limited number of parameters, why?

Currently service starts but does not work:

# /etc/init.d/sysstat status
running
# service |grep sysstat
/etc/init.d/sysstat           	   enabled	   stopped

Cannot figure out how to fix it by myself properly for now.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Read utils/sysstat/files/sysstat.init and compare its log directory, sadc command, interval, and config-writing behavior with the issue's examples. Reproduce the service and status commands on OpenWrt, then verify that the service uses /var/log/sa, passes the configured interval and directory to sadc, and preserves the required config values.

Written by the indexing model from the issue text.

Assessment

Tech stack
shell
Domain
operating-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.