Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 332481

Summary: app-text/dictd init script rewrites /etc/dict/dictd.conf on every boot
Product: Gentoo Linux Reporter: C W Rose <cwr>
Component: Current packagesAssignee: Spell checking utilities and dictionaries -- related bugs (OBSOLETE) <app-dicts+disabled>
Status: VERIFIED WORKSFORME    
Severity: enhancement    
Priority: High    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: Revised /etc/init.d/dictd script

Description C W Rose 2010-08-12 16:20:32 UTC
The current /etc/init.d/dictd file,
/var/cvsroot/gentoo-x86/app-text/dictd/files/1.10.11/dictd.initd,v 1.3 2008/11/08 18:36:21 pva Exp $
rewrites the /etc/dictd.conf file on every boot even if there's been no change
in the dictionarie in use.  Attached is a script which rewrites only as necessary,
so that the dictd.conf file date doesn't keep changing.  If the dictd package
is ever updated it might be worth using this script; it requires bash, not sh,
but so do a number of the init.d scripts.

Will


Reproducible: Always
Comment 1 C W Rose 2010-08-12 16:22:08 UTC
Created attachment 242623 [details]
Revised /etc/init.d/dictd script
Comment 2 Peter Volkov (RETIRED) gentoo-dev 2010-08-13 07:09:18 UTC
Nice job! Unfortunately init scripts that require bash are buggy and should be rewritten to avoid bash. If you know such init scripts, please, open separate bugs.

Now if you manage to fix dictd init scripts without bash, please, attach diff here and I'll happily apply it :)

BTW, also could you use $() instead of ``? This form is proffered as:
http://mywiki.wooledge.org/BashFAQ/082
and it's in posix:
http://www.opengroup.org/onlinepubs/009695399/utilities/xcu_chap02.html#tag_02_06_03

I'll close bug until better times as current behavior works for me and does not violate our requirement for init scripts to be sh compatible.
Comment 3 C W Rose 2010-08-13 10:45:57 UTC
If you want to find bash init scripts, just run "grep bash" in /etc/init.d

I won't be rewriting the script, since it works for me, and I don't regard
bash, which is my standard shell, as buggy.
Comment 4 Peter Volkov (RETIRED) gentoo-dev 2010-08-23 11:54:01 UTC
(In reply to comment #3)
> If you want to find bash init scripts, just run "grep bash" in /etc/init.d

Just did that: 0 scripts use bash on my system. I guess you are using stable baselayout-1 that use bash. But baselayout-1 will be replaced with openrc and openrc should work even on systems without bash. Thus init scrips other then from baselayout-1 package should never use bash.

> I won't be rewriting the script, since it works for me, and I don't regard
> bash, which is my standard shell, as buggy.

I never told that bash is buggy. But there is distribution standard that prohibit bash usage inside init scripts and thus I'm not allowed (and I do not want) to commit this init script into the tree.
Comment 5 C W Rose 2010-08-24 15:45:25 UTC
I think I'd be more impressed by your arguments if your
current script was Posix compliant, without bashisms.

Anyhow, I rewrote the change to allow the script to run
under Posix , but it made for a pretty messy solution.
On the whole, I think I'll stick with bash.

Comment 6 Peter Volkov (RETIRED) gentoo-dev 2010-08-25 09:35:49 UTC
If you have anything constructive to add, please, do. If your are going to whine - go to your mother and shut up here, please.