Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 833206 - www-apps/tt-rss openrc service fails to run with dash
Summary: www-apps/tt-rss openrc service fails to run with dash
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: James Le Cuirot
URL:
Whiteboard:
Keywords: PATCH
Depends on:
Blocks: nonbash
  Show dependency tree
 
Reported: 2022-02-12 20:29 UTC by Anna Vyalkova
Modified: 2022-02-20 05:05 UTC (History)
1 user (show)

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


Attachments
ttrssd.initd-r4 (ttrssd.initd-r4,2.85 KB, text/plain)
2022-02-12 20:34 UTC, Anna Vyalkova
Details
ttrssd.initd-r4 (updated) (ttrssd.initd-r4,2.80 KB, text/plain)
2022-02-14 17:55 UTC, Anna Vyalkova
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Anna Vyalkova 2022-02-12 20:29:17 UTC
Steps to Reproduce:
1. eselect sh set dash
2. rc-service ttrssd start

Actual Results:
 * Caching service dependencies ... [ ok ]
/lib/rc/sh/openrc-run.sh: 29: Bad substitution
 * Starting TT-RSS update daemon in /var/www/<omitted> ...
 * start-stop-daemon: /usr/bin/php died [ !! ]
 * ERROR: ttrssd failed to start
Comment 1 Anna Vyalkova 2022-02-12 20:34:36 UTC
Created attachment 764950 [details]
ttrssd.initd-r4

Here's my fixed version. Changelog:
* Fixed bashisms in instance_dir_to_name() function
* Fixed ksh93 syntax (IFS=$'\n') not present in dash
* Renamed setup() into start_pre()
* Added status() function so ttrssd can be restarted now

Signed-off-by: Anna Vyalkova <cyber+gentoo@sysrq.in>
Comment 2 James Le Cuirot gentoo-dev 2022-02-13 15:08:16 UTC
Thanks! Sorry for the bashisms, I forget what some of them are.

IFS=$(printf "\n" "") doesn't work for me. Not sure why you need the extra "" but $(printf "\n") doesn't work either. This does work though:

IFS="
"

For the status() function, I'd rather do it like this:

start-stop-daemon --signal 0 --pidfile "${PID_DIR}/${instance_name}.pid"

Please could you amend and try it out?
Comment 3 Anna Vyalkova 2022-02-14 17:55:33 UTC
Created attachment 765104 [details]
ttrssd.initd-r4 (updated)

(In reply to James Le Cuirot from comment #2)
> Not sure why you need the extra "" but $(printf "\n") doesn't work either. This does work though:
> 
> IFS="
> "

Done.

> For the status() function, I'd rather do it like this:
> 
> start-stop-daemon --signal 0 --pidfile "${PID_DIR}/${instance_name}.pid"

Done.

Signed-off-by: Anna Vyalkova <cyber+gentoo@sysrq.in>
Comment 4 Larry the Git Cow gentoo-dev 2022-02-19 16:00:55 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6bbd050f9ecc0fadd9fae6eabc7206a6042d397f

commit 6bbd050f9ecc0fadd9fae6eabc7206a6042d397f
Author:     James Le Cuirot <chewi@gentoo.org>
AuthorDate: 2022-02-19 15:59:25 +0000
Commit:     James Le Cuirot <chewi@gentoo.org>
CommitDate: 2022-02-19 16:00:37 +0000

    www-apps/tt-rss: Bump to 20220218, EAPI 8, fix for dash, fix permissions
    
    Thanks to Anna Vyalkova for the dash fix. Note that the configuration syntax has
    changed since the last version.
    
    Closes: https://bugs.gentoo.org/833206
    Signed-off-by: James Le Cuirot <chewi@gentoo.org>

 www-apps/tt-rss/Manifest                           |   1 +
 www-apps/tt-rss/files/permissions-r1               |  24 +++++
 .../tt-rss/files/postinstall-en-with-daemon-r1.txt |   3 +-
 www-apps/tt-rss/files/postinstall-en.txt           |   3 +-
 www-apps/tt-rss/files/tt-rss-no-chmod.patch        |  26 +++++
 www-apps/tt-rss/files/ttrssd.initd-r4              | 119 +++++++++++++++++++++
 www-apps/tt-rss/tt-rss-20200922.ebuild             |   5 -
 www-apps/tt-rss/tt-rss-20220218.ebuild             |  90 ++++++++++++++++
 www-apps/tt-rss/tt-rss-99999999.ebuild             |  20 ++--
 9 files changed, 271 insertions(+), 20 deletions(-)