[Hector Cao]
> -runlevel > runlevel
> +if command -v systemctl >/dev/null 2>&1 && [ -d /run/systemd/system ]; then
> +    systemctl list-units --type=target --state=active > runlevel
> +elif command -v runlevel >/dev/null 2>&1; then
> +    runlevel > runlevel
> +fi

I believe this is the wrong approach.  The systemctl command is not
presenting the current runlevel, it is presenting something else, and it
belong in a diffferent file name.

If the runlevel command do not exist, the runlevel file should not be
created.  Changing the content of well known files place too much
guesswork on the client code parsing the collected information.

-- 
Happy hacking
Petter Reinholdtsen

Reply via email to