]> git.ipfire.org Git - thirdparty/dracut-ng.git/commitdiff
fix(dracut-logger): do not export maxloglvl and syslogfacility
authorBenjamin Drung <benjamin.drung@canonical.com>
Sat, 31 Jan 2026 00:39:21 +0000 (01:39 +0100)
committerNeal Gompa (ニール・ゴンパ) <ngompa13@gmail.com>
Wed, 4 Feb 2026 12:48:30 +0000 (07:48 -0500)
Commit 46265a9d3e0a ("dracut-logger: make $maxloglvl public") exports
the `maxloglvl` variable, but this is not needed. Exporting variables is
only needed when subprocesses need to access those variables.

`maxloglvl` is only used in `dracut-logger.sh` and `dracut.sh`.
`dracut.sh` sources `dracut-logger.sh`. So exporting `maxloglvl` is not
needed. `syslogfacility` is only used in `dracut-logger.sh`.

So do not export `maxloglvl` and `syslogfacility`.

dracut-logger.sh

index 81fe2726b710cb04ea987805a2e9858d47ec5e52..1f87e4578429c2436b09fccfd9d7a1f744f76301 100644 (file)
@@ -166,7 +166,6 @@ dlog_init() {
         else
             readonly syslogfacility=daemon
         fi
-        export syslogfacility
     fi
 
     local lvl
@@ -175,7 +174,6 @@ dlog_init() {
         ((lvl > maxloglvl_l)) && maxloglvl_l=$lvl
     done
     readonly maxloglvl=$maxloglvl_l
-    export maxloglvl
 
     if ((stdloglvl < 6)) && ((kmsgloglvl < 6)) && ((fileloglvl < 6)) && ((sysloglvl < 6)); then
         unset dtrace