Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 525404 - net-misc/memcached - /etc/init.d/memcached has bashisms
Summary: net-misc/memcached - /etc/init.d/memcached has bashisms
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Server (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Robin Johnson
URL:
Whiteboard:
Keywords: PATCH
Depends on:
Blocks:
 
Reported: 2014-10-14 13:46 UTC by Matthew Schultz
Modified: 2014-10-17 02:30 UTC (History)
1 user (show)

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


Attachments
memcached.init.patch (memcached.init.patch,364 bytes, patch)
2014-10-14 14:02 UTC, Matthew Schultz
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Matthew Schultz 2014-10-14 13:46:45 UTC
When shell is set to the dash shell, memcached does not start properly.  I will be attaching a patch to fix this.

Reproducible: Always

Steps to Reproduce:
1. emerge dash && emerge eselect-sh
2. eselect sh set 2
3. /etc/init.d/memcached start
Actual Results:  
/etc/init.d/memcached start
/lib64/rc/sh/runscript.sh: 7: [: memcached: unexpected operator
 * The configuration file /etc/conf.d/memcached.memcached was not found!
 * Starting memcached (memcached) ...                                                                                                                                                                        [ ok ]

Expected Results:  
/etc/init.d/memcached start
 * Caching service dependencies ...                                                                                                                                                                          [ ok ]
 * Starting memcached ...                                                                                                                                                                                    [ ok ]
Comment 1 Matthew Schultz 2014-10-14 14:02:59 UTC
Created attachment 386670 [details, diff]
memcached.init.patch
Comment 2 Matthew Thode ( prometheanfire ) archtester Gentoo Infrastructure gentoo-dev Security 2014-10-15 04:02:37 UTC
can you test changing that equal sign to -eq instead.

= is an assignment
== (and -eq) are checks
Comment 3 Matthew Schultz 2014-10-15 13:28:26 UTC
(In reply to Matthew Thode ( prometheanfire ) from comment #2)
> can you test changing that equal sign to -eq instead.
> 
> = is an assignment
> == (and -eq) are checks

= is most certainly a string comparison in that context:

http://stackoverflow.com/questions/1089813/bash-dash-and-string-comparison
Comment 4 Matthew Thode ( prometheanfire ) archtester Gentoo Infrastructure gentoo-dev Security 2014-10-17 02:30:18 UTC
fixed in 1.4.20-r1