Bug 826377

Summary: mediatomb startup script hardcodes configuration values
Product: [Fedora] Fedora Reporter: Kenny Root <kenny>
Component: mediatombAssignee: Orphan Owner <extras-orphan>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 17CC: dchen, extras-orphan, humpf, mike, packages, samuel-rhbugs
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-12-20 15:54:03 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
mediatomb unit that uses the environment file
none
mediatomb unit that uses the environment 2 none

Description Kenny Root 2012-05-30 05:42:21 UTC
Description of problem:
The mediatomb startup script in /lib/systemd/system/mediatomb.service hardcodes all the values instead of reading them from /etc/mediatomb.conf

Version-Release number of selected component (if applicable):
0.12.1-fc16.x86_64

How reproducible:
100%

Steps to Reproduce:
1. Install mediatomb
2. Look at /lib/systemd/system/mediatomb.service
3.
  
Actual results:
Port, interface, home directory, etc are hardcoded

Expected results:
Items should be loaded with:

EnvironmentFile=-/etc/mediatomb.conf

and referred to like ${MT_INTERFACE}

Additional info:

Comment 1 Ian Chapman 2012-07-06 15:25:10 UTC
This issue still applies to mediatomb-0.12.1-16.fc17.x86_64. The file /etc/mediatomb.conf is included in the RPM which misleading because it's not actually used.

Comment 2 Jóhann B. Guðmundsson 2012-07-06 17:02:55 UTC
Created attachment 596669 [details]
mediatomb unit that uses the environment file

Since mediatomb.conf is not stored under /etc/sysconfig/ directory I decide to submit unit file that uses the environment file which arguably is not needed since user can just copy the medatomb.service to /etc/systemd/systemd directory and adjust the parameters there.. 

In anycase to test this just copy/save this file under /etc/systemd/system directory and run systemctl daemon-reload and stop/start the service...

Comment 3 Ian Chapman 2012-07-07 11:38:37 UTC
(In reply to comment #2)
> Created attachment 596669 [details]
> mediatomb unit that uses the environment file
> 
> Since mediatomb.conf is not stored under /etc/sysconfig/ directory I decide
> to submit unit file that uses the environment file which arguably is not
> needed since user can just copy the medatomb.service to /etc/systemd/systemd
> directory and adjust the parameters there.. 

Yes it is arguable whether it's needed or not, but the configuration file shouldn't be there if one is expected to copy and edit the service file or at least it could contain a note saying I'm now deprecated. 

> In anycase to test this just copy/save this file under /etc/systemd/system
> directory and run systemctl daemon-reload and stop/start the service...

I have copied the mediatomb.service file to /etc/systemd/system and it works as expected. Thanks you very much.

Comment 4 Ding-Yi Chen 2012-10-11 07:16:48 UTC
Well, actually /etc/mediatomb.conf is still respected, but since command line options (which is hardcoded in mediatomb.service) have higher priority, thus option in mediatome is shadowed.

Mind removing the hardcoded options? :-)

Comment 5 Ryan W 2012-10-13 18:40:34 UTC
Created attachment 626613 [details]
mediatomb unit that uses the environment 2

A slight improvement on the other unit file which uses a specified PID file rather than the one from the config.

Comment 6 Fedora Update System 2012-10-30 14:57:09 UTC
mediatomb-0.12.1-20.fc18 has been submitted as an update for Fedora 18.
https://admin.fedoraproject.org/updates/mediatomb-0.12.1-20.fc18

Comment 7 Fedora Update System 2012-10-30 20:16:19 UTC
Package mediatomb-0.12.1-20.fc18:
* should fix your issue,
* was pushed to the Fedora 18 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing mediatomb-0.12.1-20.fc18'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2012-17263/mediatomb-0.12.1-20.fc18
then log in and leave karma (feedback).

Comment 8 Fedora Update System 2012-12-20 15:54:06 UTC
mediatomb-0.12.1-20.fc18 has been pushed to the Fedora 18 stable repository.  If problems still persist, please make note of it in this bug report.