Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 162435 - media-tv/freevo - checkconfig function in init script should return 0 on success
Summary: media-tv/freevo - checkconfig function in init script should return 0 on success
Status: RESOLVED WONTFIX
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High trivial
Assignee: Television related Applications in Gentoo's Portage
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-01-16 21:41 UTC by Aaron Stone
Modified: 2007-01-22 16:39 UTC (History)
0 users

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Aaron Stone 2007-01-16 21:41:26 UTC
The init script for freevo 1.6.1 (latest ~ package as of this bug report) has a function named 'checkconfig' that makes sure at least one service is available. If the function finds nothing configured, it prints and error and returns 1. If something is configured, the function does not return any specific value.

The function should return 0 when everything is OK. Otherwise it returns some undefined value (or maybe it is defined, but it sure ain't 0 for me!) which causes the script to bail without any message at all.

Simple one-line fix: put a 'return 0' at the end of the 'checkconfig' function.

Reproducible: Always
Comment 1 Matteo Azzali (RETIRED) gentoo-dev 2007-01-17 12:34:14 UTC
No checkconfig here:
#equery f freevo | grep config
/usr/lib/python2.4/site-packages/freevo/config.py
/usr/lib/python2.4/site-packages/freevo/helpers/convert_config.py
/usr/lib/python2.4/site-packages/freevo/video/configure.py
/usr/share/doc/freevo-1.6.1/plugin_writing/code/config.py
/usr/share/freevo/freevo_config.py

Could you please check that? Are you using the ebuild in portage tree?
Comment 2 Matteo Azzali (RETIRED) gentoo-dev 2007-01-17 12:40:46 UTC
Oh, that init script! Please read the warnings of the ebuild:

ewarn "Please remove ${ROOT}/etc/init.d/freevo because is no longer used"
ewarn "and runnining freevo as root could be a security risk"

That script is there only to grant compatibility (and time to switch) to
users, but is not supported anymore and you should REALLY find a better way
to autostart freevo, as from 1.7 or from 2.0 ebuild that script will be
removed.
Comment 3 Aaron Stone 2007-01-22 05:00:01 UTC
I am running the backend services on a server. Autologin shells are not an appropriate option for the 'recordserver' and 'webserver' facilities of Freevo. These sorts of daemon services are what init scripts are for! ;-)

Of course you are correct that the *frontend* should not be run as root as part of the init scripts, and I'm not challenging that position. I am challenging the assumption that Freevo is not being used as a backend recording system.
Comment 4 Matteo Azzali (RETIRED) gentoo-dev 2007-01-22 12:25:15 UTC
You would like to run recordserver as root, but this would mean that mencoder
itself would be run as root. Also it would mean that your recordings would be
owned by root. If you really need to autostart recordserver before login,
add the line:
su -c 'freevo recordserver start' username
where username is the name of a NONROOT user, to your /etc/conf.d/local.start
file. 
(there's no need of a password when the su command is executed from root)
Comment 5 Aaron Stone 2007-01-22 16:39:49 UTC
The right tool for this job is
'start-stop-daemon --user freevouser'