Bug 27112 - /etc/init.d/functions: line 157: shift: number of "shift" out of range
Summary: /etc/init.d/functions: line 157: shift: number of "shift" out of range
Status: RESOLVED OLD
Alias: None
Product: Mageia
Classification: Unclassified
Component: RPM Packages (show other bugs)
Version: Cauldron
Hardware: All Linux
Priority: Normal normal
Target Milestone: Mageia 8
Assignee: Base system maintainers
QA Contact:
URL:
Whiteboard:
Keywords:
: 28945 (view as bug list)
Depends on:
Blocks:
 
Reported: 2020-08-14 16:56 CEST by Aurelien Oudelet
Modified: 2024-05-01 05:38 CEST (History)
4 users (show)

See Also:
Source RPM: initscripts-9.78-27.mga8.src.rpm
CVE:
Status comment:


Attachments

Description Aurelien Oudelet 2020-08-14 16:56:04 CEST
On Cauldron (Mageia 8 Beta 1 Classic ISO, Plasma),

See in logs after boot:
resolvconf[935]: Lancement de resolvconf : /etc/init.d/functions: ligne 157 : shift: nombre de « shift » hors plage

Not blocker, I don't know what's wrong in /etc/init.d/functions file at line 157.
Typo?

Assigning to basesystem maintainers.
Comment 1 Dave Hodgins 2020-08-14 19:06:39 CEST
As discussed on the dev ml ...
As it's only affecting init.d scripts, I confirmed adding the line
shopt -u shift_verbose
near the top of /etc/rc.d/init.d/functions fixes the problem.

CC: (none) => davidwhodgins

Aurelien Oudelet 2020-09-19 20:25:07 CEST

Severity: minor => normal
Priority: Low => Normal

Comment 2 Aurelien Oudelet 2021-05-19 11:18:16 CEST
*** Bug 28945 has been marked as a duplicate of this bug. ***

CC: (none) => mageia

Dick Gevers 2021-07-23 10:58:34 CEST

CC: (none) => dvgevers

Comment 3 w unruh 2024-04-30 21:48:12 CEST
Or removing that last shift 1  in line 157 seems to also solve it. I assume that is because if there is only one argument then shifting that one argument gives nonsense.

CC: (none) => unruh

Comment 4 w unruh 2024-04-30 21:51:13 CEST
shopt -u simply seems to throw away the error notice, instead of fixing the problem.
Comment 5 w unruh 2024-04-30 22:08:57 CEST
Oops. Mga 9 fixes this with

 *)
            GPRINTF_MSG=$(gprintf "$1")
            # function may be called without any arguments, e.g. for 'success'
            [ $# -ne 0 ] && shift
            ;;

although it was not fixed in Mga8.
So this should presumably be reverted to FIXED
Comment 6 Dave Hodgins 2024-05-01 05:38:01 CEST
While it's fixed in m9, it will not be fixed in m8.

Resolution: (none) => OLD
Status: NEW => RESOLVED


Note You need to log in before you can comment on or make changes to this bug.