Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 609146 - app-emulation/lxd: lxd-*.initd are not POSIX compliant
Summary: app-emulation/lxd: lxd-*.initd are not POSIX compliant
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Erik Mackdanz
URL:
Whiteboard:
Keywords: PATCH
Depends on:
Blocks: 609070
  Show dependency tree
 
Reported: 2017-02-12 17:20 UTC by Andrew Savchenko
Modified: 2017-06-08 08:46 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
lxd.init.patch (lxd.init.patch,1.56 KB, patch)
2017-02-12 17:20 UTC, Andrew Savchenko
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Andrew Savchenko gentoo-dev 2017-02-12 17:20:37 UTC
Created attachment 463480 [details, diff]
lxd.init.patch

Hi,

init scripts should be POSIX compatible, see bug 609070.

However lxd init scripts are not: they use [[ ]] instead of [ ].

Proposed patch fixes this. It is quite simple, so I'll apply in two weeks if there are no objections.
Comment 1 Erik Mackdanz gentoo-dev 2017-03-20 04:46:26 UTC
I changed this for the latest 2.11 and subsequent versions.  I did not change existing versions, but they will fall off over time.
Comment 2 Jeff Kowalczyk 2017-03-23 22:13:39 UTC
With the current lxd-2.11.initd, I see the following message on service start:

$ sudo /etc/init.d/lxd restart                                                                                                    
/etc/init.d/lxd: line 30: [: =: unary operator expected
/etc/init.d/lxd: line 30: [: =: unary operator expected

Current line 30 is:

    if [ $RC_GOINGDOWN = YES ] || [ $RC_REBOOT = YES ]; then
Comment 3 Jeff Kowalczyk 2017-03-23 22:34:38 UTC
Changing line 30 to quote the arguments of the equality comparison avoids the warning:

    if [ "$RC_GOINGDOWN" = "YES" ] || [ "$RC_REBOOT" = "YES" ]; then

I haven't stepped through to check the conditions where one of the $RC_ are true, but if they are blank, as in the case of a service restart, I think the test fails.
Comment 4 Andrew Savchenko gentoo-dev 2017-03-23 23:48:38 UTC
Yes, double quotes are mandatory and are present in the original patch.
Erik, please fix this.
Comment 5 Zac Medico gentoo-dev 2017-06-08 08:46:48 UTC
(In reply to Andrew Savchenko from comment #4)
> Yes, double quotes are mandatory and are present in the original patch.
> Erik, please fix this.

I've included then in the lxd-2.14 version bump:

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7c15f08e00643b789f3ab4fcf80250b982bc5f2c